f-41: vpc: VRF, L3VNI et transit à la création des VPC routées #41

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-11 20:21:19 +02:00
commit 3c6852dc18
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
8 changed files with 541 additions and 5 deletions

View file

@ -1,6 +1,8 @@
package netif
import (
"errors"
"github.com/vishvananda/netlink"
)
@ -11,3 +13,15 @@ func DeleteLink(name string) error {
}
return netlink.LinkDel(link)
}
func DeleteLinkIfExists(name string) error {
link, err := netlink.LinkByName(name)
if err != nil {
var notFound netlink.LinkNotFoundError
if errors.As(err, &notFound) {
return nil
}
return err
}
return netlink.LinkDel(link)
}