Hello community, here is the log from the commit of package arping2 for openSUSE:Factory checked in at 2015-01-12 09:50:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/arping2 (Old) and /work/SRC/openSUSE:Factory/.arping2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "arping2" Changes: -------- --- /work/SRC/openSUSE:Factory/arping2/arping2.changes 2014-08-11 10:08:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.arping2.new/arping2.changes 2015-01-12 09:50:17.000000000 +0100 @@ -1,0 +2,6 @@ +Sun Jan 11 16:40:32 UTC 2015 - [email protected] + +- Update to new upstream release 2.15 +* Add option -m to allow setting timestamp type + +------------------------------------------------------------------- Old: ---- arping-2.14.tar.gz New: ---- arping-2.15.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ arping2.spec ++++++ --- /var/tmp/diff_new_pack.bvBvVQ/_old 2015-01-12 09:50:17.000000000 +0100 +++ /var/tmp/diff_new_pack.bvBvVQ/_new 2015-01-12 09:50:17.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package arping2 # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products 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: arping2 -Version: 2.14 +Version: 2.15 Release: 0 Summary: Layer-2 Ethernet pinger License: GPL-2.0+ @@ -25,14 +25,10 @@ Url: http://www.habets.pp.se/synscan/programs.php?prog=arping #Git-Clone: git://github.com/ThomasHabets/arping -Source: http://www.habets.pp.se/synscan/files/arping-2.14.tar.gz +Source: http://www.habets.pp.se/synscan/files/arping-%version.tar.gz Patch1: arping-setgroups.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} <= 1130 -BuildRequires: libnet -%else BuildRequires: libnet-devel -%endif BuildRequires: libpcap-devel %description @@ -50,7 +46,7 @@ %install b="%buildroot"; -make install DESTDIR="$b"; +%make_install # Avoid collision with iputils's inferior arping. mv "$b/%_sbindir"/{arping,%name}; mv "$b/%_mandir/man8"/{arping.8,%name.8}; ++++++ arping-2.14.tar.gz -> arping-2.15.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/config.h.in new/arping-2.15/config.h.in --- old/arping-2.14/config.h.in 2014-06-29 12:05:55.000000000 +0200 +++ new/arping-2.15/config.h.in 2015-01-11 00:24:49.000000000 +0100 @@ -54,6 +54,15 @@ /* Define to 1 if you have the <net/bpf.h> header file. */ #undef HAVE_NET_BPF_H +/* Define to 1 if you have the `pcap_create' function. */ +#undef HAVE_PCAP_CREATE + +/* Define to 1 if you have the `pcap_list_tstamp_types' function. */ +#undef HAVE_PCAP_LIST_TSTAMP_TYPES + +/* Define to 1 if you have the `pcap_set_immediate_mode' function. */ +#undef HAVE_PCAP_SET_IMMEDIATE_MODE + /* Define to 1 if you have the <pwd.h> header file. */ #undef HAVE_PWD_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/configure new/arping-2.15/configure --- old/arping-2.14/configure 2014-06-29 12:05:54.000000000 +0200 +++ new/arping-2.15/configure 2015-01-11 00:24:49.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for arping 2.14. +# Generated by GNU Autoconf 2.69 for arping 2.15. # # Report bugs to <[email protected]>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='arping' PACKAGE_TARNAME='arping' -PACKAGE_VERSION='2.14' -PACKAGE_STRING='arping 2.14' +PACKAGE_VERSION='2.15' +PACKAGE_STRING='arping 2.15' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1279,7 +1279,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 arping 2.14 to adapt to many kinds of systems. +\`configure' configures arping 2.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1350,7 +1350,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of arping 2.14:";; + short | recursive ) echo "Configuration of arping 2.15:";; esac cat <<\_ACEOF @@ -1439,7 +1439,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -arping configure 2.14 +arping configure 2.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1862,7 +1862,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by arping $as_me 2.14, which was +It was created by arping $as_me 2.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2789,7 +2789,7 @@ # Define the identity of the package. PACKAGE='arping' - VERSION='2.14' + VERSION='2.15' cat >>confdefs.h <<_ACEOF @@ -5084,7 +5084,7 @@ for ac_func in gettimeofday memset select strchr strdup strerror strstr \ -getifaddrs cap_init +getifaddrs cap_init pcap_create pcap_list_tstamp_types pcap_set_immediate_mode do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -5731,7 +5731,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by arping $as_me 2.14, which was +This file was extended by arping $as_me 2.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5797,7 +5797,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -arping config.status 2.14 +arping config.status 2.15 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/arping-2.14/configure.ac new/arping-2.15/configure.ac --- old/arping-2.14/configure.ac 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/configure.ac 2015-01-11 00:24:46.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(arping, 2.14, [email protected]) +AC_INIT(arping, 2.15, [email protected]) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR([src/arping.c]) AM_INIT_AUTOMAKE @@ -65,7 +65,7 @@ AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([gettimeofday memset select strchr strdup strerror strstr \ -getifaddrs cap_init]) +getifaddrs cap_init pcap_create pcap_list_tstamp_types pcap_set_immediate_mode]) if test x$ac_cv_func_getifaddrs = xyes; then AC_LIBOBJ([findif_getifaddrs]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/doc/arping.8 new/arping-2.15/doc/arping.8 --- old/arping-2.14/doc/arping.8 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/doc/arping.8 2015-01-11 00:24:46.000000000 +0100 @@ -76,6 +76,9 @@ Displays a help message and exits\&. .IP "\-i \fIinterface\fP" Don\(cq\&t guess, use the specified interface\&. +.IP "\-m \fItype\fP" +Type of timestamp to use for incoming packets\&. +Use \-vv when pinging to list available ones\&. .IP "\-p" Turn on promiscious mode on interface, use this if you don\(cq\&t \(dq\&own\(dq\& the MAC address you are using\&. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/doc/arping.yodl new/arping-2.15/doc/arping.yodl --- old/arping-2.14/doc/arping.yodl 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/doc/arping.yodl 2015-01-11 00:24:46.000000000 +0100 @@ -61,6 +61,8 @@ switch is not given, -i disables this smartness. dit(-h) Displays a help message and exits. dit(-i em(interface)) Don't guess, use the specified interface. + dit(-m em(type)) Type of timestamp to use for incoming packets. + Use -vv when pinging to list available ones. dit(-p) Turn on promiscious mode on interface, use this if you don't "own" the MAC address you are using. dit(-P) Send ARP replies instead of requests. Useful with -U. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/extra/mktarball new/arping-2.15/extra/mktarball --- old/arping-2.14/extra/mktarball 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/extra/mktarball 2015-01-11 00:24:46.000000000 +0100 @@ -35,6 +35,7 @@ git checkout "$VERSION" rm -fr .git autoreconf -i + rm -fr autom4te.cache cd .. tar cfz - "$VERSION" > "$GITDIR/$OUTPUT" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/extra/testing.exp new/arping-2.15/extra/testing.exp --- old/arping-2.14/extra/testing.exp 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/extra/testing.exp 2015-01-11 00:24:46.000000000 +0100 @@ -348,3 +348,6 @@ spawn $bin -A -c 2 -e -i $ifname -D -T $ip $bad_mac expect "\a.\a.\t100% packet loss (0 extra)\r\n" expect eof + +send_user -- "---------------------------------------------------------\n" +send_user -- "All tests passed\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/arping-2.14/src/arping.c new/arping-2.15/src/arping.c --- old/arping-2.14/src/arping.c 2014-06-29 12:05:51.000000000 +0200 +++ new/arping-2.15/src/arping.c 2015-01-11 00:24:46.000000000 +0100 @@ -169,6 +169,7 @@ static unsigned int numrecvd = 0; /* packets received */ static unsigned int max_replies = UINT_MAX; /* exit after -C replies */ static unsigned int numdots = 0; /* dots that should be printed */ +static const char* timestamp_type = NULL; /* Incoming packet measurement ts type (-m) */ static double stats_min_time = -1; static double stats_max_time = -1; @@ -318,6 +319,103 @@ drop_capabilities(); } + +/** + * Do pcap_open_live(), except by using the pcap_create() interface + * introduced in 2008 (libpcap 0.4) where available. + * + * FIXME: Use pcap_set_buffer_size()? + */ +static pcap_t* +try_pcap_open_live(const char *device, int snaplen, + int promisc, int to_ms, char *errbuf) +{ +#ifdef HAVE_PCAP_CREATE + pcap_t* pcap; + int rc; + + if (!(pcap = pcap_create(device, errbuf))) { + goto err; + } + if ((rc = pcap_set_snaplen(pcap, snaplen))) { + snprintf(errbuf, PCAP_ERRBUF_SIZE, "pcap_set_snaplen(): %s", pcap_statustostr(rc)); + goto err; + } + if ((rc = pcap_set_promisc(pcap, promisc))) { + snprintf(errbuf, PCAP_ERRBUF_SIZE, "pcap_set_promisc(): %s", pcap_statustostr(rc)); + goto err; + } + if ((rc = pcap_set_timeout(pcap, to_ms))) { + snprintf(errbuf, PCAP_ERRBUF_SIZE, "pcap_set_timeout(): %s", pcap_statustostr(rc)); + goto err; + } + +#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE + // Without immediate mode some architectures (e.g. Linux with + // TPACKET_V3) will buffer replies and incorrectly upwards of + // hundreds of milliseconds of delay. + if ((rc = pcap_set_immediate_mode(pcap, 1))) { + if (verbose) { + fprintf(stderr, "arping: pcap_set_immediate_mode() failed: %s\n", pcap_statustostr(rc)); + } + } +#endif +#ifdef HAVE_PCAP_LIST_TSTAMP_TYPES + if (timestamp_type) { + int err; + int v = pcap_tstamp_type_name_to_val(timestamp_type); + if (v == PCAP_ERROR) { + fprintf(stderr, "arping: Unknown timestamp type \"%s\"\n", timestamp_type); + exit(1); + } + if ((err = pcap_set_tstamp_type(pcap, v))) { + fprintf(stderr, + "arping: Failed to set timestamp type \"%s\" (%d): %s\n", + timestamp_type, v, pcap_statustostr(err)); + } + } +#endif + if ((rc = pcap_activate(pcap))) { + if (timestamp_type) { + snprintf(errbuf, PCAP_ERRBUF_SIZE, "pcap_activate(tstype=\"%s\"): %s. Try without setting timestamp type.", timestamp_type, pcap_statustostr(rc)); + } else { + snprintf(errbuf, PCAP_ERRBUF_SIZE, "pcap_activate(): %s", pcap_statustostr(rc)); + } + goto err; + } +#ifdef HAVE_PCAP_LIST_TSTAMP_TYPES + // List timestamp types after activating, since we don't want to list + // them if activating failed. + if (verbose > 1) { + int *ts; + int count; + count = pcap_list_tstamp_types(pcap, &ts); + if (count == PCAP_ERROR) { + fprintf(stderr, "arping: pcap_list_tstamp_types() failed\n"); + } else { + int c; + const char* fmt = " %-18s %s\n"; + fprintf(stderr, "Timestamp types:\n"); + fprintf(stderr, fmt, "Name", "Description"); + for (c = 0; c < count; c++) { + fprintf(stderr, fmt, pcap_tstamp_type_val_to_name(ts[c]), + pcap_tstamp_type_val_to_description(ts[c])); + } + pcap_free_tstamp_types(ts); + } + } +#endif + return pcap; +err: + if (pcap) { + pcap_close(pcap); + } + return NULL; +#else + return pcap_open_live(device, snaplen, promisc, to_ms, errbuf); +#endif +} + /** * Some stupid OSs (Solaris) think it's a good idea to put network * devices in /dev and then play musical chairs with them. @@ -335,22 +433,22 @@ pcap_t* ret; char buf[PATH_MAX]; - if ((ret = pcap_open_live(device, snaplen, promisc, to_ms, errbuf))) { + if ((ret = try_pcap_open_live(device, snaplen, promisc, to_ms, errbuf))) { return ret; } snprintf(buf, sizeof(buf), "/dev/%s", device); - if ((ret = pcap_open_live(buf, snaplen, promisc, to_ms, errbuf))) { + if ((ret = try_pcap_open_live(buf, snaplen, promisc, to_ms, errbuf))) { return ret; } snprintf(buf, sizeof(buf), "/dev/net/%s", device); - if ((ret = pcap_open_live(buf, snaplen, promisc, to_ms, errbuf))) { + if ((ret = try_pcap_open_live(buf, snaplen, promisc, to_ms, errbuf))) { return ret; } /* Call original again to reset the error message. */ - return pcap_open_live(device, snaplen, promisc, to_ms, errbuf); + return try_pcap_open_live(device, snaplen, promisc, to_ms, errbuf); } /** @@ -490,6 +588,12 @@ " -h Displays a help message and exits.\n" " -i interface\n" " Use the specified interface.\n" + " -m type" +#ifndef HAVE_PCAP_LIST_TSTAMP_TYPES + " (Disabled on this system. Option ignored)" +#endif + "\n Type of timestamp to use for incoming packets. Use -vv when\n" + " pinging to list available ones.\n" " -q Does not display messages, except error messages.\n" " -r Raw output: only the MAC/IP address is displayed for each reply.\n" " -R Raw output: Like -r but shows \"the other one\", can be combined\n" @@ -536,7 +640,7 @@ "[ -T <host/ip ] " "[ -s <MAC> ] [ -t <MAC> ] [ -c <count> ]\n" " " - "[ -C <count> ] [ -i <interface> ] " + "[ -C <count> ] [ -i <interface> ] [ -m <type> ] " "<host/ip/MAC | -B>\n"); } @@ -1212,7 +1316,7 @@ memcpy(dstmac, ethxmas, ETH_ALEN); while (EOF != (c = getopt(argc, argv, - "0aAbBC:c:dDeFhi:I:pPqrRs:S:t:T:uUvw:W:"))) { + "0aAbBC:c:dDeFhi:I:m:pPqrRs:S:t:T:uUvw:W:"))) { switch(c) { case '0': srcip = 0; @@ -1265,6 +1369,9 @@ case 'I': /* FALL THROUGH */ ifname = optarg; break; + case 'm': + timestamp_type = optarg; + break; case 'p': promisc = 1; break; @@ -1551,6 +1658,7 @@ #ifdef BIOCIMMEDIATE { + // This may be redundant if pcap_set_immediate_mode() is present. uint32_t on = 1; if (0 < (ioctl(pcap_fileno(pcap), BIOCIMMEDIATE, &on))) { -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
