Patch-Source: https://github.com/schweikert/fping/commit/e975a4339b24716fb57bed234b0a1176f2bf3451 -- Author: David Schweikert Committer: Nash Kaminski Summary: This patch backports the upstream bugfix from https://github.com/schweikert/fping/issues/248 for a regression introduced in version 5.1 which prevents fping from functioning when run in an unprivileged container. ---- diff --git a/src/fping.c b/src/fping.c index e26b216c..0bd2b70c 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1104,11 +1104,11 @@ int main(int argc, char** argv) exit(num_noaddress ? 2 : 1); } - if (src_addr_set && socket4 >= 0) { + if (socket4 >= 0 && (src_addr_set || socktype4 == SOCK_DGRAM)) { socket_set_src_addr_ipv4(socket4, &src_addr, (socktype4 == SOCK_DGRAM) ? &ident4 : NULL); } #ifdef IPV6 - if (src_addr6_set && socket6 >= 0) { + if (socket6 >= 0 && (src_addr6_set || socktype4 == SOCK_DGRAM)) { socket_set_src_addr_ipv6(socket6, &src_addr6, (socktype6 == SOCK_DGRAM) ? &ident6 : NULL); } #endif