Summary: | net/fping: Fails to run inside a FreeBSD jail with "allow.raw_sockets": Can't assign requested address | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dirk Meyer <dinoex> | ||||
Component: | Individual Port(s) | Assignee: | Dirk Meyer <dinoex> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | james, jharris | ||||
Priority: | --- | Keywords: | needs-patch, needs-qa, regression | ||||
Version: | Latest | Flags: | jharris:
maintainer-feedback+
dinoex: merge-quarterly- |
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Dirk Meyer
2020-08-13 17:57:35 UTC
@Dirk Was this a regression against a prior port/package version, or on a particular FreeBSD version/branch? This works when the jail is set to ip4 = inherit $ fping 127.0.0.1 127.0.0.1 is alive $ fping --version fping: Version 4.4 fping: comments to david@schweikert.ch I can confirm it's broken when the jail is given an IP address. (In reply to Kubilay Kocak from comment #1) Same FreeBSD version. broken package: 10 Aug. 07:36 /usr/ports/packages12-amd64/All/fping-4.4.txz working package_ 13 Juli 16:36 /usr/ports/packages12-amd64/Old/fping-4.2.txz Please see if ping 5.0 fixes this issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248744 Thanks. (In reply to jharris from comment #4) Sorry, but fping 5.0 fails as well with the same error. (In reply to Dirk Meyer from comment #5) The issue is a commit somewhere between v4.2 and v4.3 (which is also broken). I'm currently tracking down the commit in question with a git-bisect and will report back when I find it (hopefully with a patch). As seen in the truss output fping6 tries to bind to an IPv4, AF_INET fping tries to bind to an IPV4 and IPv6. I got fping to work if I force both Source.Addresses. Looking at the diffs I see that src_addr_set and src_addr6_set is set but not used. Revering the conditions in fping.c resolves the problems for me. I propose the following patch to fix the port. Created attachment 217361 [details]
patch
merger-quaterly is not needed, as quarterly has still 4.2 https://www.freshports.org/net/fping/ Reported the issue upstream at https://github.com/schweikert/fping/pull/198 (In reply to Dirk Meyer from comment #10) Bisect finished (had to break to do something else), the offending commit is this one: https://github.com/schweikert/fping/commit/1486bf209baa49724c7f776463d2ba5858fa0ff4 I will add it to your issue report. (In reply to James French from comment #11) This matches my finding. Both flags have been removed in the conditionals: 968/974 if (src_addr_set && socket4 >= 0) { 972/978 if (src_addr6_set && socket6 >= 0) { (In reply to jharris from comment #4) Do you approve the suggested patch for you port? (In reply to Dirk Meyer from comment #13) Yes, albeit without personally testing. Thanks! A commit references this bug: Author: dinoex Date: Sat Aug 22 12:36:18 UTC 2020 New revision: 545762 URL: https://svnweb.freebsd.org/changeset/ports/545762 Log: - fix Can't assign requested address PR: 248647 Approved by: J Harris Changes: head/net/fping/Makefile head/net/fping/files/ head/net/fping/files/patch-fping.c |