f-41: l3vni: routage des VPC sorti de vpc dans son propre paquet #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
472c2558fd
commit
87e97c8be1
18 changed files with 80 additions and 66 deletions
15
internal/l3vni/l3vni.go
Normal file
15
internal/l3vni/l3vni.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package l3vni
|
||||
|
||||
import "fmt"
|
||||
|
||||
const maxL3VNI = 1<<24 - 1
|
||||
|
||||
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 >= 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue