Skip to content

Commit c3e55e4

Browse files
committed
Work around a kernel bug in the assign-macvlan code
1 parent b7413ea commit c3e55e4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cmd/sdn-cni-plugin/openshift-sdn_linux.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ func (p *cniPlugin) CmdAdd(args *skel.CmdArgs) error {
193193
// add a route to that via the SDN
194194
var addrs []netlink.Addr
195195
err = hostNS.Do(func(ns.NetNS) error {
196-
parent, err := netlink.LinkByIndex(link.Attrs().ParentIndex)
196+
// workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1705686
197+
parentIndex := link.Attrs().ParentIndex
198+
if parentIndex == 0 {
199+
parentIndex = link.Attrs().Index
200+
}
201+
202+
parent, err := netlink.LinkByIndex(parentIndex)
197203
if err != nil {
198204
return err
199205
}

0 commit comments

Comments
 (0)