Skip to content
Snippets Groups Projects
Commit 34b5c076 authored by Nash Kaminski's avatar Nash Kaminski Committed by alice
Browse files

main/fping: backport fix for ping from unprivileged containers

parent b6dc9ce2
No related branches found
No related tags found
No related merge requests found
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fping pkgname=fping
pkgver=5.1 pkgver=5.1
pkgrel=1 pkgrel=2
pkgdesc="A utility to ping multiple hosts at once" pkgdesc="A utility to ping multiple hosts at once"
url="https://fping.org/" url="https://fping.org/"
arch="all" arch="all"
license="MIT" license="MIT"
makedepends="libcap" makedepends="libcap"
subpackages="$pkgname-doc" subpackages="$pkgname-doc"
source="https://fping.org/dist/fping-$pkgver.tar.gz" source="https://fping.org/dist/fping-$pkgver.tar.gz
unprivileged-ping.patch
"
options="!check" # no testsuite options="!check" # no testsuite
build() { build() {
...@@ -28,4 +30,5 @@ package() { ...@@ -28,4 +30,5 @@ package() {
sha512sums=" sha512sums="
1a208da8dcd99093d0512af5d85ba5e7b5743ec97993d24c1fe612bb58d93090ac1ba0952f648aa075f16d390a77c4be65e394ae56dbede2a6914e0e8c68e2bd fping-5.1.tar.gz 1a208da8dcd99093d0512af5d85ba5e7b5743ec97993d24c1fe612bb58d93090ac1ba0952f648aa075f16d390a77c4be65e394ae56dbede2a6914e0e8c68e2bd fping-5.1.tar.gz
57fb8976a382ef21200430a238985cec04ecb72458e67d02ae4eac3af4f14108ad90460d562ee9f46a579d6226335b9391542c641acd2c6e1736fa138176e52f unprivileged-ping.patch
" "
Patch-Source: https://github.com/schweikert/fping/commit/e975a4339b24716fb57bed234b0a1176f2bf3451
--
Author: David Schweikert <david@schweikert.ch>
Committer: Nash Kaminski <Nash.Kaminski@ny.email.gs.com>
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment