File: config_linux.go

package info (click to toggle)
golang-github-containers-common 0.50.1%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,440 kB
  • sloc: makefile: 118; sh: 46
file content (20 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//go:build linux
// +build linux

package cni

import (
	"github.com/sirupsen/logrus"
	"github.com/vishvananda/netlink"
)

func deleteLink(name string) {
	link, err := netlink.LinkByName(name)
	if err == nil {
		err = netlink.LinkDel(link)
		// only log the error, it is not fatal
		if err != nil {
			logrus.Infof("Failed to remove network interface %s: %v", name, err)
		}
	}
}