Hello community,

here is the log from the commit of package fping for openSUSE:Factory checked 
in at 2018-09-24 13:13:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fping (Old)
 and      /work/SRC/openSUSE:Factory/.fping.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fping"

Mon Sep 24 13:13:02 2018 rev:32 rq:637024 version:4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/fping/fping.changes      2017-12-14 
11:03:00.439614527 +0100
+++ /work/SRC/openSUSE:Factory/.fping.new/fping.changes 2018-09-24 
13:13:03.889727468 +0200
@@ -1,0 +2,10 @@
+Thu Sep 20 10:21:39 UTC 2018 - [email protected]
+
+- Update to version 4.1
+  * Fix problem when socket fd is 0
+  * Fix running on servers with disabled IPv6
+  * Allow running "fping -h" or "--help" even when raw socket
+    can't be opened
+  * Fix build issue with FreeBSD and IPv6
+
+-------------------------------------------------------------------

Old:
----
  fping-4.0.tar.gz

New:
----
  fping-4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fping.spec ++++++
--- /var/tmp/diff_new_pack.56UM3Q/_old  2018-09-24 13:13:04.313726727 +0200
+++ /var/tmp/diff_new_pack.56UM3Q/_new  2018-09-24 13:13:04.317726720 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package fping
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           fping
-Version:        4.0
+Version:        4.1
 Release:        0
 Summary:        A program to ping multiple hosts
 License:        MIT

++++++ fping-4.0.tar.gz -> fping-4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/CHANGELOG.md new/fping-4.1/CHANGELOG.md
--- old/fping-4.0/CHANGELOG.md  2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/CHANGELOG.md  2018-09-17 21:14:10.000000000 +0200
@@ -1,3 +1,13 @@
+fping 4.1 (2018-09-17)
+======================
+
+## Bugfixes and other changes
+
+- Fix problem when socket fd is 0 (#125, thanks Ramón Novoa!)
+- Fix running on servers with disabled IPv6 (#118, thanks Simon Matter)
+- Allow running "fping -h" or "--help" even when raw socket can't be opened 
(#131, thanks @teto)
+- Fix build issue with FreeBSD and IPv6 (#132, thanks @gsnw)
+
 fping 4.0 (2017-04-23)
 ======================
 
@@ -34,7 +44,7 @@
 fping will now discard replies, if they arrive after the defined timeout
 for reply packets, specified with -t. This change is relevant only for the
 count and loop modes, where the measured times should be now more
-consistent (see github issue #32 for details).
+consistent (see github issue [#32][i32] for details).
 
 To prevent loosing reply packets because of this change, the default
 timeout in count and loop modes is now automatically adjusted to the
@@ -60,14 +70,14 @@
 
 ## New features
 
-- Unified 'fping' and 'fping6' into one binary (#80)
+- Unified 'fping' and 'fping6' into one binary ([#80][i80])
 - Long option names for all options
 - IPv6 enabled by default
 - New option -4 to force IPv4
 - New option -6 to force IPv6
 - Keep original name if a hostname is given with -n/--name
 - Option -d/--rdns now always does a rdns-lookup, even for names, as '-n' was 
doing until now
-- Enforce -t timeout on reply packets, by discarding late packets (#32)
+- Enforce -t timeout on reply packets, by discarding late packets ([#32][i32])
 - Auto-adjust timeout for -c/-C/-l mode to value of -p
 
 ## Bugfixes and other changes
@@ -79,5 +89,7 @@
 - Option parsing with optparse (https://github.com/skeeto/optparse). Thanks 
Christopher Wellons!
 - New changelog file format
 
+[i32]: https://github.com/schweikert/fping/issues/32
+[i80]: https://github.com/schweikert/fping/issues/80
 
 (see doc/CHANGELOG.pre-v4 for older changes)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/configure new/fping-4.1/configure
--- old/fping-4.0/configure     2017-04-23 18:03:47.000000000 +0200
+++ new/fping-4.1/configure     2018-09-17 21:14:39.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for fping 4.0.
+# Generated by GNU Autoconf 2.69 for fping 4.1.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@
 # Identity of this package.
 PACKAGE_NAME='fping'
 PACKAGE_TARNAME='fping'
-PACKAGE_VERSION='4.0'
-PACKAGE_STRING='fping 4.0'
+PACKAGE_VERSION='4.1'
+PACKAGE_STRING='fping 4.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1286,7 +1286,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures fping 4.0 to adapt to many kinds of systems.
+\`configure' configures fping 4.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1357,7 +1357,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of fping 4.0:";;
+     short | recursive ) echo "Configuration of fping 4.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1457,7 +1457,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-fping configure 4.0
+fping configure 4.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1868,7 +1868,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by fping $as_me 4.0, which was
+It was created by fping $as_me 4.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3099,6 +3099,7 @@
 do :
   ac_fn_c_check_header_compile "$LINENO" "netinet/icmp6.h" 
"ac_cv_header_netinet_icmp6_h" "
       #include <netinet/in.h>
+      #include <sys/types.h>
 
 "
 if test "x$ac_cv_header_netinet_icmp6_h" = xyes; then :
@@ -3859,7 +3860,7 @@
 
 # Define the identity of the package.
  PACKAGE='fping'
- VERSION='4.0'
+ VERSION='4.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6066,7 +6067,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by fping $as_me 4.0, which was
+This file was extended by fping $as_me 4.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6132,7 +6133,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-fping config.status 4.0
+fping config.status 4.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/configure.ac new/fping-4.1/configure.ac
--- old/fping-4.0/configure.ac  2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/configure.ac  2018-09-17 21:14:10.000000000 +0200
@@ -3,7 +3,7 @@
 dnl Minimum Autoconf version required.
 AC_PREREQ(2.59)
 
-AC_INIT([fping],[4.0])
+AC_INIT([fping],[4.1])
 
 dnl --disable-ipv4
 AC_ARG_ENABLE([ipv4],
@@ -18,6 +18,7 @@
     dnl Test if IPv6 is supported
        AC_CHECK_HEADERS([netinet/icmp6.h], [have_ipv6="yes"], [], [[
       #include <netinet/in.h>
+      #include <sys/types.h>
   ]])
 ])
 dnl Can't disable both IPv4 and IPv6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/doc/fping.8 new/fping-4.1/doc/fping.8
--- old/fping-4.0/doc/fping.8   2017-04-23 18:03:49.000000000 +0200
+++ new/fping-4.1/doc/fping.8   2018-09-17 21:14:41.000000000 +0200
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "FPING 8"
-.TH FPING 8 "2017-04-23" "fping" ""
+.TH FPING 8 "2018-09-17" "fping" ""
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -287,8 +287,8 @@
 In looping or counting modes (\fB\-l\fR, \fB\-c\fR, or \fB\-C\fR), this 
parameter sets
 the time in milliseconds that \fBfping\fR waits between successive packets to
 an individual target. Default is 1000 and minimum is 10.
-.IP "\fB\-q\fR, \fB\-\-quet\fR" 5
-.IX Item "-q, --quet"
+.IP "\fB\-q\fR, \fB\-\-quiet\fR" 5
+.IX Item "-q, --quiet"
 Quiet. Don't show per-probe results, but only the final summary. Also don't
 show \s-1ICMP\s0 error messages.
 .IP "\fB\-Q\fR, \fB\-\-squiet\fR=\fI\s-1SECS\s0\fR" 5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/doc/fping.pod new/fping-4.1/doc/fping.pod
--- old/fping-4.0/doc/fping.pod 2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/doc/fping.pod 2018-09-17 21:14:10.000000000 +0200
@@ -170,7 +170,7 @@
 the time in milliseconds that B<fping> waits between successive packets to
 an individual target. Default is 1000 and minimum is 10.
 
-=item B<-q>, B<--quet>
+=item B<-q>, B<--quiet>
 
 Quiet. Don't show per-probe results, but only the final summary. Also don't
 show ICMP error messages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/src/fping.c new/fping-4.1/src/fping.c
--- old/fping-4.0/src/fping.c   2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/src/fping.c   2018-09-17 21:14:10.000000000 +0200
@@ -231,11 +231,11 @@
 
 char* prog;
 int ident; /* our pid */
-int socket4 = 0;
+int socket4 = -1;
 #ifndef IPV6
 int hints_ai_family = AF_INET;
 #else
-int socket6 = 0;
+int socket6 = -1;
 int hints_ai_family = AF_UNSPEC;
 #endif
 
@@ -352,6 +352,13 @@
     HOST_ENTRY* cursor;
     struct optparse optparse_state;
 
+    /* pre-parse -h/--help, so that we also can output help information
+     * without trying to open the socket, which might fail */
+    prog = argv[0];
+    if(argc == 2 && ( strcmp(argv[1],"-h")==0 || strcmp(argv[1],"--help")==0 
)) {
+        usage(0);
+    }
+
     socket4 = open_ping_socket_ipv4(ping_data_size);
 #ifdef IPV6
     socket6 = open_ping_socket_ipv6(ping_data_size);
@@ -363,7 +370,6 @@
             perror("cannot setuid");
     }
 
-    prog = argv[0];
     optparse_init(&optparse_state, argv);
     ident = getpid() & 0xFFFF;
     verbose_flag = 1;
@@ -435,14 +441,14 @@
             break;
         case 'M':
 #ifdef IP_MTU_DISCOVER
-            if (socket4) {
+            if (socket4 >= 0) {
                 int val = IP_PMTUDISC_DO;
                 if (setsockopt(socket4, IPPROTO_IP, IP_MTU_DISCOVER, &val, 
sizeof(val))) {
                     perror("setsockopt IP_MTU_DISCOVER");
                 }
             }
 #ifdef IPV6
-            if (socket6) {
+            if (socket6 >= 0) {
                 int val = IPV6_PMTUDISC_DO;
                 if (setsockopt(socket6, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &val, 
sizeof(val))) {
                     perror("setsockopt IPV6_MTU_DISCOVER");
@@ -624,13 +630,13 @@
 
         case 'I':
 #ifdef SO_BINDTODEVICE
-            if (socket4) {
+            if (socket4 >= 0) {
                 if (setsockopt(socket4, SOL_SOCKET, SO_BINDTODEVICE, 
optparse_state.optarg, strlen(optparse_state.optarg))) {
                     perror("binding to specific interface (SO_BINTODEVICE)");
                 }
             }
 #ifdef IPV6
-            if (socket6) {
+            if (socket6 >= 0) {
                 if (setsockopt(socket6, SOL_SOCKET, SO_BINDTODEVICE, 
optparse_state.optarg, strlen(optparse_state.optarg))) {
                     perror("binding to specific interface (SO_BINTODEVICE), 
IPV6");
                 }
@@ -649,13 +655,13 @@
 
         case 'O':
             if (sscanf(optparse_state.optarg, "%i", &tos)) {
-                if (socket4) {
+                if (socket4 >= 0) {
                     if (setsockopt(socket4, IPPROTO_IP, IP_TOS, &tos, 
sizeof(tos))) {
                         perror("setting type of service octet IP_TOS");
                     }
                 }
 #if defined(IPV6) && defined(IPV6_TCLASS)
-                if (socket6) {
+                if (socket6 >= 0) {
                     if (setsockopt(socket6, IPPROTO_IPV6, IPV6_TCLASS, &tos, 
sizeof(tos))) {
                         perror("setting type of service octet IPV6_TCLASS");
                     }
@@ -681,6 +687,10 @@
 
     /* validate various option settings */
 
+    if (socket4 < 0 && socket6 < 0) {
+        crash_and_burn("can't create socket (must run as root?)");
+    }
+
     if (ttl > 255) {
         fprintf(stderr, "%s: ttl %u out of range\n", prog, ttl);
         exit(1);
@@ -827,13 +837,13 @@
 
     /* set the TTL, if the -H option was set (otherwise ttl will be = 0) */
     if (ttl > 0) {
-        if (socket4) {
+        if (socket4 >= 0) {
             if (setsockopt(socket4, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl))) {
                 perror("setting time to live");
             }
         }
 #ifdef IPV6
-        if (socket6) {
+        if (socket6 >= 0) {
             if (setsockopt(socket6, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, 
sizeof(ttl))) {
                 perror("setting time to live");
             }
@@ -844,13 +854,13 @@
 #if HAVE_SO_TIMESTAMP
     {
         int opt = 1;
-        if (socket4) {
+        if (socket4 >= 0) {
             if (setsockopt(socket4, SOL_SOCKET, SO_TIMESTAMP, &opt, 
sizeof(opt))) {
                 perror("setting SO_TIMESTAMP option");
             }
         }
 #ifdef IPV6
-        if (socket6) {
+        if (socket6 >= 0) {
             if (setsockopt(socket6, SOL_SOCKET, SO_TIMESTAMP, &opt, 
sizeof(opt))) {
                 perror("setting SO_TIMESTAMP option (IPv6)");
             }
@@ -928,11 +938,11 @@
         exit(num_noaddress ? 2 : 1);
     }
 
-    if (src_addr_set) {
+    if (src_addr_set && socket4 >= 0) {
         socket_set_src_addr_ipv4(socket4, &src_addr);
     }
 #ifdef IPV6
-    if (src_addr6_set) {
+    if (src_addr6_set && socket6 >= 0) {
         socket_set_src_addr_ipv6(socket6, &src_addr6);
     }
 #endif
@@ -1626,11 +1636,11 @@
         printf("sending [%d] to %s\n", h->num_sent, h->host);
 #endif /* DEBUG || _DEBUG */
 
-    if (h->saddr.ss_family == AF_INET) {
+    if (h->saddr.ss_family == AF_INET && socket4 >= 0) {
         n = socket_sendto_ping_ipv4(socket4, (struct sockaddr*)&h->saddr, 
h->saddr_len, myseq, ident);
     }
 #ifdef IPV6
-    else if (h->saddr.ss_family == AF_INET6) {
+    else if (h->saddr.ss_family == AF_INET6 && socket6 >= 0) {
         n = socket_sendto_ping_ipv6(socket6, (struct sockaddr*)&h->saddr, 
h->saddr_len, myseq, ident);
     }
 #endif
@@ -1689,9 +1699,9 @@
 select_again:
     FD_ZERO(&readset);
     FD_ZERO(&writeset);
-    FD_SET(socket4, &readset);
+    if(socket4 >= 0) FD_SET(socket4, &readset);
 #ifdef IPV6
-    FD_SET(socket6, &readset);
+    if(socket6 >= 0) FD_SET(socket6, &readset);
 #endif
 
     nfound = select(socketmax + 1, &readset, &writeset, NULL, timeout);
@@ -1706,17 +1716,17 @@
     }
 
     if (nfound > 0) {
-        if (FD_ISSET(socket4, &readset)) {
+        if (socket4 >= 0 && FD_ISSET(socket4, &readset)) {
             return socket4;
         }
 #ifdef IPV6
-        if (FD_ISSET(socket6, &readset)) {
+        if (socket6 >= 0 && FD_ISSET(socket6, &readset)) {
             return socket6;
         }
 #endif
     }
 
-    return 0;
+    return -1;
 }
 
 int receive_packet(int socket,
@@ -2005,7 +2015,7 @@
         to.tv_usec = 0;
     }
     s = socket_can_read(&to);
-    if (s == 0) {
+    if (s == -1) {
         return 0; /* timeout */
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/src/socket4.c new/fping-4.1/src/socket4.c
--- old/fping-4.0/src/socket4.c 2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/src/socket4.c 2018-09-17 21:14:10.000000000 +0200
@@ -62,7 +62,7 @@
         /* try non-privileged icmp (works on Mac OSX without privileges, for 
example) */
         s = socket(AF_INET, SOCK_DGRAM, proto->p_proto);
         if (s < 0) {
-            errno_crash_and_burn("can't create socket (must run as root?)");
+            return -1;
         }
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fping-4.0/src/socket6.c new/fping-4.1/src/socket6.c
--- old/fping-4.0/src/socket6.c 2017-04-23 18:03:08.000000000 +0200
+++ new/fping-4.1/src/socket6.c 2018-09-17 21:14:10.000000000 +0200
@@ -61,7 +61,7 @@
         /* try non-privileged icmp (works on Mac OSX without privileges, for 
example) */
         s = socket(AF_INET6, SOCK_DGRAM, proto->p_proto);
         if (s < 0) {
-            errno_crash_and_burn("can't create raw socket (must run as 
root?)");
+            return -1;
         }
     }
 


Reply via email to