diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-10-20 10:22:14 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-10-20 10:22:14 +0100 |
commit | 46eedbedafdb0040c37884982d4c775ce277fb7b (patch) | |
tree | db33a91259730be84999e13a8d8168c799f50ac0 /net-misc/iputils/files | |
parent | e23a08d0c97a0cc415aaa165da840b056f93c997 (diff) |
gentoo resync : 20.10.2021
Diffstat (limited to 'net-misc/iputils/files')
-rw-r--r-- | net-misc/iputils/files/iputils-20210722-fix-no-ipv6-ping.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/net-misc/iputils/files/iputils-20210722-fix-no-ipv6-ping.patch b/net-misc/iputils/files/iputils-20210722-fix-no-ipv6-ping.patch new file mode 100644 index 000000000000..61f9f5c03fd6 --- /dev/null +++ b/net-misc/iputils/files/iputils-20210722-fix-no-ipv6-ping.patch @@ -0,0 +1,47 @@ +https://github.com/iputils/iputils/commit/79d713eab6181e219bf932b404706f6f59ff2539.patch +https://bugs.gentoo.org/818022 + +From: Byron Stanoszek <gandalf@winds.org> +Date: Thu, 16 Sep 2021 23:38:54 +0200 +Subject: [PATCH] ping: Remove 'unsupported IPv6' warning on disabled IPv6 + +Regression was introduced in d141cb6 as introduced condition + +if ((errno == EAFNOSUPPORT && socktype == AF_INET6) || options & F_VERBOSE || requisite) + +was wrong, it should have been: + +if ((errno == EAFNOSUPPORT && family == AF_INET6 && requisite) || options & F_VERBOSE) + +but bug was hidden as `family == AF_INET6' was always false until +otherwise correct fix 904cdb6 ("ping: AF_INET6 is address family not +socket type [lgtm scan]") propagated the error. + +Tested on kernel booted with ipv6.disable=1 (disabling via sysctl, i.e. +sysctl -w net.ipv6.conf.all.disable_ipv6=1; sysctl -w net.ipv6.conf.default.disable_ipv6=1 +does not trigger the issue as it exit with "socket: Address family not +supported by protocol" - errno EADDRNOTAVAIL). + +Fixes: d141cb6 ("ping: work with older kernels that don't support ping sockets") +Closes: https://github.com/iputils/iputils/issues/293 +Closes: https://github.com/iputils/iputils/pull/370 + +Reported-by: lekto <lekto@o2.pl> +Reviewed-by: Andrew Clayton <andrew@digital-domain.net> +Reviewed-by: Petr Vorel <pvorel@suse.cz> +Signed-off-by: Byron Stanoszek <gandalf@winds.org> +[ pvorel: create commit from Byron's patch on the issue, do analysis and wrote commit message ] +Signed-off-by: Petr Vorel <pvorel@suse.cz> +--- a/ping/ping.c ++++ b/ping/ping.c +@@ -150,8 +150,8 @@ static void create_socket(struct ping_rts *rts, socket_st *sock, int family, + /* Report error related to disabled IPv6 only when IPv6 also failed or in + * verbose mode. Report other errors always. + */ +- if ((errno == EAFNOSUPPORT && family == AF_INET6) || +- rts->opt_verbose || requisite) ++ if ((errno == EAFNOSUPPORT && family == AF_INET6 && requisite) || ++ rts->opt_verbose) + error(0, errno, "socket"); + if (requisite) + exit(2); |