diff --git a/net-tools-1.60-IA64.patch b/net-tools-1.60-IA64.patch index cb507f7..0e59c3f 100644 --- a/net-tools-1.60-IA64.patch +++ b/net-tools-1.60-IA64.patch @@ -11,3 +11,23 @@ diff -up net-tools-1.60/ifconfig.c.IA64 net-tools-1.60/ifconfig.c if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) { fprintf(stderr, _("Interface %s not initialized\n"), +diff -up net-tools-1.60/lib/interface.c.IA64 net-tools-1.60/lib/interface.c +--- net-tools-1.60/lib/interface.c.IA64 2010-01-02 11:35:39.000000000 +0100 ++++ net-tools-1.60/lib/interface.c 2010-01-02 12:03:05.000000000 +0100 +@@ -491,14 +491,14 @@ int if_fetch(struct interface *ife) + if (ioctl(skfd, SIOCGOUTFILL, &ifr) < 0) + ife->outfill = 0; + else +- ife->outfill = (unsigned int) ifr.ifr_data; ++ ife->outfill = (unsigned long) ifr.ifr_data; + #endif + #ifdef SIOCGKEEPALIVE + strcpy(ifr.ifr_name, ifname); + if (ioctl(skfd, SIOCGKEEPALIVE, &ifr) < 0) + ife->keepalive = 0; + else +- ife->keepalive = (unsigned int) ifr.ifr_data; ++ ife->keepalive = (unsigned long) ifr.ifr_data; + #endif + } + #endif diff --git a/net-tools-1.60-avoid-name-resolution.patch b/net-tools-1.60-avoid-name-resolution.patch new file mode 100644 index 0000000..365fcd2 --- /dev/null +++ b/net-tools-1.60-avoid-name-resolution.patch @@ -0,0 +1,31 @@ +diff -up net-tools-1.60/netstat.c.avoid-name-resolution net-tools-1.60/netstat.c +--- net-tools-1.60/netstat.c.avoid-name-resolution 2009-08-28 10:48:40.000000000 +0200 ++++ net-tools-1.60/netstat.c 2009-08-14 12:36:56.000000000 +0200 +@@ -961,6 +961,10 @@ static void tcp_do_one(int lnr, const ch + &d, local_addr, &local_port, rem_addr, &rem_port, &state, + &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); + ++ if (!flag_all && ++ ((flag_lst && rem_port) || (!flag_lst && !rem_port))) ++ return; ++ + if (strlen(local_addr) > 8) { + #if HAVE_AFINET6 + /* Demangle what the kernel gives us */ +@@ -1014,7 +1018,7 @@ static void tcp_do_one(int lnr, const ch + flag_not & FLAG_NUM_HOST), sizeof(local_addr)); + safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST), + sizeof(rem_addr)); +- if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) { ++ + snprintf(buffer, sizeof(buffer), "%s", + get_sname(htons(local_port), "tcp", + flag_not & FLAG_NUM_PORT)); +@@ -1075,7 +1079,6 @@ static void tcp_do_one(int lnr, const ch + rxq, txq, local_addr, rem_addr, _(tcp_state[state])); + + finish_this_one(uid,inode,timers); +- } + } + + static int tcp_info(void) diff --git a/net-tools-1.60-continous-flush-stdout.patch b/net-tools-1.60-continous-flush-stdout.patch new file mode 100644 index 0000000..57e9d66 --- /dev/null +++ b/net-tools-1.60-continous-flush-stdout.patch @@ -0,0 +1,61 @@ +diff -up net-tools-1.60/netstat.c.continous-flush-stdout net-tools-1.60/netstat.c +--- net-tools-1.60/netstat.c.continous-flush-stdout 2009-08-28 10:57:12.000000000 +0200 ++++ net-tools-1.60/netstat.c 2009-08-28 10:58:48.000000000 +0200 +@@ -357,6 +357,12 @@ static void prg_cache_clear(void) + prg_cache_loaded=0; + } + ++static void wait_continous(const int reptimer) ++{ ++ fflush(stdout); ++ sleep(reptimer); ++} ++ + static void extract_type_1_socket_inode(const char lname[], unsigned long * inode_p, int * status) { + + /* If lname is of the form "socket:[12345]", extract the "12345" +@@ -2289,7 +2295,7 @@ int main + flag_not & FLAG_NUM_PORT, flag_exp); + if (i || !flag_cnt) + break; +- sleep(reptimer); ++ wait_continous(reptimer); + } + #else + ENOSUPP("netstat.c", "FW_MASQUERADE"); +@@ -2305,7 +2311,7 @@ int main + + if(i || !flag_cnt) + break; +- sleep(reptimer); ++ wait_continous(reptimer); + } + return(i); + } +@@ -2329,7 +2335,7 @@ int main + i = route_info(afname, options); + if (i || !flag_cnt) + break; +- sleep(reptimer); ++ wait_continous(reptimer); + } + return (i); + } +@@ -2338,7 +2344,7 @@ int main + i = iface_info(); + if (!flag_cnt || i) + break; +- sleep(reptimer); ++ wait_continous(reptimer); + } + return (i); + } +@@ -2470,7 +2476,7 @@ int main + } + if (!flag_cnt || i) + break; +- sleep(reptimer); ++ wait_continous(reptimer); + prg_cache_clear(); + tcp_node_hash_clear(); + } diff --git a/net-tools-1.60-debug-fix.patch b/net-tools-1.60-debug-fix.patch new file mode 100644 index 0000000..ae5fd33 --- /dev/null +++ b/net-tools-1.60-debug-fix.patch @@ -0,0 +1,61 @@ +diff -up net-tools-1.60/lib/rose.c.debug-fix net-tools-1.60/lib/rose.c +--- net-tools-1.60/lib/rose.c.debug-fix 2000-03-05 12:26:03.000000000 +0100 ++++ net-tools-1.60/lib/rose.c 2009-09-01 13:02:20.000000000 +0200 +@@ -86,7 +86,7 @@ static int ROSE_input(int type, char *bu + if (strlen(bufp) != 10) { + strcpy(ROSE_errmsg, _("Node address must be ten digits")); + #ifdef DEBUG +- fprintf(stderr, "rose_input(%s): %s !\n", ROSE_errmsg, orig); ++ fprintf(stderr, "rose_input(%s): %s !\n", bufp, ROSE_errmsg); + #endif + errno = EINVAL; + return (-1); +@@ -99,7 +99,7 @@ static int ROSE_input(int type, char *bu + + /* All done. */ + #ifdef DEBUG +- fprintf(stderr, "rose_input(%s): ", orig); ++ fprintf(stderr, "rose_input(%s): ", bufp); + for (i = 0; i < sizeof(rose_address); i++) + fprintf(stderr, "%02X ", sap->sa_data[i] & 0377); + fprintf(stderr, "\n"); +diff -up net-tools-1.60/lib/x25.c.debug-fix net-tools-1.60/lib/x25.c +--- net-tools-1.60/lib/x25.c.debug-fix 2000-05-20 20:53:25.000000000 +0200 ++++ net-tools-1.60/lib/x25.c 2009-09-01 13:06:05.000000000 +0200 +@@ -81,6 +81,7 @@ X25_input(int type, char *bufp, struct s + unsigned char *ptr; + char *p; + unsigned int sigdigits; ++ int i; + + sap->sa_family = x25_aftype.af; + ptr = ((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr; +@@ -90,7 +91,7 @@ X25_input(int type, char *bufp, struct s + if (strlen(bufp)>18) { + strcpy(X25_errmsg, _("Address can't exceed eighteen digits with sigdigits")); + #ifdef DEBUG +- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig); ++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg); + #endif + errno = EINVAL; + return(-1); +@@ -108,7 +109,7 @@ X25_input(int type, char *bufp, struct s + *p = '/'; + strcpy(X25_errmsg, _("Invalid address")); + #ifdef DEBUG +- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig); ++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg); + #endif + errno = EINVAL; + return(-1); +@@ -118,8 +119,8 @@ X25_input(int type, char *bufp, struct s + + /* All done. */ + #ifdef DEBUG +- fprintf(stderr, "x25_input(%s): ", orig); +- for (i = 0; i < sizeof(x25_address); i++) ++ fprintf(stderr, "x25_input(%s): ", bufp); ++ for (i = 0; i < sizeof(sap->sa_data); i++) + fprintf(stderr, "%02X ", sap->sa_data[i] & 0377); + fprintf(stderr, "\n"); + #endif diff --git a/net-tools-1.60-ifdef-vs-if.patch b/net-tools-1.60-ifdef-vs-if.patch new file mode 100644 index 0000000..526b13c --- /dev/null +++ b/net-tools-1.60-ifdef-vs-if.patch @@ -0,0 +1,74 @@ +diff -up net-tools-1.60/ifconfig.c.ifdef-vs-if net-tools-1.60/ifconfig.c +--- net-tools-1.60/ifconfig.c.ifdef-vs-if 2011-01-03 12:23:14.000000000 +0100 ++++ net-tools-1.60/ifconfig.c 2011-01-03 12:31:40.000000000 +0100 +@@ -51,7 +51,7 @@ + #include + + +-#ifdef HAVE_HWSLIP ++#if HAVE_HWSLIP + #include + #endif + +@@ -784,7 +784,7 @@ int main(int argc, char **argv) + continue; + } + #endif +-#ifdef HAVE_AFINET ++#if HAVE_AFINET + { /* ipv4 address a.b.c.d */ + unsigned long ip, nm, bc; + safe_strncpy(host, *spp, (sizeof host)); +@@ -875,7 +875,7 @@ int main(int argc, char **argv) + continue; + } + #endif +-#ifdef HAVE_AFINET ++#if HAVE_AFINET + { + /* ipv4 address a.b.c.d */ + unsigned long ip, nm, bc; +diff -up net-tools-1.60/lib/interface.c.ifdef-vs-if net-tools-1.60/lib/interface.c +--- net-tools-1.60/lib/interface.c.ifdef-vs-if 2011-01-03 12:23:14.000000000 +0100 ++++ net-tools-1.60/lib/interface.c 2011-01-03 12:40:57.000000000 +0100 +@@ -36,7 +36,7 @@ + #include + #endif + +-#ifdef HAVE_HWSLIP ++#if HAVE_HWSLIP + #include + #include + #endif +@@ -482,7 +482,7 @@ int if_fetch(struct interface *ife) + else + ife->mtu = ifr.ifr_mtu; + +-#ifdef HAVE_HWSLIP ++#if HAVE_HWSLIP + if (ife->type == ARPHRD_SLIP || ife->type == ARPHRD_CSLIP || + ife->type == ARPHRD_SLIP6 || ife->type == ARPHRD_CSLIP6 || + ife->type == ARPHRD_ADAPT) { +@@ -726,8 +726,10 @@ void ife_print_long(struct interface *pt + + hf = ptr->type; + ++#if HAVE_HWSLIP + if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6) + can_compress = 1; ++#endif + + hw = get_hwntype(hf); + if (hw == NULL) +diff -up net-tools-1.60/lib/net-support.h.ifdef-vs-if net-tools-1.60/lib/net-support.h +--- net-tools-1.60/lib/net-support.h.ifdef-vs-if 2000-10-28 12:59:42.000000000 +0200 ++++ net-tools-1.60/lib/net-support.h 2011-01-03 12:33:21.000000000 +0100 +@@ -234,7 +234,7 @@ extern char afname[]; + /* this is a 2.0.36 flag from /usr/src/linux/include/linux/route.h */ + #define RTF_NOTCACHED 0x0400 /* this route isn't cached */ + +-#ifdef HAVE_AFECONET ++#if HAVE_AFECONET + #ifndef AF_ECONET + #define AF_ECONET 19 /* Acorn Econet */ + #endif diff --git a/net-tools-1.60-large-indexes.patch b/net-tools-1.60-large-indexes.patch new file mode 100644 index 0000000..3585dbb --- /dev/null +++ b/net-tools-1.60-large-indexes.patch @@ -0,0 +1,12 @@ +diff -up net-tools-1.60/lib/interface.c.large-indexes net-tools-1.60/lib/interface.c +--- net-tools-1.60/lib/interface.c.large-indexes 2010-01-02 12:05:13.000000000 +0100 ++++ net-tools-1.60/lib/interface.c 2010-01-02 12:34:24.000000000 +0100 +@@ -766,7 +766,7 @@ void ife_print_long(struct interface *pt + /* FIXME: should be integrated into interface.c. */ + + if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) { +- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", ++ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n", + addr6p[0], addr6p[1], addr6p[2], addr6p[3], + addr6p[4], addr6p[5], addr6p[6], addr6p[7], + &if_idx, &plen, &scope, &dad_status, devname) != EOF) { diff --git a/net-tools-1.60-makefile-berlios.patch b/net-tools-1.60-makefile-berlios.patch new file mode 100644 index 0000000..7b9b007 --- /dev/null +++ b/net-tools-1.60-makefile-berlios.patch @@ -0,0 +1,69 @@ +diff -up net-tools-1.60/lib/Makefile.makefile-berlios net-tools-1.60/lib/Makefile +--- net-tools-1.60/lib/Makefile.makefile-berlios 2009-09-15 18:07:12.000000000 +0200 ++++ net-tools-1.60/lib/Makefile 2009-09-15 18:07:12.000000000 +0200 +@@ -36,7 +36,7 @@ OBJS = $(sort $(VARIA) $(AFOBJS) $(HWOBJ + + # This can be overwritten by the TOPLEVEL Makefile + TOPDIR=.. +-CFLAGS += -I$(TOPDIR) -idirafter $(TOPDIR)/include # -fPIC ++CFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include # -fPIC + SONAME=libnet-tools.so.0 + + .SUFFIXES: .a .so +diff -up net-tools-1.60/Makefile.makefile-berlios net-tools-1.60/Makefile +--- net-tools-1.60/Makefile.makefile-berlios 2009-09-15 18:07:12.000000000 +0200 ++++ net-tools-1.60/Makefile 2009-09-15 18:08:25.000000000 +0200 +@@ -88,10 +88,9 @@ endif + + # Compiler and Linker Options + # You may need to uncomment and edit these if you are using libc5 and IPv6. +-COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include +-ifeq ($(origin LOPTS), undefined) +-LOPTS = +-endif ++CFLAGS ?= -O2 -g ++CFLAGS += -fno-strict-aliasing # code needs a lot of work before strict aliasing is safe ++CPPFLAGS += -D_GNU_SOURCE + RESLIB = # -L/usr/inet6/lib -linet6 + + ifeq ($(HAVE_AFDECnet),1) +@@ -119,8 +118,9 @@ CFLAGS += -DHAVE_SELINUX + else + endif + +-CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH) +-LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH) ++CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH) ++LDFLAGS += -L$(NET_LIB_PATH) ++ + + SUBDIRS = man/ $(NET_LIB_PATH)/ + +@@ -131,8 +131,6 @@ LD = $(CC) + + NLIB = -l$(NET_LIB_NAME) + +-MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)' +- + %.o: %.c config.h version.h intl.h net-features.h $< + $(CC) $(CFLAGS) -c $< + +@@ -181,14 +179,15 @@ $(NET_LIB): config.h version.h intl.h li + + i18n.h: i18ndir + +-libdir: +- @$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES) ++libdir: version.h ++ @$(MAKE) -C $(NET_LIB_PATH) + + i18ndir: + @$(MAKE) -C po + + subdirs: +- @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done ++ @for i in $(SUBDIRS); do $(MAKE) -C $$i || exit $$? ; done ++ + + ifconfig: $(NET_LIB) ifconfig.o + $(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB) diff --git a/net-tools-1.60-masqinfo-raw-ip.patch b/net-tools-1.60-masqinfo-raw-ip.patch new file mode 100644 index 0000000..492e08f --- /dev/null +++ b/net-tools-1.60-masqinfo-raw-ip.patch @@ -0,0 +1,14 @@ +diff -up net-tools-1.60/lib/masq_info.c.masqinfo-raw-ip net-tools-1.60/lib/masq_info.c +--- net-tools-1.60/lib/masq_info.c.masqinfo-raw-ip 2000-10-28 12:59:42.000000000 +0200 ++++ net-tools-1.60/lib/masq_info.c 2009-09-15 17:05:24.000000000 +0200 +@@ -119,7 +119,9 @@ static int read_masqinfo(FILE * f, struc + ms->src.sin_family = AF_INET; + ms->dst.sin_family = AF_INET; + +- if (strcmp("TCP", buf) == 0) ++ if (strcmp("IP", buf) == 0) ++ ms->proto = "ip"; ++ else if (strcmp("TCP", buf) == 0) + ms->proto = "tcp"; + else if (strcmp("UDP", buf) == 0) + ms->proto = "udp"; diff --git a/net-tools-1.60-netstat-p-basename.patch b/net-tools-1.60-netstat-p-basename.patch new file mode 100644 index 0000000..c569079 --- /dev/null +++ b/net-tools-1.60-netstat-p-basename.patch @@ -0,0 +1,26 @@ +diff -up net-tools-1.60/netstat.c.p-basename net-tools-1.60/netstat.c +--- net-tools-1.60/netstat.c.p-basename 2011-06-09 12:01:59.907721330 +0200 ++++ net-tools-1.60/netstat.c 2011-06-09 12:02:28.437352480 +0200 +@@ -413,7 +413,7 @@ static void prg_cache_load(void) + { + char line[LINE_MAX],eacces=0; + int procfdlen,fd,cmdllen,lnamelen; +- char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH]; ++ char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH],*cmdlpend; + unsigned long inode; + const char *cs,*cmdlp; + DIR *dirproc=NULL,*dirfd=NULL; +@@ -484,10 +484,12 @@ static void prg_cache_load(void) + continue; + if (cmdllen < sizeof(cmdlbuf) - 1) + cmdlbuf[cmdllen]='\0'; +- if ((cmdlp = strrchr(cmdlbuf, '/'))) ++ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/'))) + cmdlp++; + else + cmdlp = cmdlbuf; ++ if ((cmdlpend = strrchr(cmdlp, ':')) != NULL) ++ *cmdlpend = '\0'; + } + + snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp); diff --git a/net-tools-1.60-scanf-format.patch b/net-tools-1.60-scanf-format.patch new file mode 100644 index 0000000..f78d8d1 --- /dev/null +++ b/net-tools-1.60-scanf-format.patch @@ -0,0 +1,142 @@ +diff -up net-tools-1.60/arp.c.scanf-format net-tools-1.60/arp.c +--- net-tools-1.60/arp.c.scanf-format 2011-02-04 14:37:11.000000000 +0100 ++++ net-tools-1.60/arp.c 2011-02-04 14:37:11.000000000 +0100 +@@ -557,7 +557,7 @@ static int arp_show(char *name) + /* Read the ARP cache entries. */ + for (num = 0; num < entries; num++) { + fgets(line, sizeof(line), fp); +- if (sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n", ++ if (sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n", + ip, &type, &flags, hwa, mask, dev) < 4) + break; + +diff -up net-tools-1.60/lib/inet6_gr.c.scanf-format net-tools-1.60/lib/inet6_gr.c +--- net-tools-1.60/lib/inet6_gr.c.scanf-format 2011-02-04 14:37:11.000000000 +0100 ++++ net-tools-1.60/lib/inet6_gr.c 2011-02-04 14:39:54.000000000 +0100 +@@ -78,7 +78,7 @@ int rprint_fib6(int ext, int numeric) + "Flags Metric Ref Use Iface\n")); + + while (fgets(buff, 1023, fp)) { +- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n", ++ num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %15s\n", + addr6p[0], addr6p[1], addr6p[2], addr6p[3], + addr6p[4], addr6p[5], addr6p[6], addr6p[7], + &prefix_len, +diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c +--- net-tools-1.60/lib/inet_gr.c.scanf-format 2000-10-28 12:59:42.000000000 +0200 ++++ net-tools-1.60/lib/inet_gr.c 2011-02-04 14:55:41.000000000 +0100 +@@ -68,19 +68,19 @@ int rprint_fib(int ext, int numeric) + mss = 0; + + fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp, +- "Iface", "%16s", +- "Destination", "%128s", +- "Gateway", "%128s", ++ "Iface", "%15s", ++ "Destination", "%127s", ++ "Gateway", "%127s", + "Flags", "%X", + "RefCnt", "%d", + "Use", "%d", + "Metric", "%d", +- "Mask", "%128s", ++ "Mask", "%127s", + "MTU", "%d", + "Window", "%d", + "IRTT", "%d", + NULL); +- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d\n" */ ++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */ + + if (!fmt) + return 1; +@@ -268,21 +268,21 @@ int rprint_cache(int ext, int numeric) + "MSS Window irtt HH Arp\n")); + + fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, +- "Iface", "%16s", +- "Destination", "%128s", +- "Gateway", "%128s", ++ "Iface", "%15s", ++ "Destination", "%127s", ++ "Gateway", "%127s", + "Flags", "%X", + "RefCnt", "%d", + "Use", "%d", + "Metric", "%d", +- "Source", "%128s", ++ "Source", "%127s", + "MTU", "%d", + "Window", "%d", + "IRTT", "%d", + "HH", "%d", + "ARP", "%d", + NULL); +- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */ ++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */ + } + + if (format == 2) { +@@ -291,23 +291,23 @@ int rprint_cache(int ext, int numeric) + "Flags Metric Ref Use Iface " + "MSS Window irtt TOS HHRef HHUptod SpecDst\n")); + fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, +- "Iface", "%16s", +- "Destination", "%128s", +- "Gateway", "%128s", ++ "Iface", "%15s", ++ "Destination", "%127s", ++ "Gateway", "%127s", + "Flags", "%X", + "RefCnt", "%d", + "Use", "%d", + "Metric", "%d", +- "Source", "%128s", ++ "Source", "%127s", + "MTU", "%d", + "Window", "%d", + "IRTT", "%d", + "TOS", "%d", + "HHRef", "%d", + "HHUptod", "%d", +- "SpecDst", "%128s", ++ "SpecDst", "%127s", + NULL); +- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d %128s\n" */ ++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */ + } + + +diff -up net-tools-1.60/lib/interface.c.scanf-format net-tools-1.60/lib/interface.c +--- net-tools-1.60/lib/interface.c.scanf-format 2011-02-04 14:37:11.000000000 +0100 ++++ net-tools-1.60/lib/interface.c 2011-02-04 14:37:11.000000000 +0100 +@@ -713,7 +713,7 @@ void ife_print_long(struct interface *pt + #endif + #if HAVE_AFINET6 + FILE *f; +- char addr6[40], devname[20]; ++ char addr6[40], devname[21]; + struct sockaddr_in6 sap; + int plen, scope, dad_status, if_idx; + extern struct aftype inet6_aftype; +diff -up net-tools-1.60/netstat.c.scanf-format net-tools-1.60/netstat.c +--- net-tools-1.60/netstat.c.scanf-format 2011-02-04 14:37:11.000000000 +0100 ++++ net-tools-1.60/netstat.c 2011-02-04 14:37:11.000000000 +0100 +@@ -1103,7 +1103,7 @@ static void udp_do_one(int lnr, const ch + + more[0] = '\0'; + num = sscanf(line, +- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n", ++ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n", + &d, local_addr, &local_port, + rem_addr, &rem_port, &state, + &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); +@@ -1536,7 +1536,7 @@ static void raw_do_one(int lnr, const ch + + more[0] = '\0'; + num = sscanf(line, +- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n", ++ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n", + &d, local_addr, &local_port, rem_addr, &rem_port, &state, + &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); + diff --git a/net-tools-1.60-slattach-fchown.patch b/net-tools-1.60-slattach-fchown.patch new file mode 100644 index 0000000..50edf85 --- /dev/null +++ b/net-tools-1.60-slattach-fchown.patch @@ -0,0 +1,24 @@ +diff -up net-tools-1.60/slattach.c.slattach-fchown net-tools-1.60/slattach.c +--- net-tools-1.60/slattach.c.slattach-fchown 2000-10-28 12:59:41.000000000 +0200 ++++ net-tools-1.60/slattach.c 2009-09-15 18:17:01.000000000 +0200 +@@ -195,15 +195,17 @@ tty_lock(char *path, int mode) + return(-1); + } + +- (void) close(fd); +- + /* Make sure UUCP owns the lockfile. Required by some packages. */ + if ((pw = getpwnam(_UID_UUCP)) == NULL) { + if (opt_q == 0) fprintf(stderr, _("slattach: tty_lock: UUCP user %s unknown!\n"), + _UID_UUCP); ++ (void) close(fd); + return(0); /* keep the lock anyway */ + } +- (void) chown(saved_path, pw->pw_uid, pw->pw_gid); ++ (void) fchown(fd, pw->pw_uid, pw->pw_gid); ++ ++ (void) close(fd); ++ + saved_lock = 1; + } else { /* unlock */ + if (saved_lock != 1) return(0); diff --git a/net-tools-1.60-upstream.patch b/net-tools-1.60-upstream.patch deleted file mode 100644 index d06d911..0000000 --- a/net-tools-1.60-upstream.patch +++ /dev/null @@ -1,516 +0,0 @@ -diff -up net-tools-1.60/arp.c.upstream net-tools-1.60/arp.c ---- net-tools-1.60/arp.c.upstream 2011-10-19 18:38:24.995394688 +0200 -+++ net-tools-1.60/arp.c 2011-10-19 18:38:25.023394339 +0200 -@@ -557,7 +557,7 @@ static int arp_show(char *name) - /* Read the ARP cache entries. */ - for (num = 0; num < entries; num++) { - fgets(line, sizeof(line), fp); -- if (sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n", -+ if (sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n", - ip, &type, &flags, hwa, mask, dev) < 4) - break; - -diff -up net-tools-1.60/ifconfig.c.upstream net-tools-1.60/ifconfig.c ---- net-tools-1.60/ifconfig.c.upstream 2011-10-19 18:38:25.000000000 +0200 -+++ net-tools-1.60/ifconfig.c 2011-10-19 18:50:49.327089262 +0200 -@@ -51,7 +51,7 @@ - #include - - --#ifdef HAVE_HWSLIP -+#if HAVE_HWSLIP - #include - #endif - -@@ -784,7 +784,7 @@ int main(int argc, char **argv) - continue; - } - #endif --#ifdef HAVE_AFINET -+#if HAVE_AFINET - { /* ipv4 address a.b.c.d */ - unsigned long ip, nm, bc; - safe_strncpy(host, *spp, (sizeof host)); -@@ -875,7 +875,7 @@ int main(int argc, char **argv) - continue; - } - #endif --#ifdef HAVE_AFINET -+#if HAVE_AFINET - { - /* ipv4 address a.b.c.d */ - unsigned long ip, nm, bc; -diff -up net-tools-1.60/lib/inet6_gr.c.upstream net-tools-1.60/lib/inet6_gr.c ---- net-tools-1.60/lib/inet6_gr.c.upstream 2011-10-19 18:38:24.788397275 +0200 -+++ net-tools-1.60/lib/inet6_gr.c 2011-10-19 18:38:25.023394339 +0200 -@@ -78,7 +78,7 @@ int rprint_fib6(int ext, int numeric) - "Flags Metric Ref Use Iface\n")); - - while (fgets(buff, 1023, fp)) { -- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n", -+ num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %15s\n", - addr6p[0], addr6p[1], addr6p[2], addr6p[3], - addr6p[4], addr6p[5], addr6p[6], addr6p[7], - &prefix_len, -diff -up net-tools-1.60/lib/inet_gr.c.upstream net-tools-1.60/lib/inet_gr.c ---- net-tools-1.60/lib/inet_gr.c.upstream 2000-10-28 12:59:42.000000000 +0200 -+++ net-tools-1.60/lib/inet_gr.c 2011-10-19 18:38:25.024394326 +0200 -@@ -68,19 +68,19 @@ int rprint_fib(int ext, int numeric) - mss = 0; - - fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp, -- "Iface", "%16s", -- "Destination", "%128s", -- "Gateway", "%128s", -+ "Iface", "%15s", -+ "Destination", "%127s", -+ "Gateway", "%127s", - "Flags", "%X", - "RefCnt", "%d", - "Use", "%d", - "Metric", "%d", -- "Mask", "%128s", -+ "Mask", "%127s", - "MTU", "%d", - "Window", "%d", - "IRTT", "%d", - NULL); -- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d\n" */ -+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */ - - if (!fmt) - return 1; -@@ -268,21 +268,21 @@ int rprint_cache(int ext, int numeric) - "MSS Window irtt HH Arp\n")); - - fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, -- "Iface", "%16s", -- "Destination", "%128s", -- "Gateway", "%128s", -+ "Iface", "%15s", -+ "Destination", "%127s", -+ "Gateway", "%127s", - "Flags", "%X", - "RefCnt", "%d", - "Use", "%d", - "Metric", "%d", -- "Source", "%128s", -+ "Source", "%127s", - "MTU", "%d", - "Window", "%d", - "IRTT", "%d", - "HH", "%d", - "ARP", "%d", - NULL); -- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */ -+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */ - } - - if (format == 2) { -@@ -291,23 +291,23 @@ int rprint_cache(int ext, int numeric) - "Flags Metric Ref Use Iface " - "MSS Window irtt TOS HHRef HHUptod SpecDst\n")); - fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, -- "Iface", "%16s", -- "Destination", "%128s", -- "Gateway", "%128s", -+ "Iface", "%15s", -+ "Destination", "%127s", -+ "Gateway", "%127s", - "Flags", "%X", - "RefCnt", "%d", - "Use", "%d", - "Metric", "%d", -- "Source", "%128s", -+ "Source", "%127s", - "MTU", "%d", - "Window", "%d", - "IRTT", "%d", - "TOS", "%d", - "HHRef", "%d", - "HHUptod", "%d", -- "SpecDst", "%128s", -+ "SpecDst", "%127s", - NULL); -- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d %128s\n" */ -+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */ - } - - -diff -up net-tools-1.60/lib/interface.c.upstream net-tools-1.60/lib/interface.c ---- net-tools-1.60/lib/interface.c.upstream 2011-10-19 18:38:24.982394852 +0200 -+++ net-tools-1.60/lib/interface.c 2011-10-19 18:50:49.328089249 +0200 -@@ -36,7 +36,7 @@ - #include - #endif - --#ifdef HAVE_HWSLIP -+#if HAVE_HWSLIP - #include - #include - #endif -@@ -482,7 +482,7 @@ int if_fetch(struct interface *ife) - else - ife->mtu = ifr.ifr_mtu; - --#ifdef HAVE_HWSLIP -+#if HAVE_HWSLIP - if (ife->type == ARPHRD_SLIP || ife->type == ARPHRD_CSLIP || - ife->type == ARPHRD_SLIP6 || ife->type == ARPHRD_CSLIP6 || - ife->type == ARPHRD_ADAPT) { -@@ -491,14 +491,14 @@ int if_fetch(struct interface *ife) - if (ioctl(skfd, SIOCGOUTFILL, &ifr) < 0) - ife->outfill = 0; - else -- ife->outfill = (unsigned int) ifr.ifr_data; -+ ife->outfill = (unsigned long) ifr.ifr_data; - #endif - #ifdef SIOCGKEEPALIVE - strcpy(ifr.ifr_name, ifname); - if (ioctl(skfd, SIOCGKEEPALIVE, &ifr) < 0) - ife->keepalive = 0; - else -- ife->keepalive = (unsigned int) ifr.ifr_data; -+ ife->keepalive = (unsigned long) ifr.ifr_data; - #endif - } - #endif -@@ -713,7 +713,7 @@ void ife_print_long(struct interface *pt - #endif - #if HAVE_AFINET6 - FILE *f; -- char addr6[40], devname[20]; -+ char addr6[40], devname[21]; - struct sockaddr_in6 sap; - int plen, scope, dad_status, if_idx; - extern struct aftype inet6_aftype; -@@ -726,8 +726,10 @@ void ife_print_long(struct interface *pt - - hf = ptr->type; - -+#if HAVE_HWSLIP - if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6) - can_compress = 1; -+#endif - - hw = get_hwntype(hf); - if (hw == NULL) -@@ -766,7 +768,7 @@ void ife_print_long(struct interface *pt - /* FIXME: should be integrated into interface.c. */ - - if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) { -- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", -+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n", - addr6p[0], addr6p[1], addr6p[2], addr6p[3], - addr6p[4], addr6p[5], addr6p[6], addr6p[7], - &if_idx, &plen, &scope, &dad_status, devname) != EOF) { -diff -up net-tools-1.60/lib/Makefile.upstream net-tools-1.60/lib/Makefile ---- net-tools-1.60/lib/Makefile.upstream 2011-10-19 18:38:24.864396327 +0200 -+++ net-tools-1.60/lib/Makefile 2011-10-19 18:44:50.511575073 +0200 -@@ -36,7 +36,7 @@ OBJS = $(sort $(VARIA) $(AFOBJS) $(HWOBJ - - # This can be overwritten by the TOPLEVEL Makefile - TOPDIR=.. --CFLAGS += -I$(TOPDIR) -idirafter $(TOPDIR)/include # -fPIC -+CFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include # -fPIC - SONAME=libnet-tools.so.0 - - .SUFFIXES: .a .so -diff -up net-tools-1.60/lib/masq_info.c.upstream net-tools-1.60/lib/masq_info.c ---- net-tools-1.60/lib/masq_info.c.upstream 2000-10-28 12:59:42.000000000 +0200 -+++ net-tools-1.60/lib/masq_info.c 2011-10-19 18:42:06.663623453 +0200 -@@ -119,7 +119,9 @@ static int read_masqinfo(FILE * f, struc - ms->src.sin_family = AF_INET; - ms->dst.sin_family = AF_INET; - -- if (strcmp("TCP", buf) == 0) -+ if (strcmp("IP", buf) == 0) -+ ms->proto = "ip"; -+ else if (strcmp("TCP", buf) == 0) - ms->proto = "tcp"; - else if (strcmp("UDP", buf) == 0) - ms->proto = "udp"; -diff -up net-tools-1.60/lib/net-support.h.upstream net-tools-1.60/lib/net-support.h ---- net-tools-1.60/lib/net-support.h.upstream 2000-10-28 12:59:42.000000000 +0200 -+++ net-tools-1.60/lib/net-support.h 2011-10-19 18:50:49.422088074 +0200 -@@ -234,7 +234,7 @@ extern char afname[]; - /* this is a 2.0.36 flag from /usr/src/linux/include/linux/route.h */ - #define RTF_NOTCACHED 0x0400 /* this route isn't cached */ - --#ifdef HAVE_AFECONET -+#if HAVE_AFECONET - #ifndef AF_ECONET - #define AF_ECONET 19 /* Acorn Econet */ - #endif -diff -up net-tools-1.60/lib/rose.c.upstream net-tools-1.60/lib/rose.c ---- net-tools-1.60/lib/rose.c.upstream 2000-03-05 12:26:03.000000000 +0100 -+++ net-tools-1.60/lib/rose.c 2011-10-19 18:40:22.871921029 +0200 -@@ -86,7 +86,7 @@ static int ROSE_input(int type, char *bu - if (strlen(bufp) != 10) { - strcpy(ROSE_errmsg, _("Node address must be ten digits")); - #ifdef DEBUG -- fprintf(stderr, "rose_input(%s): %s !\n", ROSE_errmsg, orig); -+ fprintf(stderr, "rose_input(%s): %s !\n", bufp, ROSE_errmsg); - #endif - errno = EINVAL; - return (-1); -@@ -99,7 +99,7 @@ static int ROSE_input(int type, char *bu - - /* All done. */ - #ifdef DEBUG -- fprintf(stderr, "rose_input(%s): ", orig); -+ fprintf(stderr, "rose_input(%s): ", bufp); - for (i = 0; i < sizeof(rose_address); i++) - fprintf(stderr, "%02X ", sap->sa_data[i] & 0377); - fprintf(stderr, "\n"); -diff -up net-tools-1.60/lib/x25.c.upstream net-tools-1.60/lib/x25.c ---- net-tools-1.60/lib/x25.c.upstream 2000-05-20 20:53:25.000000000 +0200 -+++ net-tools-1.60/lib/x25.c 2011-10-19 18:40:22.871921029 +0200 -@@ -81,6 +81,7 @@ X25_input(int type, char *bufp, struct s - unsigned char *ptr; - char *p; - unsigned int sigdigits; -+ int i; - - sap->sa_family = x25_aftype.af; - ptr = ((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr; -@@ -90,7 +91,7 @@ X25_input(int type, char *bufp, struct s - if (strlen(bufp)>18) { - strcpy(X25_errmsg, _("Address can't exceed eighteen digits with sigdigits")); - #ifdef DEBUG -- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig); -+ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg); - #endif - errno = EINVAL; - return(-1); -@@ -108,7 +109,7 @@ X25_input(int type, char *bufp, struct s - *p = '/'; - strcpy(X25_errmsg, _("Invalid address")); - #ifdef DEBUG -- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig); -+ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg); - #endif - errno = EINVAL; - return(-1); -@@ -118,8 +119,8 @@ X25_input(int type, char *bufp, struct s - - /* All done. */ - #ifdef DEBUG -- fprintf(stderr, "x25_input(%s): ", orig); -- for (i = 0; i < sizeof(x25_address); i++) -+ fprintf(stderr, "x25_input(%s): ", bufp); -+ for (i = 0; i < sizeof(sap->sa_data); i++) - fprintf(stderr, "%02X ", sap->sa_data[i] & 0377); - fprintf(stderr, "\n"); - #endif -diff -up net-tools-1.60/Makefile.upstream net-tools-1.60/Makefile ---- net-tools-1.60/Makefile.upstream 2011-10-19 18:38:24.895395939 +0200 -+++ net-tools-1.60/Makefile 2011-10-19 18:44:50.512575060 +0200 -@@ -88,10 +88,9 @@ endif - - # Compiler and Linker Options - # You may need to uncomment and edit these if you are using libc5 and IPv6. --COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include --ifeq ($(origin LOPTS), undefined) --LOPTS = --endif -+CFLAGS ?= -O2 -g -+CFLAGS += -fno-strict-aliasing # code needs a lot of work before strict aliasing is safe -+CPPFLAGS += -D_GNU_SOURCE - RESLIB = # -L/usr/inet6/lib -linet6 - - ifeq ($(HAVE_AFDECnet),1) -@@ -119,8 +118,9 @@ CFLAGS += -DHAVE_SELINUX - else - endif - --CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH) --LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH) -+CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH) -+LDFLAGS += -L$(NET_LIB_PATH) -+ - - SUBDIRS = man/ $(NET_LIB_PATH)/ - -@@ -131,8 +131,6 @@ LD = $(CC) - - NLIB = -l$(NET_LIB_NAME) - --MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)' -- - %.o: %.c config.h version.h intl.h net-features.h $< - $(CC) $(CFLAGS) -c $< - -@@ -181,14 +179,15 @@ $(NET_LIB): config.h version.h intl.h li - - i18n.h: i18ndir - --libdir: -- @$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES) -+libdir: version.h -+ @$(MAKE) -C $(NET_LIB_PATH) - - i18ndir: - @$(MAKE) -C po - - subdirs: -- @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done -+ @for i in $(SUBDIRS); do $(MAKE) -C $$i || exit $$? ; done -+ - - ifconfig: $(NET_LIB) ifconfig.o - $(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB) -diff -up net-tools-1.60/netstat.c.upstream net-tools-1.60/netstat.c ---- net-tools-1.60/netstat.c.upstream 2011-10-19 18:38:25.021394364 +0200 -+++ net-tools-1.60/netstat.c 2011-10-19 18:52:06.264127416 +0200 -@@ -357,6 +357,12 @@ static void prg_cache_clear(void) - prg_cache_loaded=0; - } - -+static void wait_continous(const int reptimer) -+{ -+ fflush(stdout); -+ sleep(reptimer); -+} -+ - static void extract_type_1_socket_inode(const char lname[], unsigned long * inode_p, int * status) { - - /* If lname is of the form "socket:[12345]", extract the "12345" -@@ -407,7 +413,7 @@ static void prg_cache_load(void) - { - char line[LINE_MAX],eacces=0; - int procfdlen,fd,cmdllen,lnamelen; -- char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH]; -+ char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH],*cmdlpend; - unsigned long inode; - const char *cs,*cmdlp; - DIR *dirproc=NULL,*dirfd=NULL; -@@ -478,10 +484,12 @@ static void prg_cache_load(void) - continue; - if (cmdllen < sizeof(cmdlbuf) - 1) - cmdlbuf[cmdllen]='\0'; -- if ((cmdlp = strrchr(cmdlbuf, '/'))) -+ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/'))) - cmdlp++; - else - cmdlp = cmdlbuf; -+ if ((cmdlpend = strrchr(cmdlp, ':')) != NULL) -+ *cmdlpend = '\0'; - } - - snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp); -@@ -961,6 +969,10 @@ static void tcp_do_one(int lnr, const ch - &d, local_addr, &local_port, rem_addr, &rem_port, &state, - &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); - -+ if (!flag_all && -+ ((flag_lst && rem_port) || (!flag_lst && !rem_port))) -+ return; -+ - if (strlen(local_addr) > 8) { - #if HAVE_AFINET6 - /* Demangle what the kernel gives us */ -@@ -1014,7 +1026,7 @@ static void tcp_do_one(int lnr, const ch - flag_not & FLAG_NUM_HOST), sizeof(local_addr)); - safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST), - sizeof(rem_addr)); -- if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) { -+ - snprintf(buffer, sizeof(buffer), "%s", - get_sname(htons(local_port), "tcp", - flag_not & FLAG_NUM_PORT)); -@@ -1073,7 +1085,6 @@ static void tcp_do_one(int lnr, const ch - rxq, txq, local_addr, rem_addr, _(tcp_state[state])); - - finish_this_one(uid,inode,timers); -- } - } - - static int tcp_info(void) -@@ -1103,7 +1114,7 @@ static void udp_do_one(int lnr, const ch - - more[0] = '\0'; - num = sscanf(line, -- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n", -+ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n", - &d, local_addr, &local_port, - rem_addr, &rem_port, &state, - &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); -@@ -1540,7 +1551,7 @@ static void raw_do_one(int lnr, const ch - - more[0] = '\0'; - num = sscanf(line, -- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n", -+ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n", - &d, local_addr, &local_port, rem_addr, &rem_port, &state, - &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more); - -@@ -2288,7 +2299,7 @@ int main - flag_not & FLAG_NUM_PORT, flag_exp); - if (i || !flag_cnt) - break; -- sleep(reptimer); -+ wait_continous(reptimer); - } - #else - ENOSUPP("netstat.c", "FW_MASQUERADE"); -@@ -2304,7 +2315,7 @@ int main - - if(i || !flag_cnt) - break; -- sleep(reptimer); -+ wait_continous(reptimer); - } - return(i); - } -@@ -2328,7 +2339,7 @@ int main - i = route_info(afname, options); - if (i || !flag_cnt) - break; -- sleep(reptimer); -+ wait_continous(reptimer); - } - return (i); - } -@@ -2337,7 +2348,7 @@ int main - i = iface_info(); - if (!flag_cnt || i) - break; -- sleep(reptimer); -+ wait_continous(reptimer); - } - return (i); - } -@@ -2469,7 +2480,7 @@ int main - } - if (!flag_cnt || i) - break; -- sleep(reptimer); -+ wait_continous(reptimer); - prg_cache_clear(); - tcp_node_hash_clear(); - } -diff -up net-tools-1.60/slattach.c.upstream net-tools-1.60/slattach.c ---- net-tools-1.60/slattach.c.upstream 2000-10-28 12:59:41.000000000 +0200 -+++ net-tools-1.60/slattach.c 2011-10-19 18:45:41.367939279 +0200 -@@ -195,15 +195,17 @@ tty_lock(char *path, int mode) - return(-1); - } - -- (void) close(fd); -- - /* Make sure UUCP owns the lockfile. Required by some packages. */ - if ((pw = getpwnam(_UID_UUCP)) == NULL) { - if (opt_q == 0) fprintf(stderr, _("slattach: tty_lock: UUCP user %s unknown!\n"), - _UID_UUCP); -+ (void) close(fd); - return(0); /* keep the lock anyway */ - } -- (void) chown(saved_path, pw->pw_uid, pw->pw_gid); -+ (void) fchown(fd, pw->pw_uid, pw->pw_gid); -+ -+ (void) close(fd); -+ - saved_lock = 1; - } else { /* unlock */ - if (saved_lock != 1) return(0); diff --git a/net-tools.spec b/net-tools.spec index c3a1e30..cd51714 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -77,55 +77,76 @@ Patch67: net-tools-1.60-i-option.patch Patch69: net-tools-1.60-clear-flag.patch Patch71: net-tools-1.60-netstat-probe.patch -# This patch contains following upstream changes (ported from upstrem CVS/git): # scanf format length fix (non-exploitable) +Patch72: net-tools-1.60-scanf-format.patch + # netstat - avoid name resolution for listening or established sockets (-l) by return fast +Patch73: net-tools-1.60-avoid-name-resolution.patch + # netstat - --continuous should flush stdout +Patch74: net-tools-1.60-continous-flush-stdout.patch + # fix some errors so net-tools can be build with DEBUG defined -# handle raw "IP" masqinfo -# - touch up build system to respect normal toolchain env vars rather than requiring people to set random custom ones -# add missing dependency on version.h to libdir target to fix parallel build failures convert -idirafter to -I -# slattach: use fchown() rather than chown() to avoid race between creation and permission changing -# interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543) -# Fix the handling of some of the HAVE_* flags ifdef vs if. (BerliOS #17812) -# - patch netstat to separate basename of -p only if it is absolute -# path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0). -# interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways -Patch72: net-tools-1.60-upstream.patch +Patch75: net-tools-1.60-debug-fix.patch # let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address -Patch73: net-tools-1.60-ib-warning.patch +Patch76: net-tools-1.60-ib-warning.patch + +# handle raw "IP" masqinfo +Patch79: net-tools-1.60-masqinfo-raw-ip.patch + +# touch up build system to respect normal toolchain env vars rather than requiring people to set random custom ones +# add missing dependency on version.h to libdir target to fix parallel build failures +# convert -idirafter to -I +Patch80: net-tools-1.60-makefile-berlios.patch + +# slattach: use fchown() rather than chown() to avoid race between creation and permission changing +Patch81: net-tools-1.60-slattach-fchown.patch # Bug 531702: make "hostname -s" display host name cut at the first dot (no matter if the host name resolves or not) -Patch74: net-tools-1.60-hostname-short.patch +Patch82: net-tools-1.60-hostname-short.patch # use instead of "mii.h" and fix Bug #491358 -Patch75: net-tools-1.60-mii-refactor.patch +Patch83: net-tools-1.60-mii-refactor.patch # Bug 473211: ifconfig interface:0 del will remove the Aliased IP on IA64 -Patch76: net-tools-1.60-IA64.patch +# interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways +Patch84: net-tools-1.60-IA64.patch + +# interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543) +Patch85: net-tools-1.60-large-indexes.patch # netstat -s (statistics.c) now uses unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161) -Patch77: net-tools-1.60-statistics-doubleword.patch +Patch86: net-tools-1.60-statistics-doubleword.patch # update mii-tool to support gigabit links (#539575) -Patch78: net-tools-1.60-mii-gigabit.patch +Patch87: net-tools-1.60-mii-gigabit.patch # fix memory leak in netstat when run with -c option -Patch79: net-tools-1.60-netstat-leak.patch +Patch88: net-tools-1.60-netstat-leak.patch + +# HFI support +Patch89: net-tools-1.60-hfi.patch + +# Fix the handling of some of the HAVE_* flags ifdef vs if. (BerliOS #17812) +Patch90: net-tools-1.60-ifdef-vs-if.patch # Don't rely on eth0 being default network device name. # Since Fedora 15 network devices can have arbitrary names (#682367) -Patch80: net-tools-1.60-arbitrary-device-names.patch +Patch91: net-tools-1.60-arbitrary-device-names.patch # plipconfig man page and usage output fixes. (#694766) -Patch81: net-tools-1.60-plipconfig.patch +Patch92: net-tools-1.60-plipconfig.patch + +# patch netstat to separate basename of -p only if it is absolute +# path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0). +Patch93: net-tools-1.60-netstat-p-basename.patch # Possible problems found by static analysis of code. -Patch82: net-tools-1.60-coverity.patch +Patch94: net-tools-1.60-coverity.patch # Update for 2 digit Linux version numbers -Patch83: net-tools-1.60-2digit.patch +Patch95: net-tools-1.60-2digit.patch BuildRequires: gettext, libselinux BuildRequires: libselinux-devel @@ -199,19 +220,29 @@ Most of them are obsolete. For replacement check iproute package. %patch67 -p1 -b .i-option %patch69 -p1 -b .clear-flag %patch71 -p1 -b .probe -%patch72 -p1 -b .upstream -%patch73 -p1 -b .ib-warning -%patch74 -p1 -b .hostname-short -%patch75 -p1 -b .mii-refactor -%patch76 -p1 -b .IA64 -%patch77 -p1 -b .doubleword -%patch78 -p1 -b .mii-gigabit -%patch79 -p1 -b .netstat-leak -%patch80 -p1 -b .arbitrary-device-names -%patch81 -p1 -b .plipconfig -%patch82 -p1 -b .coverity -%patch83 -p1 -b .2digit +%patch72 -p1 -b .scanf-format +%patch73 -p1 -b .avoid-name-resolution +%patch74 -p1 -b .continous-flush-stdout +%patch75 -p1 -b .debug-fix +%patch76 -p1 -b .ib-warning +%patch79 -p1 -b .masqinfo-raw-ip +%patch80 -p1 -b .makefile-berlios +%patch81 -p1 -b .slattach-fchown +%patch82 -p1 -b .hostname-short +%patch83 -p1 -b .mii-refactor +%patch84 -p1 -b .IA64 +%patch85 -p1 -b .large-indexes +%patch86 -p1 -b .doubleword +%patch87 -p1 -b .mii-gigabit +%patch88 -p1 -b .netstat-leak +%patch89 -p1 -b .hfi +%patch90 -p1 -b .ifdef-vs-if +%patch91 -p1 -b .arbitrary-device-names +%patch92 -p1 -b .plipconfig +%patch93 -p1 -b .p-basename +%patch94 -p1 -b .coverity +%patch95 -p1 -b .2digit cp %SOURCE1 ./config.h cp %SOURCE2 ./config.make