diff options
| author | 2020-04-27 09:34:55 +0200 | |
|---|---|---|
| committer | 2020-04-27 09:34:55 +0200 | |
| commit | 96fa72ffb2155dba9ba8c5d282a1ff19ed32f177 (patch) | |
| tree | 97e3dad8795e54405d450315363d7006bc2c2e35 /tools/lib/bpf/netlink.c | |
| parent | Add documentation on meaning of -EPROBE_DEFER (diff) | |
| parent | Linux 5.7-rc3 (diff) | |
| download | wireguard-linux-96fa72ffb2155dba9ba8c5d282a1ff19ed32f177.tar.xz wireguard-linux-96fa72ffb2155dba9ba8c5d282a1ff19ed32f177.zip | |
Merge 5.7-rc3 into driver-core-next
We need the driver core fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/bpf/netlink.c')
| -rw-r--r-- | tools/lib/bpf/netlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/lib/bpf/netlink.c b/tools/lib/bpf/netlink.c index 18b5319025e1..312f887570b2 100644 --- a/tools/lib/bpf/netlink.c +++ b/tools/lib/bpf/netlink.c @@ -142,7 +142,7 @@ static int __bpf_set_link_xdp_fd_replace(int ifindex, int fd, int old_fd, struct ifinfomsg ifinfo; char attrbuf[64]; } req; - __u32 nl_pid; + __u32 nl_pid = 0; sock = libbpf_netlink_open(&nl_pid); if (sock < 0) @@ -288,7 +288,7 @@ int bpf_get_link_xdp_info(int ifindex, struct xdp_link_info *info, { struct xdp_id_md xdp_id = {}; int sock, ret; - __u32 nl_pid; + __u32 nl_pid = 0; __u32 mask; if (flags & ~XDP_FLAGS_MASK || !info_size) @@ -321,7 +321,9 @@ int bpf_get_link_xdp_info(int ifindex, struct xdp_link_info *info, static __u32 get_xdp_id(struct xdp_link_info *info, __u32 flags) { - if (info->attach_mode != XDP_ATTACHED_MULTI) + flags &= XDP_FLAGS_MODES; + + if (info->attach_mode != XDP_ATTACHED_MULTI && !flags) return info->prog_id; if (flags & XDP_FLAGS_DRV_MODE) return info->drv_prog_id; |
