Skip to content

Commit cf89496

Browse files
Merge pull request #22784 from danwinship/macvlan-ifindex-workaround
Bug 1705686: Work around a kernel bug in the assign-macvlan code
2 parents 87b791c + c3e55e4 commit cf89496

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
@@ -206,7 +206,13 @@ func (p *cniPlugin) CmdAdd(args *skel.CmdArgs) error {
206206
// add a route to that via the SDN
207207
var addrs []netlink.Addr
208208
err = hostNS.Do(func(ns.NetNS) error {
209-
parent, err := netlink.LinkByIndex(link.Attrs().ParentIndex)
209+
// workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1705686
210+
parentIndex := link.Attrs().ParentIndex
211+
if parentIndex == 0 {
212+
parentIndex = link.Attrs().Index
213+
}
214+
215+
parent, err := netlink.LinkByIndex(parentIndex)
210216
if err != nil {
211217
return err
212218
}

0 commit comments

Comments
 (0)