upgpkg: ocaml-ctypes 0.20.2-1
[arch-packages.git] / fping / trunk / 0001-fix-unprivileged-ping-broken-in-v5.1-fixes-248.patch
blob69c5d9ab1911b5ecc3d52853199d6279656674ba
1 From e975a4339b24716fb57bed234b0a1176f2bf3451 Mon Sep 17 00:00:00 2001
2 From: David Schweikert <david@schweikert.ch>
3 Date: Sun, 13 Feb 2022 17:45:57 +0100
4 Subject: [PATCH] fix unprivileged ping broken in v5.1 (fixes #248)
6 ---
7 src/fping.c | 4 ++--
8 1 files changed, 2 insertions(+), 2 deletions(-)
10 diff --git a/src/fping.c b/src/fping.c
11 index e26b216..0bd2b70 100644
12 --- a/src/fping.c
13 +++ b/src/fping.c
14 @@ -1104,11 +1104,11 @@ int main(int argc, char** argv)
15 exit(num_noaddress ? 2 : 1);
18 - if (src_addr_set && socket4 >= 0) {
19 + if (socket4 >= 0 && (src_addr_set || socktype4 == SOCK_DGRAM)) {
20 socket_set_src_addr_ipv4(socket4, &src_addr, (socktype4 == SOCK_DGRAM) ? &ident4 : NULL);
22 #ifdef IPV6
23 - if (src_addr6_set && socket6 >= 0) {
24 + if (socket6 >= 0 && (src_addr6_set || socktype4 == SOCK_DGRAM)) {
25 socket_set_src_addr_ipv6(socket6, &src_addr6, (socktype6 == SOCK_DGRAM) ? &ident6 : NULL);
27 #endif