two/internal/l3vni/l3vni.go
GnomeZworc c9d0002041
f-41: l3vni: borne à 65535 (RD <VTEP>:<l3vni> sur 16 bits) #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-10-12 14:01:50 +02:00

17 lines
431 B
Go

package l3vni
import (
"fmt"
"git.g3e.fr/syonad/two/internal/frr"
)
func Valid(id uint32) error {
if id == 0 || id > frr.MaxL3VNI {
return fmt.Errorf("l3vni %d out of range 1-%d: the route distinguisher <vtep>:<l3vni> holds 16 bits", id, frr.MaxL3VNI)
}
if id >= 253 && id <= 255 {
return fmt.Errorf("l3vni %d is reserved: it is also the routing table id, and tables 253-255 belong to the kernel", id)
}
return nil
}