Skip to content

Commit

Permalink
libbpf: Use AF_LOCAL instead of AF_INET in xsk.c
Browse files Browse the repository at this point in the history
We have the environments where usage of AF_INET is prohibited
(cgroup/sock_create returns EPERM for AF_INET). Let's use
AF_LOCAL instead of AF_INET, it should perfectly work with SIOCETHTOOL.

Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Tested-by: Björn Töpel <[email protected]>
Acked-by: Björn Töpel <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
fomichev authored and anakryiko committed Feb 12, 2021
1 parent b2e37a7 commit 1e0aa3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/bpf/xsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ static int xsk_get_max_queues(struct xsk_socket *xsk)
struct ifreq ifr = {};
int fd, err, ret;

fd = socket(AF_INET, SOCK_DGRAM, 0);
fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (fd < 0)
return -errno;

Expand Down

0 comments on commit 1e0aa3f

Please sign in to comment.