Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport v1.9: Fix possible deadlock when querying netdevs #15227

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535
github.com/aws/aws-sdk-go-v2 v0.24.0
github.com/blang/semver v3.5.0+incompatible
github.com/cilium/arping v1.0.1-0.20210125181454-ec36642003a5
github.com/cilium/arping v1.0.1-0.20210305111713-3425030fd8c2
github.com/cilium/deepequal-gen v0.0.0-20200406125435-ad6a9003139e
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775
github.com/cilium/ipam v0.0.0-20201020084809-76717fcdb3a2
Expand Down Expand Up @@ -71,7 +71,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.6.1
github.com/vishvananda/netlink v1.1.1-0.20201231054507-6ffafa9fc19b
github.com/vishvananda/netlink v1.1.1-0.20210304225204-ec93726159ae
github.com/vishvananda/netns v0.0.0-20201230012202-c4f3ca719c73
go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
go.uber.org/goleak v1.0.0
Expand Down Expand Up @@ -107,7 +107,7 @@ replace (
github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b

// Using cilium/netlink until XFRM patches merged upstream
github.com/vishvananda/netlink => github.com/cilium/netlink v0.0.0-20210223023818-d826f2a4c934
github.com/vishvananda/netlink => github.com/cilium/netlink v1.0.1-0.20210305225027-66e1713b4f2e
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.2.8 // To avoid https://github.com/go-yaml/yaml/pull/571.
k8s.io/client-go => github.com/cilium/client-go v0.0.0-20210218151335-3861ecd89595

Expand Down
8 changes: 4 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions pkg/datapath/linux/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,20 +710,14 @@ func (n *linuxNodeHandler) insertNeighbor(ctx context.Context, newNode *nodeType

// nextHop hasn't been arpinged before OR we are refreshing neigh entry
if nextHopIsNew || refresh {
iface, err := net.InterfaceByName(ifaceName)
if err != nil {
scopedLog.WithError(err).Error("Failed to retrieve iface by name")
return
}

linkAttr, err := netlink.LinkByName(ifaceName)
if err != nil {
scopedLog.WithError(err).Error("Failed to retrieve iface by name (netlink)")
return
}
link := linkAttr.Attrs().Index

hwAddr, _, err := arping.PingOverIface(nextHopIPv4, *iface, srcIPv4)
hwAddr, _, err := arping.PingOverIface(nextHopIPv4, linkAttr, srcIPv4)
if err != nil {
scopedLog.WithError(err).Error("arping failed")
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/datapath/linux/route/route_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *Route) getNetlinkRoute() netlink.Route {
Dst: &r.Prefix,
Src: r.Local,
MTU: r.MTU,
Protocol: r.Proto,
Protocol: netlink.RouteProtocol(r.Proto),
Table: r.Table,
Type: r.Type,
}
Expand Down
87 changes: 6 additions & 81 deletions vendor/github.com/cilium/arping/arping.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 0 additions & 101 deletions vendor/github.com/cilium/arping/arping_bsd.go

This file was deleted.

7 changes: 4 additions & 3 deletions vendor/github.com/cilium/arping/arping_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions vendor/github.com/cilium/arping/arping_windows.go

This file was deleted.

2 changes: 2 additions & 0 deletions vendor/github.com/cilium/arping/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/github.com/cilium/arping/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading