f-21: debug: make mtu parametrable in full netif

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-26 14:56:17 +02:00
commit 71aaaacf7b
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import (
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
) )
func CreateVxlan(name string, vxlanID int, localIface string) error { func CreateVxlan(name string, vxlanID int, localIface string, mtu int) error {
link, err := netlink.LinkByName(localIface) link, err := netlink.LinkByName(localIface)
if err != nil { if err != nil {
return err return err
@ -12,6 +12,7 @@ func CreateVxlan(name string, vxlanID int, localIface string) error {
vxlan := &netlink.Vxlan{ vxlan := &netlink.Vxlan{
LinkAttrs: netlink.LinkAttrs{ LinkAttrs: netlink.LinkAttrs{
Name: name, Name: name,
MTU: mtu,
}, },
VxlanId: vxlanID, VxlanId: vxlanID,
Port: 4789, Port: 4789,

View file

@ -86,7 +86,7 @@ func CreateSubnet(db *badger.DB, subnetName string) error {
} }
// vxlan // vxlan
if err := netif.CreateVxlan(vxlanIface, vxlanID, localIface); err != nil { if err := netif.CreateVxlan(vxlanIface, vxlanID, localIface, 1500); err != nil {
return fmt.Errorf("create vxlan: %w", err) return fmt.Errorf("create vxlan: %w", err)
} }