Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Jun 2019 21:06:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 238327] net/fping: fping -4 broken if built with IPv6 disabled
Message-ID:  <bug-238327-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238327

            Bug ID: 238327
           Summary: net/fping: fping -4 broken if built with IPv6 disabled
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: eugen@freebsd.org
                CC: jharris@widomaker.com
                CC: jharris@widomaker.com
             Flags: maintainer-feedback?(jharris@widomaker.com)

If one builds and uses net/fping version 4.2 with option IPV6 disabled, the
command fping -4 always fails with wrong error message:

fping: can't specify both -4 and -6

This makes it impossible using fping probes with SmokePing as it runs fping
with -4 option.

If src/fping.c is compiled without IPV6 defined, its global variable
"hints_ai_family" has initial value AF_INET but following code assumes it
should be AF_UNSPEC before processing options.

Either port options IPV6 should be removed, or a patch added fixing the
problem:

--- fping.c.orig        2019-02-20 03:54:45.000000000 +0700
+++ fping.c     2019-06-05 04:05:50.930412000 +0700
@@ -427,7 +427,7 @@
     while ((c =3D optparse_long(&optparse_state, longopts, NULL)) !=3D EOF=
) {
         switch (c) {
         case '4':
-            if (hints_ai_family !=3D AF_UNSPEC) {
+            if (hints_ai_family =3D=3D AF_INET6) {
                 fprintf(stderr, "%s: can't specify both -4 and -6\n", prog=
);
                 exit(1);
             }

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238327-7788>