iputils: update to 20121221.

This commit is contained in:
Juan RP 2013-01-09 11:23:29 +01:00
parent e13e0a89d7
commit 67f14d2f71
11 changed files with 3 additions and 305 deletions

View file

@ -1,12 +0,0 @@
--- iputils/ping_common.c.countermeasures Tue May 21 10:06:05 2002
+++ iputils/ping_common.c Tue May 21 10:12:42 2002
@@ -628,7 +628,8 @@
tvsub(tv, &tmp_tv);
triptime = tv->tv_sec * 1000000 + tv->tv_usec;
if (triptime < 0) {
- fprintf(stderr, "Warning: time of day goes back (%ldus), taking countermeasures.\n", triptime);
+ if (options & F_VERBOSE)
+ fprintf(stderr, "Warning: time of day goes back (%ldus), taking countermeasures.\n", triptime);
triptime = 0;
if (!(options & F_LATENCY)) {
gettimeofday(tv, NULL);

View file

@ -1,31 +0,0 @@
--- iputils/ping.c.addrcache 2002-09-20 17:08:11.000000000 +0200
+++ iputils/ping.c 2003-05-15 16:41:19.000000000 +0200
@@ -1124,6 +1124,12 @@
{
struct hostent *hp;
static char buf[4096];
+ static __u32 addr_cache = 0;
+
+ if ( addr == addr_cache )
+ return buf;
+
+ addr_cache = addr;
if ((options & F_NUMERIC) ||
!(hp = gethostbyaddr((char *)&addr, 4, AF_INET)))
--- iputils/ping6.c.addrcache 2002-09-20 17:08:11.000000000 +0200
+++ iputils/ping6.c 2003-05-15 16:41:19.000000000 +0200
@@ -893,7 +893,12 @@
*/
char * pr_addr(struct in6_addr *addr)
{
- struct hostent *hp = NULL;
+ static struct hostent *hp;
+ static struct in6_addr addr_cache;
+
+ if (memcmp(addr, &addr_cache, sizeof(addr_cache)) == 0)
+ return hp ? hp->h_name : pr_addr_n(addr);
+ memcpy(&addr_cache, addr, sizeof(addr_cache));
if (!(options&F_NUMERIC))
hp = gethostbyaddr((__u8*)addr, sizeof(struct in6_addr), AF_INET6);

View file

@ -1,12 +0,0 @@
--- iputils-ss021109-vanilla/ping.c Thu Nov 7 23:53:21 2002
+++ iputils/ping.c Sun Jan 12 03:39:24 2003
@@ -285,6 +285,9 @@
perror("ping: IP_MULTICAST_IF");
exit(2);
}
+ } else if (icmp_sock >= 0) {
+ /* We possible tried to SO_BINDTODEVICE() a subinterface like 'eth0:1' */
+ perror("Warning: cannot bind to specified iface, falling back");
}
}
}

View file

@ -1,43 +0,0 @@
diff -up iputils-s20071127/ping.c.ia64_align iputils-s20071127/ping.c
--- iputils-s20071127/ping.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/ping.c 2008-06-02 08:56:32.000000000 +0200
@@ -200,13 +200,13 @@ main(int argc, char **argv)
ptr[3] = i4;
options |= F_STRICTSOURCE;
} else {
- device = optarg;
+ device = strdup(optarg);
}
#else
if (inet_pton(AF_INET, optarg, &source.sin_addr) > 0)
options |= F_STRICTSOURCE;
else
- device = optarg;
+ device = strdup(optarg);
#endif
break;
}
diff -up iputils-s20071127/arping.c.ia64_align iputils-s20071127/arping.c
--- iputils-s20071127/arping.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/arping.c 2008-06-02 08:56:32.000000000 +0200
@@ -351,7 +351,7 @@ main(int argc, char **argv)
timeout = atoi(optarg);
break;
case 'I':
- device = optarg;
+ device = strdup(optarg);
break;
case 'f':
quit_on_reply=1;
diff -up iputils-s20071127/ping6.c.ia64_align iputils-s20071127/ping6.c
--- iputils-s20071127/ping6.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
+++ iputils-s20071127/ping6.c 2008-06-02 08:56:32.000000000 +0200
@@ -581,7 +581,7 @@ int main(int argc, char *argv[])
free(addr);
} else {
- device = optarg;
+ device = strdup(optarg);
}
break;
case 'M':

View file

@ -1,14 +0,0 @@
diff -up iputils-s20070202/ping6.c.flowlabel iputils-s20070202/ping6.c
--- iputils-s20070202/ping6.c.flowlabel 2008-02-01 11:10:53.000000000 +0100
+++ iputils-s20070202/ping6.c 2008-02-01 11:16:47.000000000 +0100
@@ -86,6 +86,10 @@ char copyright[] =
#define SOL_ICMPV6 IPPROTO_ICMPV6
#endif
+#ifndef IVP6_FLOWINFO_SEND
+#define IPV6_FLOWINFO_SEND 33
+#endif
+
/* RFC3542 */
#ifndef ICMP6_DST_UNREACH_BEYONDSCOPE
#define ICMP6_DST_UNREACH_BEYONDSCOPE ICMP6_DST_UNREACH_NOTNEIGHBOR

View file

@ -1,24 +0,0 @@
diff -up iputils-s20100418/tracepath6.c.convtoint iputils-s20100418/tracepath6.c
--- iputils-s20100418/tracepath6.c.convtoint 2010-04-23 11:28:15.294593391 +0200
+++ iputils-s20100418/tracepath6.c 2010-04-23 11:28:23.544605551 +0200
@@ -89,7 +89,7 @@ void print_host(const char *a, const cha
}
if (plen >= HOST_COLUMN_SIZE)
plen = HOST_COLUMN_SIZE - 1;
- printf("%*s", HOST_COLUMN_SIZE - plen, "");
+ printf("%*s", HOST_COLUMN_SIZE - (int)plen, "");
}
int recverr(int fd, int ttl)
diff -up iputils-s20100418/tracepath.c.convtoint iputils-s20100418/tracepath.c
--- iputils-s20100418/tracepath.c.convtoint 2010-04-23 11:26:20.273555629 +0200
+++ iputils-s20100418/tracepath.c 2010-04-23 11:26:20.281562493 +0200
@@ -77,7 +77,7 @@ void print_host(const char *a, const cha
}
if (plen >= HOST_COLUMN_SIZE)
plen = HOST_COLUMN_SIZE - 1;
- printf("%*s", HOST_COLUMN_SIZE - plen, "");
+ printf("%*s", HOST_COLUMN_SIZE - (int)plen, "");
}
int recverr(int fd, int ttl)

View file

@ -1,91 +0,0 @@
diff -up iputils-s20101006/arping.c.eth iputils-s20101006/arping.c
--- iputils-s20101006/arping.c.eth 2011-11-10 09:06:08.101748109 +0100
+++ iputils-s20101006/arping.c 2011-11-10 09:34:09.880501394 +0100
@@ -37,7 +37,7 @@
static void usage(void) __attribute__((noreturn));
int quit_on_reply=0;
-char *device="eth0";
+char *device=NULL;
int ifindex;
char *source;
struct in_addr src, dst;
@@ -66,6 +66,11 @@ int received, brd_recv, req_recv;
#define SYSFS_PATH_LEN 256
#define SOCKADDR_LEN (2 * sizeof(struct sockaddr_ll))
+#define PREF_ETH "eth"
+#define PREF_EM "em"
+
+static char *dev_file = "/proc/self/net/dev";
+
#define MS_TDIFF(tv1,tv2) ( ((tv1).tv_sec-(tv2).tv_sec)*1000 + \
((tv1).tv_usec-(tv2).tv_usec)/1000 )
@@ -377,6 +382,46 @@ char * read_sysfs_broadcast(char *brdcas
return brdcast;
}
+/*
+ * get_first_ethernet - return the name of the first ethernet-style
+ * interface on this system.
+ */
+char * get_first_ethernet(void)
+{
+ FILE *f;
+ char buf[255], *dv, *smc;
+ char pci[16];
+
+ memset(pci, 0, sizeof(pci));
+ if ((f = fopen(dev_file, "r")) != NULL)
+ {
+ // go through network dev file
+ while (fgets (buf, sizeof(buf), f) != NULL)
+ {
+ // the line describes interface
+ if ((smc = strchr(buf, ':')) != NULL)
+ {
+ // trim white characters
+ for (dv=buf, *smc=0; *dv <= ' '; dv++) ;
+ // is "eth" (originial ethernet name) or "em" (ethernet on board)
+ if (!strncmp(dv, PREF_ETH, strlen(PREF_ETH)) ||
+ !strncmp(dv, PREF_EM, strlen(PREF_EM)))
+ {
+ return strdup(dv);
+ }
+ // remember the first pci NIC-card
+ if (strlen(pci) == 0 && dv[0] == 'p' && isdigit(dv[1]))
+ {
+ strcpy(pci, dv);
+ }
+ }
+ }
+ fclose(f);
+ }
+ // return pci NIC-card or nil if no if name
+ return strlen(pci) > 0 ? strdup(pci) : 0L;
+}
+
int
main(int argc, char **argv)
{
@@ -403,6 +448,8 @@ main(int argc, char **argv)
exit(1);
}
+ device = get_first_ethernet();
+
while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
switch(ch) {
case 'b':
@@ -429,6 +476,10 @@ main(int argc, char **argv)
timeout = atoi(optarg);
break;
case 'I':
+ if (device) {
+ free(device);
+ device = NULL;
+ }
device = strdup(optarg);
break;
case 'f':

View file

@ -1,53 +0,0 @@
diff -up iputils-s20101006/doc/ping.sgml.man iputils-s20101006/doc/ping.sgml
--- iputils-s20101006/doc/ping.sgml.man 2011-03-29 08:53:09.362500777 +0200
+++ iputils-s20101006/doc/ping.sgml 2011-03-29 08:58:03.196423782 +0200
@@ -62,8 +62,8 @@ Audible ping.
<term><option/-A/</term>
<listitem><para>
Adaptive ping. Interpacket interval adapts to round-trip time, so that
-effectively not more than one (or more, if preload is set) unanswered probes
-present in the network. Minimal interval is 200msec for not super-user.
+effectively not more than one (or more, if preload is set) unanswered probe
+is present in the network. Minimal interval is 200msec for not super-user.
On networks with low rtt this mode is essentially equivalent to flood mode.
</para></listitem>
</varlistentry>
@@ -394,7 +394,7 @@ probes are answered or for some error no
<term><option>-W <replaceable/timeout/</option></term>
<listitem><para>
Time to wait for a response, in seconds. The option affects only timeout
-in absense of any responses, otherwise <command/ping/ waits for two RTTs.
+in absence of any responses, otherwise <command/ping/ waits for two RTTs.
</para></listitem>
</varlistentry>
</variablelist>
@@ -535,7 +535,7 @@ or
</para>
<para>
-In normal operation ping prints the ttl value from the packet it receives.
+In normal operation ping prints the TTL value from the packet it receives.
When a remote system receives a ping packet, it can do one of three things
with the TTL field in its response:
</para>
diff -up iputils-s20101006/doc/tracepath.sgml.man iputils-s20101006/doc/tracepath.sgml
--- iputils-s20101006/doc/tracepath.sgml.man 2011-03-29 08:58:31.835723958 +0200
+++ iputils-s20101006/doc/tracepath.sgml 2011-03-29 09:01:41.706767424 +0200
@@ -35,7 +35,7 @@ privileges and has no fancy options.
<command/tracepath6/ is good replacement for <command/traceroute6/
and classic example of application of Linux error queues.
The situation with IPv4 is worse, because commercial
-IP routers do not return enough information in icmp error messages.
+IP routers do not return enough information in ICMP error messages.
Probably, it will change, when they will be updated.
For now it uses Van Jacobson's trick, sweeping a range
of UDP ports to maintain trace history.
@@ -96,7 +96,7 @@ the probe was not sent to the network.
<para>
The rest of line shows miscellaneous information about path to
-the correspinding hetwork hop. As rule it contains value of RTT.
+the correspinding network hop. As rule it contains value of RTT.
Additionally, it can show Path MTU, when it changes.
If the path is asymmetric
or the probe finishes before it reach prescribed hop, difference

View file

@ -1,12 +0,0 @@
diff -up iputils-s20100418/ping.c.rr iputils-s20100418/ping.c
--- iputils-s20100418/ping.c.rr 2011-11-24 14:33:37.096831782 +0100
+++ iputils-s20100418/ping.c 2011-11-24 14:35:53.087308660 +0100
@@ -1085,7 +1085,7 @@ void pr_options(unsigned char * cp, int
if (i <= 0)
break;
if (i == old_rrlen
- && !strncmp((char *)cp, old_rr, i)
+ && !memcmp(cp, (unsigned char *)old_rr, i)
&& !(options & F_FLOOD)) {
printf("\t(same route)");
i = ((i + 3) / 4) * 4;

View file

@ -1,10 +0,0 @@
iputils-20020124-countermeasures.patch
iputils-20020927-addrcache.patch
iputils-20020927-ping-subint.patch
iputils-20070202-traffic_class.patch
iputils-20070202-ia64_align.patch
iputils-20100418-convtoint.patch
iputils-20101006-man.patch
iputils-20101006-eth.patch
iputils-20101006-rr.patch
iputils-s20101006-manpages.patch

View file

@ -1,6 +1,6 @@
# Template file for 'iputils'
pkgname=iputils
version=20121106
version=20121221
revision=1
patch_args="-Np1"
wrksrc="${pkgname}-s${version}"
@ -11,13 +11,13 @@ fulldepends="libcap-progs"
short_desc="IP Configuration Utilities (and ping)"
maintainer="Juan RP <xtraeme@gmail.com>"
license="BSD"
checksum=0f4316b3129e058e5d13a6018f34c28406822292278b0abc7e8b1bdb19d3f95b
checksum=450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f
long_desc="
The iputils package is set of small useful utilities for Linux networking.
It was originally maintained by Alexey Kuznetsov."
do_build() {
make ${makejobs} \
make USE_GNUTLS=no CCOPTOPT="${CFLAGS}" ${makejobs} \
arping clockdiff ping ping6 rdisc tracepath tracepath6
}