f-41: netif: HostMAC et MaxVNI partagés (RMAC, MAC de gateway, borne des VNI) #41

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-12 12:23:48 +02:00
commit 853a1b8377
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
10 changed files with 99 additions and 91 deletions

View file

@ -4,9 +4,9 @@ import (
"fmt"
"net"
"strings"
)
const maxVNI = 1<<24 - 1
"git.g3e.fr/syonad/two/internal/netif"
)
type Base struct {
ASN uint32
@ -116,7 +116,7 @@ func (v VRF) validate() error {
if err := v.validateName(); err != nil {
return err
}
if v.L3VNI == 0 || v.L3VNI > maxVNI {
if v.L3VNI == 0 || v.L3VNI > netif.MaxVNI {
return fmt.Errorf("frr: l3vni %d does not fit in 24 bits", v.L3VNI)
}
if v.VTEP.To4() == nil {