libbpf: use AF_LOCAL instead of AF_INET in xsk.c
Subsystems (4)
PATCH 1/1 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.
--- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/xsk.c +1 -1
@@ -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;
Signature · 1 line
2.30.0.478.g8a0d178c01-goog
Quoted 6 lines · Stanislav Fomichev
We have the environments where usage of
AF_INETis prohibited (cgroup/sock_create returns EPERM forAF_INET). Let's useAF_LOCALinstead ofAF_INET, it should perfectly work with SIOCETHTOOL.Signed-off-by Stanislav Fomichev <[email protected]>
Stanislav, apologies for the delay!
Björn
Quoted 20 lines
--- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/lib/bpf/xsk.c +1
-2@@ -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; --2.30.0.478.g8a0d178c01-goog
Quoted 9 lines · Bj�rn T�pel
Quoted 6 lines · Stanislav Fomichev
We have the environments where usage of
AF_INETis prohibited (cgroup/sock_create returns EPERM forAF_INET). Let's useAF_LOCALinstead ofAF_INET, it should perfectly work with SIOCETHTOOL.Signed-off-by Stanislav Fomichev <[email protected]>Stanislav, apologies for the delay!
No worries, thank you for the review and testing!
Quoted 27 lines
Tested-by Bj�rn T�pel <[email protected]>Acked-by Bj�rn T�pel <[email protected]>Bj�rn
tools/lib/bpf/xsk.c static int xsk_get_max_queues(struct xsk_socket
Quoted 9 lines
--- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/lib/bpf/xsk.c +0
-0@@ -517,7 +517,7 @@ static int xsk_get_max_queues(struct xsk_socket*xsk)
Quoted 11 lines
tools/lib/bpf/xsk.c +1
-2struct 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; --2.30.0.478.g8a0d178c01-goog
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Quoted 8 lines · On Tue, 9 Feb 2021 14:18:26 -0800 you wrote:
We have the environments where usage of
AF_INETis prohibited (cgroup/sock_create returns EPERM forAF_INET). Let's useAF_LOCALinstead ofAF_INET, it should perfectly work with SIOCETHTOOL.Signed-off-by Stanislav Fomichev <[email protected]>--- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next] libbpf: use AF_LOCAL instead of AF_INET in xsk.c
https://git.kernel.org/bpf/bpf-next/c/1e0aa3fb05f8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html