diff options
author | Stanislav Fomichev <sdf@google.com> | 2021-02-10 01:18:26 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-02-12 22:36:48 +0300 |
commit | 1e0aa3fb05f8be0201e05a3f4e6c8910b9071e96 (patch) | |
tree | 8818f425608d63efccf71700f41dcfe0c05948b5 /tools/lib/bpf/xsk.c | |
parent | b2e37a7114ef52b862b4421ed4cd40c4ed2a0642 (diff) | |
download | linux-1e0aa3fb05f8be0201e05a3f4e6c8910b9071e96.tar.xz |
libbpf: Use AF_LOCAL instead of AF_INET in xsk.c
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 <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Björn Töpel <bjorn.topel@intel.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Link: https://lore.kernel.org/bpf/20210209221826.922940-1-sdf@google.com
Diffstat (limited to 'tools/lib/bpf/xsk.c')
-rw-r--r-- | tools/lib/bpf/xsk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 20500fb1f17e..ffbb588724d8 100644 --- a/tools/lib/bpf/xsk.c +++ b/tools/lib/bpf/xsk.c @@ -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; |