Update to iputils-s20121112 (#875767)
+ drop unnecessary patches + update patches
This commit is contained in:
parent
f84eb2cf11
commit
317683087f
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ ifenslave.tar.gz
|
||||
/ifenslave.tar.gz
|
||||
/iputils-s20121011.tar.bz2
|
||||
/iputils-s20121106.tar.bz2
|
||||
/iputils-s20121112.tar.bz2
|
||||
|
@ -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);
|
@ -5,7 +5,7 @@
|
||||
exit(2);
|
||||
}
|
||||
+ } else if (icmp_sock >= 0) {
|
||||
+ /* We possible tried to SO_BINDTODEVICE() a subinterface like 'eth0:1' */
|
||||
+ /* We possibly tried to SO_BINDTODEVICE() a subinterface like 'eth0:1' */
|
||||
+ perror("Warning: cannot bind to specified iface, falling back");
|
||||
}
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
--- iputils-s20121106/Makefile.orig 2012-11-06 14:05:19.000000000 +0100
|
||||
+++ iputils-s20121106/Makefile 2012-11-06 14:06:42.608585629 +0100
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
# ping / ping6
|
||||
ping: ping.o ping_common.o
|
||||
- $(LINK.o) $^ $(LIB_CAP) $(LDLIBS) -o $@
|
||||
+ $(LINK.o) $^ -lidn $(LIB_CAP) $(LDLIBS) -o $@
|
||||
ping6: ping6.o ping_common.o
|
||||
$(LINK.o) $^ -lresolv -lcrypto $(LIB_CAP) $(LDLIBS) -o $@
|
||||
ping.o ping6.o ping_common.o: ping_common.h
|
||||
diff -up iputils-s20100418/ping.c.idn iputils-s20100418/ping.c
|
||||
--- iputils-s20100418/ping.c.idn 2010-04-20 16:07:59.038484302 +0200
|
||||
+++ iputils-s20100418/ping.c 2010-04-20 16:07:59.077485007 +0200
|
||||
@@ -58,6 +58,9 @@ char copyright[] =
|
||||
* This program has to run SUID to ROOT to access the ICMP socket.
|
||||
*/
|
||||
|
||||
+#include <idna.h>
|
||||
+#include <locale.h>
|
||||
+
|
||||
#include "ping_common.h"
|
||||
|
||||
#include <netinet/ip.h>
|
||||
@@ -123,6 +126,10 @@ main(int argc, char **argv)
|
||||
char *target, hnamebuf[MAX_HOSTNAMELEN];
|
||||
char rspace[3 + 4 * NROUTES + 1]; /* record route space */
|
||||
|
||||
+ char *idn;
|
||||
+ int rc = 0;
|
||||
+ setlocale(LC_ALL, "");
|
||||
+
|
||||
icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
|
||||
socket_errno = errno;
|
||||
|
||||
@@ -250,13 +257,27 @@ main(int argc, char **argv)
|
||||
if (argc == 1)
|
||||
options |= F_NUMERIC;
|
||||
} else {
|
||||
- hp = gethostbyname(target);
|
||||
+ rc = idna_to_ascii_lz (target, &idn, 0);
|
||||
+ if (rc == IDNA_SUCCESS)
|
||||
+ hp = gethostbyname (idn);
|
||||
+ else {
|
||||
+ fprintf(stderr, "ping: IDN encoding of '%s' failed with error code %d\n", target, rc);
|
||||
+ exit(2);
|
||||
+ }
|
||||
+ free(idn);
|
||||
if (!hp) {
|
||||
fprintf(stderr, "ping: unknown host %s\n", target);
|
||||
exit(2);
|
||||
}
|
||||
memcpy(&whereto.sin_addr, hp->h_addr, 4);
|
||||
- strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1);
|
||||
+ rc = idna_to_unicode_lzlz (hp->h_name, &idn, 0);
|
||||
+ if (rc == IDNA_SUCCESS)
|
||||
+ strncpy(hnamebuf, idn, sizeof(hnamebuf) - 1);
|
||||
+ else {
|
||||
+ fprintf(stderr, "ping: IDN encoding of '%s' failed with error code %d\n", hp->h_name, rc);
|
||||
+ exit(2);
|
||||
+ }
|
||||
+ free(idn);
|
||||
hnamebuf[sizeof(hnamebuf) - 1] = 0;
|
||||
hostname = hnamebuf;
|
||||
}
|
||||
diff -up iputils-s20100418/ping_common.c.idn iputils-s20100418/ping_common.c
|
||||
--- iputils-s20100418/ping_common.c.idn 2010-04-20 16:07:59.039478452 +0200
|
||||
+++ iputils-s20100418/ping_common.c 2010-04-20 16:07:59.069478660 +0200
|
||||
@@ -1,3 +1,5 @@
|
||||
+#include <locale.h>
|
||||
+
|
||||
#include "ping_common.h"
|
||||
#include <ctype.h>
|
||||
#include <sched.h>
|
||||
@@ -98,6 +100,7 @@ static void fill(char *patp)
|
||||
|
||||
void common_options(int ch)
|
||||
{
|
||||
+ setlocale(LC_ALL, "C");
|
||||
switch(ch) {
|
||||
case 'a':
|
||||
options |= F_AUDIBLE;
|
||||
@@ -242,6 +245,7 @@ void common_options(int ch)
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
+ setlocale(LC_ALL, "");
|
||||
}
|
||||
|
@ -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
|
@ -1,29 +1,30 @@
|
||||
diff -up iputils-s20100418/ping.c.corr_type iputils-s20100418/ping.c
|
||||
--- iputils-s20100418/ping.c.corr_type 2010-04-20 15:42:39.193242030 +0200
|
||||
+++ iputils-s20100418/ping.c 2010-04-20 15:42:39.199231317 +0200
|
||||
@@ -1211,18 +1211,20 @@ pr_addr(__u32 addr)
|
||||
--- iputils-s20121112/ping.c.orig 2012-11-13 10:35:16.000000000 +0100
|
||||
+++ iputils-s20121112/ping.c 2012-11-13 10:40:38.512144804 +0100
|
||||
@@ -1226,12 +1226,14 @@ pr_addr(__u32 addr)
|
||||
{
|
||||
struct hostent *hp;
|
||||
static char buf[4096];
|
||||
static __u32 addr_cache = 0;
|
||||
+ struct in_addr tmp_addr;
|
||||
|
||||
if ( addr == addr_cache )
|
||||
return buf;
|
||||
|
||||
addr_cache = addr;
|
||||
in_pr_addr = !setjmp(pr_addr_jmp);
|
||||
+ tmp_addr.s_addr = addr;
|
||||
|
||||
if ((options & F_NUMERIC) ||
|
||||
if (exiting || (options & F_NUMERIC) ||
|
||||
!(hp = gethostbyaddr((char *)&addr, 4, AF_INET)))
|
||||
- sprintf(buf, "%s", inet_ntoa(*(struct in_addr *)&addr));
|
||||
+ sprintf(buf, "%s", inet_ntoa(tmp_addr));
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name,
|
||||
else {
|
||||
char *s;
|
||||
#if USE_IDN
|
||||
@@ -1241,7 +1243,7 @@ pr_addr(__u32 addr)
|
||||
s = NULL;
|
||||
#endif
|
||||
snprintf(buf, sizeof(buf), "%s (%s)", s ? s : hp->h_name,
|
||||
- inet_ntoa(*(struct in_addr *)&addr));
|
||||
+ inet_ntoa(tmp_addr));
|
||||
return(buf);
|
||||
}
|
||||
|
||||
#if USE_IDN
|
||||
free(s);
|
||||
#endif
|
||||
diff -up iputils-s20100418/rdisc.c.corr_type iputils-s20100418/rdisc.c
|
||||
--- iputils-s20100418/rdisc.c.corr_type 2010-04-18 06:45:45.000000000 +0200
|
||||
+++ iputils-s20100418/rdisc.c 2010-04-20 15:42:39.201230377 +0200
|
||||
|
@ -1,280 +0,0 @@
|
||||
--- iputils-s20121011/arping.c.orig 2012-10-16 11:31:38.542591530 +0200
|
||||
+++ iputils-s20121011/arping.c 2012-10-16 11:31:03.000000000 +0200
|
||||
@@ -35,10 +35,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
-#ifdef USE_SYSFS
|
||||
-#include <sysfs/libsysfs.h>
|
||||
-#endif
|
||||
-
|
||||
#include "SNAPSHOT.h"
|
||||
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
@@ -57,14 +53,22 @@ int unicasting;
|
||||
int s;
|
||||
int broadcast_only;
|
||||
|
||||
-struct sockaddr_storage me;
|
||||
-struct sockaddr_storage he;
|
||||
+struct sockaddr_ll *me=NULL;
|
||||
+struct sockaddr_ll *he=NULL;
|
||||
|
||||
struct timeval start, last;
|
||||
|
||||
int sent, brd_sent;
|
||||
int received, brd_recv, req_recv;
|
||||
|
||||
+#define SYSFS_MNT_PATH "/sys"
|
||||
+#define SYSFS_CLASS "class"
|
||||
+#define SYSFS_NET "net"
|
||||
+#define SYSFS_BROADCAST "broadcast"
|
||||
+#define SYSFS_PATH_ENV "SYSFS_PATH"
|
||||
+#define SYSFS_PATH_LEN 256
|
||||
+#define SOCKADDR_LEN (2 * sizeof(struct sockaddr_ll))
|
||||
+
|
||||
#define MS_TDIFF(tv1,tv2) ( ((tv1).tv_sec-(tv2).tv_sec)*1000 + \
|
||||
((tv1).tv_usec-(tv2).tv_usec)/1000 )
|
||||
|
||||
@@ -171,6 +175,10 @@ void finish(void)
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
+
|
||||
+ free(me);
|
||||
+ free(he);
|
||||
+
|
||||
if (dad)
|
||||
exit(!!received);
|
||||
if (unsolicited)
|
||||
@@ -191,8 +199,7 @@ void catcher(void)
|
||||
finish();
|
||||
|
||||
if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
|
||||
- send_pack(s, src, dst,
|
||||
- (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he);
|
||||
+ send_pack(s, src, dst, me, he);
|
||||
if (count == 0 && unsolicited)
|
||||
finish();
|
||||
}
|
||||
@@ -239,7 +246,7 @@ int recv_pack(unsigned char *buf, int le
|
||||
return 0;
|
||||
if (ah->ar_pln != 4)
|
||||
return 0;
|
||||
- if (ah->ar_hln != ((struct sockaddr_ll *)&me)->sll_halen)
|
||||
+ if (ah->ar_hln != me->sll_halen)
|
||||
return 0;
|
||||
if (len < sizeof(*ah) + 2*(4 + ah->ar_hln))
|
||||
return 0;
|
||||
@@ -250,7 +257,7 @@ int recv_pack(unsigned char *buf, int le
|
||||
return 0;
|
||||
if (src.s_addr != dst_ip.s_addr)
|
||||
return 0;
|
||||
- if (memcmp(p+ah->ar_hln+4, ((struct sockaddr_ll *)&me)->sll_addr, ah->ar_hln))
|
||||
+ if (memcmp(p+ah->ar_hln+4, me->sll_addr, ah->ar_hln))
|
||||
return 0;
|
||||
} else {
|
||||
/* DAD packet was:
|
||||
@@ -268,7 +275,7 @@ int recv_pack(unsigned char *buf, int le
|
||||
*/
|
||||
if (src_ip.s_addr != dst.s_addr)
|
||||
return 0;
|
||||
- if (memcmp(p, ((struct sockaddr_ll *)&me)->sll_addr, ((struct sockaddr_ll *)&me)->sll_halen) == 0)
|
||||
+ if (memcmp(p, me->sll_addr, me->sll_halen) == 0)
|
||||
return 0;
|
||||
if (src.s_addr && src.s_addr != dst_ip.s_addr)
|
||||
return 0;
|
||||
@@ -284,7 +291,7 @@ int recv_pack(unsigned char *buf, int le
|
||||
printf("for %s ", inet_ntoa(dst_ip));
|
||||
s_printed = 1;
|
||||
}
|
||||
- if (memcmp(p+ah->ar_hln+4, ((struct sockaddr_ll *)&me)->sll_addr, ah->ar_hln)) {
|
||||
+ if (memcmp(p+ah->ar_hln+4, me->sll_addr, ah->ar_hln)) {
|
||||
if (!s_printed)
|
||||
printf("for ");
|
||||
printf("[");
|
||||
@@ -310,43 +317,67 @@ int recv_pack(unsigned char *buf, int le
|
||||
if (quit_on_reply)
|
||||
finish();
|
||||
if(!broadcast_only) {
|
||||
- memcpy(((struct sockaddr_ll *)&he)->sll_addr, p, ((struct sockaddr_ll *)&me)->sll_halen);
|
||||
+ memcpy(he->sll_addr, p, me->sll_halen);
|
||||
unicasting=1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
-void set_device_broadcast(char *device, unsigned char *ba, size_t balen)
|
||||
+int get_sysfs_mnt_path(char *mnt_path, size_t len)
|
||||
{
|
||||
-#if USE_SYSFS
|
||||
- struct sysfs_class_device *dev;
|
||||
- struct sysfs_attribute *brdcast;
|
||||
- unsigned char *p;
|
||||
- int ch;
|
||||
+ const char *sysfs_path_env;
|
||||
+ int pth_len=0;
|
||||
|
||||
- dev = sysfs_open_class_device("net", device);
|
||||
- if (!dev) {
|
||||
- perror("sysfs_open_class_device(net)");
|
||||
- exit(2);
|
||||
- }
|
||||
+ if (len == 0 || mnt_path == NULL)
|
||||
+ return -1;
|
||||
|
||||
- brdcast = sysfs_get_classdev_attr(dev, "broadcast");
|
||||
- if (!brdcast) {
|
||||
- perror("sysfs_get_classdev_attr(broadcast)");
|
||||
- exit(2);
|
||||
- }
|
||||
+ /* possible overrride of real mount path */
|
||||
+ sysfs_path_env = getenv(SYSFS_PATH_ENV);
|
||||
+ memset(mnt_path, 0, len);
|
||||
+ strncpy(mnt_path,
|
||||
+ sysfs_path_env != NULL ? sysfs_path_env : SYSFS_MNT_PATH,
|
||||
+ len-1);
|
||||
|
||||
- if (sysfs_read_attribute(brdcast)) {
|
||||
- perror("sysfs_read_attribute");
|
||||
- exit(2);
|
||||
+ if ((pth_len = strlen(mnt_path)) > 0 && mnt_path[pth_len-1] == '/')
|
||||
+ mnt_path[pth_len-1] = '\0';
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int make_sysfs_broadcast_path(char *broadcast_path, size_t len)
|
||||
+{
|
||||
+ char mnt_path[SYSFS_PATH_LEN];
|
||||
+
|
||||
+ if (get_sysfs_mnt_path(mnt_path, len) != 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ snprintf(broadcast_path, len,
|
||||
+ "%s/" SYSFS_CLASS "/" SYSFS_NET "/%s/" SYSFS_BROADCAST,
|
||||
+ mnt_path, device);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+char * read_sysfs_broadcast(char *brdcast_path)
|
||||
+{
|
||||
+ int fd;
|
||||
+ int len_to_read;
|
||||
+ char *brdcast = NULL;
|
||||
+
|
||||
+ if ((fd = open(brdcast_path, O_RDONLY)) > -1) {
|
||||
+ len_to_read = lseek(fd, 0L, SEEK_END);
|
||||
+ if ((brdcast = malloc(len_to_read+1)) != NULL) {
|
||||
+ lseek(fd, 0L, SEEK_SET);
|
||||
+ memset(brdcast, 0, len_to_read+1);
|
||||
+ if (read(fd, brdcast, len_to_read) == -1) {
|
||||
+ free(brdcast);
|
||||
+ brdcast = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ close(fd);
|
||||
}
|
||||
|
||||
- for (p = ba, ch = 0; p < ba + balen; p++, ch += 3)
|
||||
- *p = strtoul(brdcast->value + ch, NULL, 16);
|
||||
-#else
|
||||
- memset(ba, -1, balen);
|
||||
-#endif
|
||||
- return;
|
||||
+ return brdcast;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -375,6 +406,17 @@ main(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ me = malloc(SOCKADDR_LEN);
|
||||
+ if (!me) {
|
||||
+ fprintf(stderr, "arping: could not allocate memory\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ he = malloc(SOCKADDR_LEN);
|
||||
+ if (!he) {
|
||||
+ fprintf(stderr, "arping: could not allocate memory\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
|
||||
switch(ch) {
|
||||
case 'b':
|
||||
@@ -523,31 +565,48 @@ main(int argc, char **argv)
|
||||
close(probe_fd);
|
||||
};
|
||||
|
||||
- ((struct sockaddr_ll *)&me)->sll_family = AF_PACKET;
|
||||
- ((struct sockaddr_ll *)&me)->sll_ifindex = ifindex;
|
||||
- ((struct sockaddr_ll *)&me)->sll_protocol = htons(ETH_P_ARP);
|
||||
- if (bind(s, (struct sockaddr*)&me, sizeof(me)) == -1) {
|
||||
+ me->sll_family = AF_PACKET;
|
||||
+ me->sll_ifindex = ifindex;
|
||||
+ me->sll_protocol = htons(ETH_P_ARP);
|
||||
+ if (bind(s, (struct sockaddr*)me, SOCKADDR_LEN) == -1) {
|
||||
perror("bind");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if (1) {
|
||||
- socklen_t alen = sizeof(me);
|
||||
- if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) {
|
||||
+ socklen_t alen = SOCKADDR_LEN;
|
||||
+ if (getsockname(s, (struct sockaddr*)me, &alen) == -1) {
|
||||
perror("getsockname");
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
- if (((struct sockaddr_ll *)&me)->sll_halen == 0) {
|
||||
+ if (me->sll_halen == 0) {
|
||||
if (!quiet)
|
||||
printf("Interface \"%s\" is not ARPable (no ll address)\n", device);
|
||||
exit(dad?0:2);
|
||||
}
|
||||
|
||||
- he = me;
|
||||
+ memcpy(he, me, SOCKADDR_LEN);
|
||||
+
|
||||
+ char brdcast_path[SYSFS_PATH_LEN];
|
||||
+ char *brdcast_val=NULL;
|
||||
+ char *next_ch;
|
||||
+
|
||||
+ if (make_sysfs_broadcast_path(brdcast_path, sizeof brdcast_path) != 0) {
|
||||
+ perror("sysfs attribute broadcast");
|
||||
+ exit(2);
|
||||
+ }
|
||||
+
|
||||
+ if ((brdcast_val = read_sysfs_broadcast(brdcast_path)) == NULL) {
|
||||
+ perror("sysfs read broadcast value");
|
||||
+ exit(2);
|
||||
+ }
|
||||
+
|
||||
+ for (ch=0; ch<he->sll_halen; ch++) {
|
||||
+ he->sll_addr[ch] = strtol(brdcast_val + (ch*3), &next_ch, 16);
|
||||
+ }
|
||||
|
||||
- set_device_broadcast(device, ((struct sockaddr_ll *)&he)->sll_addr,
|
||||
- ((struct sockaddr_ll *)&he)->sll_halen);
|
||||
+ free(brdcast_val);
|
||||
|
||||
if (!quiet) {
|
||||
printf("ARPING %s ", inet_ntoa(dst));
|
||||
--- iputils-s20121106/Makefile.orig 2012-11-06 14:07:24.000000000 +0100
|
||||
+++ iputils-s20121106/Makefile 2012-11-06 14:07:51.394624700 +0100
|
||||
@@ -31,11 +31,6 @@
|
||||
LIB_CAP = -lcap
|
||||
endif
|
||||
|
||||
-ifneq ($(USE_SYSFS),no)
|
||||
- DEFINES += -DUSE_SYSFS
|
||||
- LIB_SYSFS = -lsysfs
|
||||
-endif
|
||||
-
|
||||
# -------------------------------------
|
||||
IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
|
||||
IPV6_TARGETS=tracepath6 traceroute6 ping6
|
@ -1,66 +0,0 @@
|
||||
diff -up iputils-s20100418/in6_flowlabel.h.flowlabel iputils-s20100418/in6_flowlabel.h
|
||||
--- iputils-s20100418/in6_flowlabel.h.flowlabel 2010-05-17 13:54:03.422586206 +0200
|
||||
+++ iputils-s20100418/in6_flowlabel.h 2010-05-17 13:54:03.422586206 +0200
|
||||
@@ -0,0 +1,40 @@
|
||||
+/*
|
||||
+ It is just a stripped copy of the kernel header "linux/in6.h"
|
||||
+
|
||||
+ "Flow label" things are still not defined in "netinet/in*.h" headers,
|
||||
+ but we cannot use "linux/in6.h" immediately because it currently
|
||||
+ conflicts with "netinet/in.h" .
|
||||
+*/
|
||||
+
|
||||
+struct in6_flowlabel_req
|
||||
+{
|
||||
+ struct in6_addr flr_dst;
|
||||
+ __u32 flr_label;
|
||||
+ __u8 flr_action;
|
||||
+ __u8 flr_share;
|
||||
+ __u16 flr_flags;
|
||||
+ __u16 flr_expires;
|
||||
+ __u16 flr_linger;
|
||||
+ __u32 __flr_pad;
|
||||
+ /* Options in format of IPV6_PKTOPTIONS */
|
||||
+};
|
||||
+
|
||||
+#define IPV6_FL_A_GET 0
|
||||
+#define IPV6_FL_A_PUT 1
|
||||
+#define IPV6_FL_A_RENEW 2
|
||||
+
|
||||
+#define IPV6_FL_F_CREATE 1
|
||||
+#define IPV6_FL_F_EXCL 2
|
||||
+
|
||||
+#define IPV6_FL_S_NONE 0
|
||||
+#define IPV6_FL_S_EXCL 1
|
||||
+#define IPV6_FL_S_PROCESS 2
|
||||
+#define IPV6_FL_S_USER 3
|
||||
+#define IPV6_FL_S_ANY 255
|
||||
+
|
||||
+#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
|
||||
+#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
|
||||
+
|
||||
+#define IPV6_FLOWLABEL_MGR 32
|
||||
+#define IPV6_FLOWINFO_SEND 33
|
||||
+
|
||||
--- iputils-s20121106/Makefile.orig 2012-11-06 14:09:00.000000000 +0100
|
||||
+++ iputils-s20121106/Makefile 2012-11-06 14:09:30.983678824 +0100
|
||||
@@ -60,7 +60,7 @@
|
||||
$(LINK.o) $^ -lidn $(LIB_CAP) $(LDLIBS) -o $@
|
||||
ping6: ping6.o ping_common.o
|
||||
$(LINK.o) $^ -lresolv -lcrypto $(LIB_CAP) $(LDLIBS) -o $@
|
||||
-ping.o ping6.o ping_common.o: ping_common.h
|
||||
+ping.o ping6.o ping_common.o: ping_common.h in6_flowlabel.h
|
||||
|
||||
# rarpd
|
||||
|
||||
diff -up iputils-s20100418/ping6.c.flowlabel iputils-s20100418/ping6.c
|
||||
--- iputils-s20100418/ping6.c.flowlabel 2010-05-17 13:55:34.012839691 +0200
|
||||
+++ iputils-s20100418/ping6.c 2010-05-17 13:55:36.411557280 +0200
|
||||
@@ -74,6 +74,7 @@ char copyright[] =
|
||||
#include <resolv.h>
|
||||
|
||||
#include "ping6_niquery.h"
|
||||
+#include "in6_flowlabel.h"
|
||||
|
||||
#ifndef SOL_IPV6
|
||||
#define SOL_IPV6 IPPROTO_IPV6
|
@ -1,6 +1,6 @@
|
||||
--- iputils-s20121011/arping.c.orig 2012-10-16 11:46:12.000000000 +0200
|
||||
+++ iputils-s20121011/arping.c 2012-10-16 11:49:09.746673028 +0200
|
||||
@@ -40,7 +40,7 @@
|
||||
--- iputils-s20121112/arping.c.orig 2012-11-13 12:12:51.000000000 +0100
|
||||
+++ iputils-s20121112/arping.c 2012-11-13 12:15:11.514261164 +0100
|
||||
@@ -50,7 +50,7 @@
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
|
||||
int quit_on_reply=0;
|
||||
@ -9,20 +9,19 @@
|
||||
int ifindex;
|
||||
char *source;
|
||||
struct in_addr src, dst;
|
||||
@@ -69,6 +69,11 @@ int received, brd_recv, req_recv;
|
||||
#define SYSFS_PATH_LEN 256
|
||||
#define SOCKADDR_LEN (2 * sizeof(struct sockaddr_ll))
|
||||
@@ -71,6 +71,10 @@ struct timeval start, last;
|
||||
int sent, brd_sent;
|
||||
int received, brd_recv, req_recv;
|
||||
|
||||
+#define PREF_ETH "eth"
|
||||
+#define PREF_EM "em"
|
||||
+
|
||||
+#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 )
|
||||
|
||||
@@ -380,6 +385,46 @@ char * read_sysfs_broadcast(char *brdcas
|
||||
return brdcast;
|
||||
#ifndef CAPABILITIES
|
||||
static uid_t euid;
|
||||
#endif
|
||||
@@ -524,6 +528,46 @@ static void set_device_broadcast(char *d
|
||||
return;
|
||||
}
|
||||
|
||||
+/*
|
||||
@ -68,16 +67,16 @@
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@@ -417,6 +462,8 @@ main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
@@ -543,6 +587,8 @@ main(int argc, char **argv)
|
||||
|
||||
disable_capability_raw();
|
||||
|
||||
+ device = get_first_ethernet();
|
||||
+
|
||||
while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
|
||||
switch(ch) {
|
||||
case 'b':
|
||||
@@ -443,6 +490,10 @@ main(int argc, char **argv)
|
||||
@@ -569,6 +615,10 @@ main(int argc, char **argv)
|
||||
timeout = atoi(optarg);
|
||||
break;
|
||||
case 'I':
|
||||
|
@ -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
|
@ -1,75 +0,0 @@
|
||||
--- iputils-s20101006/ping.c 2012-06-25 09:43:53.247390215 +0200
|
||||
+++ iputils-s20101006-patch/ping.c 2012-06-25 09:46:01.333436372 +0200
|
||||
@@ -1243,12 +1243,17 @@ pr_addr(__u32 addr)
|
||||
addr_cache = addr;
|
||||
tmp_addr.s_addr = addr;
|
||||
|
||||
- if ((options & F_NUMERIC) ||
|
||||
+ in_pr_addr = !setjmp(pr_addr_jmp);
|
||||
+
|
||||
+ if (exiting || (options & F_NUMERIC) ||
|
||||
!(hp = gethostbyaddr((char *)&addr, 4, AF_INET)))
|
||||
sprintf(buf, "%s", inet_ntoa(tmp_addr));
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name,
|
||||
inet_ntoa(tmp_addr));
|
||||
+
|
||||
+ in_pr_addr = 0;
|
||||
+
|
||||
return(buf);
|
||||
}
|
||||
|
||||
--- iputils-s20101006/ping6.c 2012-06-25 09:43:53.233390208 +0200
|
||||
+++ iputils-s20101006-patch/ping6.c 2012-06-25 09:46:52.437450591 +0200
|
||||
@@ -1565,9 +1565,13 @@ char * pr_addr(struct in6_addr *addr)
|
||||
return hp ? hp->h_name : pr_addr_n(addr);
|
||||
memcpy(&addr_cache, addr, sizeof(addr_cache));
|
||||
|
||||
- if (!(options&F_NUMERIC))
|
||||
+ in_pr_addr = !setjmp(pr_addr_jmp);
|
||||
+
|
||||
+ if (!(exiting || options&F_NUMERIC))
|
||||
hp = gethostbyaddr((__u8*)addr, sizeof(struct in6_addr), AF_INET6);
|
||||
|
||||
+ in_pr_addr = 0;
|
||||
+
|
||||
return hp ? hp->h_name : pr_addr_n(addr);
|
||||
}
|
||||
|
||||
--- iputils-s20101006/ping_common.h 2012-06-25 09:43:53.249390215 +0200
|
||||
+++ iputils-s20101006-patch/ping_common.h 2012-06-25 09:47:24.002458261 +0200
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
+#include <setjmp.h>
|
||||
|
||||
#ifdef CAPABILITIES
|
||||
#include <sys/capability.h>
|
||||
@@ -219,3 +220,6 @@ extern int gather_statistics(__u8 *ptr,
|
||||
int csfailed, struct timeval *tv, char *from,
|
||||
void (*pr_reply)(__u8 *ptr, int cc));
|
||||
extern void print_timestamp(void);
|
||||
+
|
||||
+extern int in_pr_addr;
|
||||
+extern jmp_buf pr_addr_jmp;
|
||||
--- iputils-s20101006/ping_common.c 2012-06-25 09:43:53.252390217 +0200
|
||||
+++ iputils-s20101006-patch/ping_common.c 2012-06-25 09:49:04.972477402 +0200
|
||||
@@ -32,6 +32,8 @@ struct timeval start_time, cur_time;
|
||||
volatile int exiting;
|
||||
volatile int status_snapshot;
|
||||
int confirm = 0;
|
||||
+int in_pr_addr = 0; /* pr_addr() is executing */
|
||||
+jmp_buf pr_addr_jmp;
|
||||
|
||||
/* Stupid workarounds for bugs/missing functionality in older linuces.
|
||||
* confirm_flag fixes refusing service of kernels without MSG_CONFIRM.
|
||||
@@ -252,6 +254,8 @@ void common_options(int ch)
|
||||
static void sigexit(int signo)
|
||||
{
|
||||
exiting = 1;
|
||||
+ if (in_pr_addr)
|
||||
+ longjmp(pr_addr_jmp, 0);
|
||||
}
|
||||
|
||||
static void sigstatus(int signo)
|
@ -1,11 +0,0 @@
|
||||
--- iputils-s20101006/ping_common.c 2010-10-06 13:59:20.000000000 +0200
|
||||
+++ iputils-s20101006-patched/ping_common.c 2012-03-09 16:42:46.878151032 +0100
|
||||
@@ -590,7 +590,7 @@
|
||||
|
||||
/* If we are here, recvmsg() is unable to wait for
|
||||
* required timeout. */
|
||||
- if (1000*next <= 1000000/(int)HZ) {
|
||||
+ if (((uint64_t)1000*next) <= (uint64_t)1000000/(int)HZ) {
|
||||
/* Very short timeout... So, if we wait for
|
||||
* something, we sleep for MININTERVAL.
|
||||
* Otherwise, spin! */
|
@ -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;
|
11
iputils-20121112-idn.patch
Normal file
11
iputils-20121112-idn.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- iputils-s20121112/Makefile.orig 2012-11-13 12:35:00.000000000 +0100
|
||||
+++ iputils-s20121112/Makefile 2012-11-13 12:35:40.515729240 +0100
|
||||
@@ -18,7 +18,7 @@ USE_CAP=yes
|
||||
# sysfs support (with libsysfs - deprecated)
|
||||
USE_SYSFS=no
|
||||
# IDN support (experimental
|
||||
-USE_IDN=no
|
||||
+USE_IDN=yes
|
||||
|
||||
# -------------------------------------
|
||||
# What a pity, all new gccs are buggy and -Werror does not work. Sigh.
|
30
iputils.spec
30
iputils.spec
@ -1,7 +1,7 @@
|
||||
Summary: Network monitoring tools including ping
|
||||
Name: iputils
|
||||
Version: 20121106
|
||||
Release: 2%{?dist}
|
||||
Version: 20121112
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
URL: http://www.skbuff.net/iputils
|
||||
Group: System Environment/Daemons
|
||||
@ -14,22 +14,17 @@ Source5: rdisc.sysconfig
|
||||
|
||||
Patch0: iputils-20020927-rh.patch
|
||||
Patch1: iputils-20020124-countermeasures.patch
|
||||
Patch2: iputils-20020927-addrcache.patch
|
||||
Patch3: iputils-20020927-ping-subint.patch
|
||||
Patch5: iputils-ifenslave.patch
|
||||
Patch6: iputils-20070202-idn.patch
|
||||
Patch7: iputils-20070202-traffic_class.patch
|
||||
Patch6: iputils-20121112-idn.patch
|
||||
# Purpose of this patch?
|
||||
Patch8: iputils-20070202-ia64_align.patch
|
||||
Patch10: iputils-20071127-corr_type.patch
|
||||
Patch11: iputils-20071127-infiniband.patch
|
||||
Patch12: iputils-20100418-convtoint.patch
|
||||
Patch13: iputils-20100418-flowlabel.patch
|
||||
# Accepted upstream, will be in the next release
|
||||
Patch15: iputils-20101006-unused.patch
|
||||
Patch16: iputils-20101006-man.patch
|
||||
# Use getifaddrs() instead of this?
|
||||
Patch17: iputils-20101006-eth.patch
|
||||
Patch18: iputils-20101006-rr.patch
|
||||
Patch21: iputils-20101006-ping-integer-overflow.patch
|
||||
Patch22: iputils-20101006-ping-fallback-to-numeric-addresses-while-exiting.patch
|
||||
|
||||
BuildRequires: docbook-utils perl-SGMLSpm
|
||||
BuildRequires: glibc-kernheaders >= 2.4-8.19
|
||||
@ -69,22 +64,14 @@ The iputils-sysvinit contains SysV initscritps support.
|
||||
|
||||
%patch0 -p1 -b .rh
|
||||
%patch1 -p1 -b .countermeasures
|
||||
%patch2 -p1 -b .addrcache
|
||||
%patch3 -p1 -b .ping-subint
|
||||
%patch5 -p1 -b .addr
|
||||
%patch6 -p1 -b .idn
|
||||
%patch7 -p1 -b .traffic_class
|
||||
%patch8 -p1 -b .ia64_align
|
||||
%patch10 -p1 -b .corr_type
|
||||
%patch11 -p1 -b .infiniband
|
||||
%patch12 -p1 -b .convtoint
|
||||
%patch13 -p1 -b .flowlabel
|
||||
%patch15 -p1 -b .unused
|
||||
%patch16 -p1 -b .man
|
||||
%patch17 -p1 -b .eth
|
||||
%patch18 -p1 -b .rr
|
||||
%patch21 -p1 -b .intoverflow
|
||||
%patch22 -p1 -b .fallback
|
||||
|
||||
%build
|
||||
%ifarch s390 s390x
|
||||
@ -167,6 +154,11 @@ mv -f RELNOTES.tmp RELNOTES
|
||||
%{_sysconfdir}/rc.d/init.d/rdisc
|
||||
|
||||
%changelog
|
||||
* Tue Nov 13 2012 Jan Synáček <jsynacek@redhat.com> - 20121112-1
|
||||
- Update to iputils-s20121112 (#875767)
|
||||
+ drop unnecessary patches
|
||||
+ update patches
|
||||
|
||||
* Thu Nov 08 2012 Jan Synáček <jsynacek@redhat.com> - 20121106-2
|
||||
- Update ifenslave tarball (#859182)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user