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:
parent
87e97c8be1
commit
387a082c02
10 changed files with 99 additions and 91 deletions
|
|
@ -1,12 +1,14 @@
|
|||
package l3vni
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
const maxL3VNI = 1<<24 - 1
|
||||
"git.g3e.fr/syonad/two/internal/netif"
|
||||
)
|
||||
|
||||
func Valid(id uint32) error {
|
||||
if id == 0 || id > maxL3VNI {
|
||||
return fmt.Errorf("l3vni %d does not fit in 24 bits (1-%d)", id, maxL3VNI)
|
||||
if id == 0 || id > netif.MaxVNI {
|
||||
return fmt.Errorf("l3vni %d does not fit in 24 bits (1-%d)", id, netif.MaxVNI)
|
||||
}
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue