[net-tools] removed 14 patches

Jiří Popelka jpopelka at fedoraproject.org
Thu Jan 5 12:44:01 UTC 2012


commit 3f720650b5b26604728b839cf81872e6d6f57ad6
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Thu Jan 5 13:41:31 2012 +0100

    removed 14 patches
    
    11 patches merged upstream
    removed bcast.patch (seems to be fixed upstream)
    removed netstat-p-basename.patch (upstream is not happy with it)
    netstat-leak.patch merged into duplicate-tcp.patch

 .gitignore                                 |    1 +
 ipmaddr.8                                  |    8 +-
 iptunnel.8                                 |    3 +-
 net-tools-1.60-IA64.patch                  |   13 -
 net-tools-1.60-arp_overflow.patch          |   11 -
 net-tools-1.60-bcast.patch                 |   86 -----
 net-tools-1.60-clear-flag.patch            |   39 ---
 net-tools-1.60-config.h                    |    1 +
 net-tools-1.60-config.make                 |    1 +
 net-tools-1.60-coverity.patch              |  245 ---------------
 net-tools-1.60-cycle.patch                 |   46 ++--
 net-tools-1.60-duplicate-tcp.patch         |   11 +-
 net-tools-1.60-interface_stack.patch       |   42 ++--
 net-tools-1.60-ipx.patch                   |    5 -
 net-tools-1.60-isofix.patch                |   33 --
 net-tools-1.60-mii-registers.patch         |    8 +-
 net-tools-1.60-nameif-return.patch         |   28 --
 net-tools-1.60-nameif_strncpy.patch        |   14 -
 net-tools-1.60-netstat-leak.patch          |   11 -
 net-tools-1.60-netstat-p-basename.patch    |   21 --
 net-tools-1.60-plipconfig.patch            |   55 ----
 net-tools-1.60-scanf-format.patch          |   69 ----
 net-tools-1.60-selinux.patch               |   54 ++--
 net-tools-1.60-statistics-doubleword.patch |  468 ----------------------------
 net-tools-1.60-x25-proc.patch              |   14 -
 net-tools.spec                             |  157 ++++------
 sources                                    |    2 +-
 27 files changed, 153 insertions(+), 1293 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b270b03..1de503c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 net-tools-1.60.tar.bz2
 /net-tools-1.60.20111206git.tar.gz
 /net-tools-1.60.20111207git.tar.xz
+/net-tools-1.60.20120105git.tar.xz
diff --git a/ipmaddr.8 b/ipmaddr.8
index d2b0046..52dd49c 100644
--- a/ipmaddr.8
+++ b/ipmaddr.8
@@ -1,5 +1,5 @@
 .\" Process this file with
-.\" groff -man -Tascii iptstate.8
+.\" groff -man -Tascii ipmaddr.8
 .\"
 .TH IPMADDR 8 "SEPTEMBER 2009" "" ""
 .\"
@@ -16,7 +16,7 @@
 
 .SH NOTE
 .P
-This program is obsolete. For replacement check \fBip maddress\fR.
+This program is obsolete. For replacement check \fBip maddr\fR.
 
 .SH DESCRIPTION
 The \fBipmaddr\fR command can perform one of the following operations:
@@ -25,10 +25,10 @@ The \fBipmaddr\fR command can perform one of the following operations:
 \- add a multicast address
 
 .B del
-- delete a multicast address
+\- delete a multicast address
 
 .B show
-- list multicast addresses
+\- list multicast addresses
 
 .SH SEE ALSO
 .BR ip (8).
diff --git a/iptunnel.8 b/iptunnel.8
index 2dacd40..3f5da84 100644
--- a/iptunnel.8
+++ b/iptunnel.8
@@ -1,12 +1,11 @@
 .\" Process this file with
-.\" groff -man -Tascii iptstate.8
+.\" groff -man -Tascii iptunnel.8
 .\"
 .TH IPTUNNEL 8 "SEPTEMBER 2009" "" ""
 .\"
 .\" Man page written by Jiri Popelka <jpopelka AT redhat DOT com>
 .\"
 .SH NAME
-
 .B iptunnel
 \- creates, deletes, and displays configured tunnels
 
diff --git a/net-tools-1.60-config.h b/net-tools-1.60-config.h
index 92ca6ba..a7a847c 100644
--- a/net-tools-1.60-config.h
+++ b/net-tools-1.60-config.h
@@ -38,6 +38,7 @@
 #define HAVE_AFECONET 1
 #define HAVE_AFDECnet 0
 #define HAVE_AFASH 1
+#define HAVE_AFBLUETOOTH 0
 
 /* 
  * 
diff --git a/net-tools-1.60-config.make b/net-tools-1.60-config.make
index c947b7c..255797c 100644
--- a/net-tools-1.60-config.make
+++ b/net-tools-1.60-config.make
@@ -11,6 +11,7 @@ HAVE_AFX25=1
 HAVE_AFECONET=1
 # HAVE_AFDECnet=0
 HAVE_AFASH=1
+# HAVE_AFBLUETOOTH=0
 HAVE_HWETHER=1
 HAVE_HWARC=1
 HAVE_HWSLIP=1
diff --git a/net-tools-1.60-cycle.patch b/net-tools-1.60-cycle.patch
index e29b339..e98490c 100644
--- a/net-tools-1.60-cycle.patch
+++ b/net-tools-1.60-cycle.patch
@@ -1,6 +1,6 @@
 diff -up net-tools-1.60/lib/interface.c.cycle net-tools-1.60/lib/interface.c
---- net-tools-1.60/lib/interface.c.cycle	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/lib/interface.c	2011-12-07 16:11:38.249768234 +0100
+--- net-tools-1.60/lib/interface.c.cycle	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/lib/interface.c	2012-01-05 12:46:55.872634104 +0100
 @@ -93,6 +93,7 @@ int if_list_all = 0;	/* do we have reque
  static struct interface *int_list, *int_last;
  
@@ -25,7 +25,7 @@ diff -up net-tools-1.60/lib/interface.c.cycle net-tools-1.60/lib/interface.c
  	if (err)
  	    return err;
      }
-@@ -376,6 +380,41 @@ static int if_readlist_proc(char *target
+@@ -378,6 +382,41 @@ static int if_readlist_proc(char *target
      fclose(fh);
      return err;
  }
@@ -68,8 +68,8 @@ diff -up net-tools-1.60/lib/interface.c.cycle net-tools-1.60/lib/interface.c
  int if_readlist(void) 
  { 
 diff -up net-tools-1.60/man/en_US/netstat.8.cycle net-tools-1.60/man/en_US/netstat.8
---- net-tools-1.60/man/en_US/netstat.8.cycle	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/man/en_US/netstat.8	2011-12-07 16:11:38.249768234 +0100
+--- net-tools-1.60/man/en_US/netstat.8.cycle	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/man/en_US/netstat.8	2012-01-05 12:46:55.873634091 +0100
 @@ -33,6 +33,7 @@ netstat \- Print network connections, ro
  .RB [ \-\-verbose | \-v ]
  .RB [ \-\-continuous | \-c]
@@ -129,9 +129,9 @@ diff -up net-tools-1.60/man/en_US/netstat.8.cycle net-tools-1.60/man/en_US/netst
  .SH OUTPUT
  .P
 diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
---- net-tools-1.60/netstat.c.cycle	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/netstat.c	2011-12-07 16:13:19.911497288 +0100
-@@ -106,9 +106,9 @@
+--- net-tools-1.60/netstat.c.cycle	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/netstat.c	2012-01-05 12:49:42.611549580 +0100
+@@ -110,9 +110,9 @@
  #endif
  
  /* prototypes for statistics.c */
@@ -143,7 +143,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  void inittab6(void);
  
  typedef enum {
-@@ -302,10 +302,10 @@ static void prg_cache_clear(void)
+@@ -308,10 +308,10 @@ static void prg_cache_clear(void)
      prg_cache_loaded=0;
  }
  
@@ -156,7 +156,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  }
  
  static int extract_type_1_socket_inode(const char lname[], unsigned long * inode_p) {
-@@ -1610,6 +1610,8 @@ static int ipx_info(void)
+@@ -1734,6 +1734,8 @@ static int rfcomm_info(void)
  
  static int iface_info(void)
  {
@@ -165,7 +165,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      if (skfd < 0) {
  	if ((skfd = sockets_open(0)) < 0) {
  	    perror("socket");
-@@ -1619,20 +1621,21 @@ static int iface_info(void)
+@@ -1743,20 +1745,21 @@ static int iface_info(void)
      }
      if (flag_exp < 2) {
  	ife_short = 1;
@@ -190,7 +190,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      return 0;
  }
  
-@@ -1648,7 +1651,7 @@ static void usage(void)
+@@ -1772,7 +1775,7 @@ static void usage(void)
  {
      fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}\n"));
      fprintf(stderr, _("       netstat [-vWnNcaeol] [<Socket> ...]\n"));
@@ -199,7 +199,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  
      fprintf(stderr, _("        -r, --route              display routing table\n"));
      fprintf(stderr, _("        -i, --interfaces         display interface table\n"));
-@@ -1685,6 +1688,7 @@ int main
+@@ -1809,6 +1812,7 @@ int main
   (int argc, char *argv[]) {
      int i;
      int lop;
@@ -207,7 +207,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      static struct option longopts[] =
      {
  	AFTRANS_OPTS,
-@@ -1844,6 +1848,12 @@ int main
+@@ -1976,6 +1980,12 @@ int main
  	    flag_sta++;
  	}
  
@@ -220,7 +220,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      if (flag_int + flag_rou + flag_mas + flag_sta > 1)
  	usage();
  
-@@ -1869,7 +1879,7 @@ int main
+@@ -2005,7 +2015,7 @@ int main
  			     flag_not & FLAG_NUM_PORT, flag_exp);
  	    if (i || !flag_cnt)
  		break;
@@ -229,7 +229,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  	}
  #else
  	ENOSUPP("netstat", "FW_MASQUERADE");
-@@ -1881,18 +1891,18 @@ int main
+@@ -2017,18 +2027,18 @@ int main
      if (flag_sta) {
          if (!afname[0])
              strcpy(afname, DFLT_AF);
@@ -251,7 +251,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  #else
              ENOSUPP("netstat", "AF INET6");
  #endif
-@@ -1900,7 +1910,11 @@ int main
+@@ -2036,7 +2046,11 @@ int main
            printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
            exit(1);
          }
@@ -264,7 +264,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      }
      
      if (flag_rou) {
-@@ -1922,7 +1936,7 @@ int main
+@@ -2058,7 +2072,7 @@ int main
  	    i = route_info(afname, options);
  	    if (i || !flag_cnt)
  		break;
@@ -273,7 +273,7 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  	}
  	return (i);
      }
-@@ -1931,7 +1945,7 @@ int main
+@@ -2067,7 +2081,7 @@ int main
  	    i = iface_info();
  	    if (!flag_cnt || i)
  		break;
@@ -282,8 +282,8 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
  	}
  	return (i);
      }
-@@ -2084,7 +2098,7 @@ int main
- 	            
+@@ -2253,7 +2267,7 @@ int main
+ 
  	if (!flag_cnt || i)
  	    break;
 -        wait_continous();
@@ -292,8 +292,8 @@ diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
      }
      return (i);
 diff -up net-tools-1.60/statistics.c.cycle net-tools-1.60/statistics.c
---- net-tools-1.60/statistics.c.cycle	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/statistics.c	2011-12-07 16:11:38.352766947 +0100
+--- net-tools-1.60/statistics.c.cycle	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/statistics.c	2012-01-05 12:46:55.877634040 +0100
 @@ -502,7 +502,7 @@ void process6_fd(FILE *f)
  
  }
diff --git a/net-tools-1.60-duplicate-tcp.patch b/net-tools-1.60-duplicate-tcp.patch
index 1014dd9..99769b4 100644
--- a/net-tools-1.60-duplicate-tcp.patch
+++ b/net-tools-1.60-duplicate-tcp.patch
@@ -1,7 +1,7 @@
 diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
---- net-tools-1.60/netstat.c.dup-tcp	2011-12-02 16:24:08.479720425 +0100
-+++ net-tools-1.60/netstat.c	2011-12-02 16:33:51.668429563 +0100
-@@ -449,6 +449,120 @@ static void prg_cache_load(void)
+--- net-tools-1.60/netstat.c.dup-tcp	2011-12-07 19:17:24.162425150 +0100
++++ net-tools-1.60/netstat.c	2011-12-07 19:18:02.161950091 +0100
+@@ -449,6 +449,121 @@ static void prg_cache_load(void)
  			 " will not be shown, you would have to be root to see it all.)\n"));
  }
  
@@ -43,6 +43,7 @@ diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
 +      }
 +
 +      /* free the bucket itself */
++      free(tcp_node_hash[i]->socket_pair);
 +      free(tcp_node_hash[i]);
 +      tcp_node_hash[i] = NULL;
 +    }
@@ -122,7 +123,7 @@ diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
  #if HAVE_AFNETROM
  static const char *netrom_state[] =
  {
-@@ -960,6 +1074,12 @@ static void tcp_do_one(int lnr, const ch
+@@ -960,6 +1075,12 @@ static void tcp_do_one(int lnr, const ch
  	return;
      }
  
@@ -135,7 +136,7 @@ diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
  	addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "tcp");
  	addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "tcp");
  
-@@ -2112,6 +2232,7 @@ int main
+@@ -2114,6 +2235,7 @@ int main
  	    break;
          wait_continous(reptimer);
  	prg_cache_clear();
diff --git a/net-tools-1.60-interface_stack.patch b/net-tools-1.60-interface_stack.patch
index 87aeb51..5927e58 100644
--- a/net-tools-1.60-interface_stack.patch
+++ b/net-tools-1.60-interface_stack.patch
@@ -1,6 +1,6 @@
 diff -up net-tools-1.60/include/interface.h.stack net-tools-1.60/include/interface.h
---- net-tools-1.60/include/interface.h.stack	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/include/interface.h	2011-12-06 16:14:06.477785871 +0100
+--- net-tools-1.60/include/interface.h.stack	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/include/interface.h	2012-01-05 13:00:10.564699085 +0100
 @@ -73,7 +73,7 @@ extern int do_if_print(struct interface
  
  extern int    procnetdev_version(char *buf);
@@ -11,8 +11,8 @@ diff -up net-tools-1.60/include/interface.h.stack net-tools-1.60/include/interfa
  extern void ife_print(struct interface *ptr);
  
 diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
---- net-tools-1.60/lib/interface.c.stack	2011-12-06 16:12:32.515960556 +0100
-+++ net-tools-1.60/lib/interface.c	2011-12-06 16:12:32.520960494 +0100
+--- net-tools-1.60/lib/interface.c.stack	2012-01-05 13:00:10.561699123 +0100
++++ net-tools-1.60/lib/interface.c	2012-01-05 13:03:19.522336790 +0100
 @@ -214,10 +214,11 @@ out:
      return err;
  }
@@ -26,7 +26,7 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
      while (*p) {
  	if (isspace(*p))
  	    break;
-@@ -320,9 +321,10 @@ int get_dev_fields(char *bp, struct inte
+@@ -320,20 +321,22 @@ int get_dev_fields(char *bp, struct inte
  static int if_readlist_proc(char *target)
  {
      FILE *fh;
@@ -38,21 +38,24 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
  
      fh = fopen(_PATH_PROCNET_DEV, "r");
      if (!fh) {
-@@ -330,8 +332,11 @@ static int if_readlist_proc(char *target
+ 		fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
  			_PATH_PROCNET_DEV, strerror(errno)); 
  		return -2;
- 	}	
--    fgets(buf, sizeof buf, fh);	/* eat line */
--    fgets(buf, sizeof buf, fh);
+-	}	
+-    if (fgets(buf, sizeof buf, fh))
+-		/* eat line */;
+-    if (fgets(buf, sizeof buf, fh))
+-		/* eat line */;
++	}
 +    if (getline(&line, &linelen, fh) == -1 /* eat line */
-+	|| getline(&line, &linelen, fh) == -1) {
++	|| getline(&line, &linelen, fh) == -1) { /* eat line */
 +		err = -1;
 +		goto out;
-+    }
++	}
  
  #if 0				/* pretty, but can't cope with missing fields */
      fmt = proc_gen_fmt(_PATH_PROCNET_DEV, 1, fh,
-@@ -356,13 +361,13 @@ static int if_readlist_proc(char *target
+@@ -358,13 +361,13 @@ static int if_readlist_proc(char *target
      if (!fmt)
  	return -1;
  #else
@@ -70,7 +73,7 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
  	ife = if_cache_add(name);
  	get_dev_fields(s, ife);
  	ife->statistics_valid = 1;
-@@ -377,6 +382,8 @@ static int if_readlist_proc(char *target
+@@ -379,6 +382,8 @@ static int if_readlist_proc(char *target
  #if 0
      free(fmt);
  #endif
@@ -79,7 +82,7 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
      fclose(fh);
      return err;
  }
-@@ -384,8 +391,9 @@ static int if_readlist_proc(char *target
+@@ -386,24 +391,28 @@ static int if_readlist_proc(char *target
  static int if_readlist_rep(char *target, struct interface *ife)
  {
      FILE *fh;
@@ -90,17 +93,18 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
  
      fh = fopen(_PATH_PROCNET_DEV, "r");
      if (!fh) {
-@@ -393,15 +401,18 @@ static int if_readlist_rep(char *target,
+ 		fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
  			_PATH_PROCNET_DEV, strerror(errno)); 
  		return if_readconf();
- 	}	
+-	}	
 -    fgets(buf, sizeof buf, fh);	/* eat line */
 -    fgets(buf, sizeof buf, fh);
++	}
 +    if (getline(&line, &linelen, fh) == -1 /* eat line */
-+	|| getline(&line, &linelen, fh) == -1) {
++	|| getline(&line, &linelen, fh) == -1) { /* eat line */
 +		err = -1;
 +		goto out;
-+    }
++	}
  
 -    procnetdev_vsn = procnetdev_version(buf);
 +    procnetdev_vsn = procnetdev_version(line);
@@ -115,7 +119,7 @@ diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
  	get_dev_fields(s, ife);
  	if (target && !strcmp(target,name))
  	{
-@@ -414,6 +425,8 @@ static int if_readlist_rep(char *target,
+@@ -416,6 +425,8 @@ static int if_readlist_rep(char *target,
  	err = -1;
      }
  
diff --git a/net-tools-1.60-ipx.patch b/net-tools-1.60-ipx.patch
index bf132c0..6eb8f15 100644
--- a/net-tools-1.60-ipx.patch
+++ b/net-tools-1.60-ipx.patch
@@ -29,8 +29,3 @@ diff -up net-tools-1.60/netstat.c.ipx net-tools-1.60/netstat.c
  	    safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
  	    snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
  	} else
-diff -up net-tools-1.60/version.h.ipx net-tools-1.60/version.h
---- net-tools-1.60/version.h.ipx	2011-12-01 17:02:53.265805240 +0100
-+++ net-tools-1.60/version.h	2011-12-01 17:02:53.265805240 +0100
-@@ -0,0 +1 @@
-+#define RELEASE "net-tools 1.60"
diff --git a/net-tools-1.60-mii-registers.patch b/net-tools-1.60-mii-registers.patch
index 3045a40..398b327 100644
--- a/net-tools-1.60-mii-registers.patch
+++ b/net-tools-1.60-mii-registers.patch
@@ -1,6 +1,6 @@
 diff -up net-tools-1.60/mii-tool.c.mii-registers net-tools-1.60/mii-tool.c
---- net-tools-1.60/mii-tool.c.mii-registers	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/mii-tool.c	2011-12-07 17:37:35.810289854 +0100
+--- net-tools-1.60/mii-tool.c.mii-registers	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/mii-tool.c	2012-01-05 13:14:54.462648840 +0100
 @@ -51,10 +51,12 @@ static char Version[] = "$Id: mii-tool.c
  #include <linux/if_arp.h>
  #include <linux/if_ether.h>
@@ -214,10 +214,10 @@ diff -up net-tools-1.60/mii-tool.c.mii-registers net-tools-1.60/mii-tool.c
 -	printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
 +	printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
  	printf("\n  capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
- 	printf("\n  advertising: %s", media_list(advert, lpa2 >> 2, 0));
+ 	printf("\n  advertising: %s", media_list(advert, bmcr2, 0));
 -	if (lkpar & MII_AN_ABILITY_MASK)
 +	if (lkpar & LPA_ABILITY_MASK)
- 	    printf("\n  link partner:%s", media_list(lkpar, bmcr2, 0));
+ 	    printf("\n  link partner:%s", media_list(lkpar, lpa2 >> 2, 0));
  	printf("\n");
      }
 @@ -340,7 +370,7 @@ int show_basic_mii(int sock, int phy_id)
diff --git a/net-tools-1.60-selinux.patch b/net-tools-1.60-selinux.patch
index 1b08d30..8814302 100644
--- a/net-tools-1.60-selinux.patch
+++ b/net-tools-1.60-selinux.patch
@@ -1,14 +1,14 @@
 diff -up net-tools-1.60/config.in.selinux net-tools-1.60/config.in
---- net-tools-1.60/config.in.selinux	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/config.in	2011-12-07 12:24:21.922245784 +0100
-@@ -91,3 +91,4 @@ bool 'InfiniBand hardware support' HAVE_
+--- net-tools-1.60/config.in.selinux	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/config.in	2012-01-05 13:04:45.359263680 +0100
+@@ -92,3 +92,4 @@ bool 'InfiniBand hardware support' HAVE_
  bool 'IP Masquerading support' HAVE_FW_MASQUERADE y
  bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS y
  bool 'Build mii-tool' HAVE_MII y
 +bool 'SELinux support' HAVE_SELINUX n
 diff -up net-tools-1.60/Makefile.selinux net-tools-1.60/Makefile
---- net-tools-1.60/Makefile.selinux	2011-11-21 02:31:57.000000000 +0100
-+++ net-tools-1.60/Makefile	2011-12-07 12:23:00.078268978 +0100
+--- net-tools-1.60/Makefile.selinux	2012-01-05 12:22:43.000000000 +0100
++++ net-tools-1.60/Makefile	2012-01-05 13:04:45.359263680 +0100
 @@ -114,6 +114,12 @@ endif
  
  NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
@@ -23,8 +23,8 @@ diff -up net-tools-1.60/Makefile.selinux net-tools-1.60/Makefile
  LDFLAGS  += -L$(NET_LIB_PATH)
  
 diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
---- net-tools-1.60/netstat.c.selinux	2011-12-07 12:23:00.040269453 +0100
-+++ net-tools-1.60/netstat.c	2011-12-07 12:23:00.079268965 +0100
+--- net-tools-1.60/netstat.c.selinux	2012-01-05 13:04:45.315264230 +0100
++++ net-tools-1.60/netstat.c	2012-01-05 13:05:42.368550965 +0100
 @@ -89,6 +89,11 @@
  #include <net/if.h>
  #include <dirent.h>
@@ -37,23 +37,23 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  #include "net-support.h"
  #include "pathnames.h"
  #include "version.h"
-@@ -100,6 +105,7 @@
- #include "proc.h"
+@@ -104,6 +109,7 @@
+ #endif
  
  #define PROGNAME_WIDTH 20
 +#define SELINUX_WIDTH 50
  
  #if !defined(s6_addr32) && defined(in6a_words)
  #define s6_addr32 in6a_words	/* libinet6			*/
-@@ -159,6 +165,7 @@ int flag_wide= 0;
- int flag_prg = 0;
- int flag_arg = 0;
+@@ -165,6 +171,7 @@ int flag_arg = 0;
  int flag_ver = 0;
+ int flag_l2cap = 0;
+ int flag_rfcomm = 0;
 +int flag_selinux = 0;
  
  FILE *procinfo;
  
-@@ -222,12 +229,17 @@ FILE *procinfo;
+@@ -228,12 +235,17 @@ FILE *procinfo;
  #define PROGNAME_WIDTH1(s) PROGNAME_WIDTH2(s)
  #define PROGNAME_WIDTH2(s) #s
  
@@ -71,7 +71,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  } *prg_hash[PRG_HASH_SIZE];
  
  static char prg_cache_loaded = 0;
-@@ -235,9 +247,12 @@ static char prg_cache_loaded = 0;
+@@ -241,9 +253,12 @@ static char prg_cache_loaded = 0;
  #define PRG_HASHIT(x) ((x) % PRG_HASH_SIZE)
  
  #define PROGNAME_BANNER "PID/Program name"
@@ -84,7 +84,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  #define PRG_LOCAL_ADDRESS "local_address"
  #define PRG_INODE	 "inode"
  #define PRG_SOCKET_PFX    "socket:["
-@@ -257,7 +272,7 @@ static char prg_cache_loaded = 0;
+@@ -263,7 +278,7 @@ static char prg_cache_loaded = 0;
  #define PATH_CMDLINE	"cmdline"
  #define PATH_CMDLINEl       strlen(PATH_CMDLINE)
  
@@ -93,7 +93,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  {
      unsigned hi = PRG_HASHIT(inode);
      struct prg_node **pnp,*pn;
-@@ -278,6 +293,14 @@ static void prg_cache_add(unsigned long
+@@ -284,6 +299,14 @@ static void prg_cache_add(unsigned long
      if (strlen(name)>sizeof(pn->name)-1) 
  	name[sizeof(pn->name)-1]='\0';
      strcpy(pn->name,name);
@@ -108,7 +108,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  }
  
  static const char *prg_cache_get(unsigned long inode)
-@@ -290,6 +313,16 @@ static const char *prg_cache_get(unsigne
+@@ -296,6 +319,16 @@ static const char *prg_cache_get(unsigne
      return("-");
  }
  
@@ -125,7 +125,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  static void prg_cache_clear(void)
  {
      struct prg_node **pnp,*pn;
-@@ -367,6 +400,7 @@ static void prg_cache_load(void)
+@@ -373,6 +406,7 @@ static void prg_cache_load(void)
      const char *cs,*cmdlp;
      DIR *dirproc=NULL,*dirfd=NULL;
      struct dirent *direproc,*direfd;
@@ -133,7 +133,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  
      if (prg_cache_loaded || !flag_prg) return;
      prg_cache_loaded=1;
-@@ -428,7 +462,15 @@ static void prg_cache_load(void)
+@@ -436,7 +470,15 @@ static void prg_cache_load(void)
  	    }
  
  	    snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp);
@@ -150,7 +150,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  	}
  	closedir(dirfd); 
  	dirfd = NULL;
-@@ -662,6 +704,9 @@ static void finish_this_one(int uid, uns
+@@ -672,6 +714,9 @@ static void finish_this_one(int uid, uns
      }
      if (flag_prg)
  	printf(" %-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
@@ -160,7 +160,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
      if (flag_opt)
  	printf(" %s", timers);
      putchar('\n');
-@@ -1484,7 +1529,9 @@ static void unix_do_one(int nr, const ch
+@@ -1495,7 +1540,9 @@ static void unix_do_one(int nr, const ch
  	printf("-       ");
      if (flag_prg)
  	printf(" %-" PROGNAME_WIDTHs "s",(has & HAS_INODE?prg_cache_get(inode):"-"));
@@ -171,7 +171,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
      printf(" %s\n", path);
  }
  
-@@ -1503,6 +1550,7 @@ static int unix_info(void)
+@@ -1514,6 +1561,7 @@ static int unix_info(void)
  
      printf(_("\nProto RefCnt Flags       Type       State         I-Node  "));
      print_progname_banner();
@@ -179,7 +179,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
      printf(_(" Path\n"));	/* xxx */
  
      {
-@@ -1802,6 +1850,7 @@ static void usage(void)
+@@ -1927,6 +1975,7 @@ static void usage(void)
      fprintf(stderr, _("        -o, --timers             display timers\n"));
      fprintf(stderr, _("        -F, --fib                display Forwarding Information Base (default)\n"));
      fprintf(stderr, _("        -C, --cache              display routing cache instead of FIB\n\n"));
@@ -187,7 +187,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  
      fprintf(stderr, _("  <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
      fprintf(stderr, _("  <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
-@@ -1850,6 +1899,7 @@ int main
+@@ -1977,6 +2026,7 @@ int main
  	{"cache", 0, 0, 'C'},
  	{"fib", 0, 0, 'F'},
  	{"groups", 0, 0, 'g'},
@@ -195,7 +195,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  	{NULL, 0, 0, 0}
      };
  
-@@ -1861,7 +1911,7 @@ int main
+@@ -1988,7 +2038,7 @@ int main
      getroute_init();		/* Set up AF routing support */
  
      afname[0] = '\0';
@@ -204,7 +204,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  	switch (i) {
  	case -1:
  	    break;
-@@ -1975,6 +2025,20 @@ int main
+@@ -2108,6 +2158,20 @@ int main
  	    if (aftrans_opt("unix"))
  		exit(1);
  	    break;
@@ -225,7 +225,7 @@ diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
  	case '?':
  	case 'h':
  	    usage();
-@@ -2101,6 +2165,7 @@ int main
+@@ -2238,6 +2302,7 @@ int main
  	    if (flag_exp > 1)
  		printf(_(" User       Inode     "));
  	    print_progname_banner();
diff --git a/net-tools.spec b/net-tools.spec
index 1ea879e..2f0a802 100644
--- a/net-tools.spec
+++ b/net-tools.spec
@@ -1,9 +1,9 @@
-%global checkout 20111207git
+%global checkout 20120105git
 
 Summary: Basic networking tools
 Name: net-tools
 Version: 1.60
-Release: 130.%{checkout}%{?dist}
+Release: 131.%{checkout}%{?dist}
 License: GPL+
 Group: System Environment/Base
 URL: http://net-tools.sourceforge.net
@@ -20,102 +20,60 @@ Source7: iptunnel.8
 Source8: ipmaddr.8
 Source9: arp-ethers.service
 
-# translation headers - content type format
-Patch1: net-tools-1.60-isofix.patch
-
 # adds <delay> option that allows netstat to cycle printing through statistics every delay seconds.
-Patch2: net-tools-1.60-cycle.patch
+Patch1: net-tools-1.60-cycle.patch
 
 # Fixed incorrect address display for ipx (#46434)
-Patch3: net-tools-1.60-ipx.patch
+Patch2: net-tools-1.60-ipx.patch
 
 # hostname lookup problems with route --inet6 (#84108)
-Patch4: net-tools-1.60-inet6-lookup.patch
+Patch3: net-tools-1.60-inet6-lookup.patch
 
 # various man page fixes merged into one patch
-Patch5: net-tools-1.60-man.patch
+Patch4: net-tools-1.60-man.patch
 
 # netstat: interface option now works as described in the man page (#61113, #115987)
-Patch6: net-tools-1.60-interface.patch
-
-# The return value of nameif was wrong (#129032) - patch from Fujitsu QA
-Patch7: net-tools-1.60-nameif-return.patch
-
-# netstat -s (statistics.c) now uses unsigned long long handle 64 bit integers (Bug #579854, Debian #561161) 
-Patch8: net-tools-1.60-statistics-doubleword.patch
-
-# calculate broadcast only when netmask provided (#60509)
-Patch9: net-tools-1.60-bcast.patch
+Patch5: net-tools-1.60-interface.patch
 
 # filter out duplicate tcp entries (#139407)
-Patch10: net-tools-1.60-duplicate-tcp.patch
+Patch6: net-tools-1.60-duplicate-tcp.patch
 
 # don't report statistics for virtual devices (#143981)
-Patch11: net-tools-1.60-statalias.patch
+Patch7: net-tools-1.60-statalias.patch
 
 # don't trim interface names to 5 characters in 'netstat -i' or 'ifconfig -s' (#152457)
-Patch12: net-tools-1.60-trim_iface.patch
-
-# buffer overflow in arp (#164695)
-Patch13: net-tools-1.60-arp_overflow.patch
+Patch8: net-tools-1.60-trim_iface.patch
 
 # clear static buffers in interface.c by Ulrich Drepper (#176714)
-Patch14: net-tools-1.60-interface_stack.patch
+Patch9: net-tools-1.60-interface_stack.patch
 
 # new option for nestat, -Z shows selinux context
-Patch15: net-tools-1.60-selinux.patch
+Patch10: net-tools-1.60-selinux.patch
 
 # remove duplicate arp entries (#185604)
-Patch16: net-tools-1.60-fgets.patch
-
-# wrong definition of _PATH_PROCNET_X25_ROUTE (#188786)
-Patch17: net-tools-1.60-x25-proc.patch
+Patch11: net-tools-1.60-fgets.patch
 
 # statistics for SCTP
-Patch18: net-tools-1.60-sctp-statistics.patch
+Patch12: net-tools-1.60-sctp-statistics.patch
 
 # ifconfig crash when interface name is too long (#190703)
-Patch19: net-tools-1.60-ifconfig-long-iface-crasher.patch
-
-# nameif crash for 16char long interface names (#209120)
-Patch20: net-tools-1.60-nameif_strncpy.patch
-
-# fixed clearing flags in ifconfig (#450252)
-Patch21: net-tools-1.60-clear-flag.patch
+Patch13: net-tools-1.60-ifconfig-long-iface-crasher.patch
 
 # fixed tcp timers info in netstat (#466845)
-Patch22: net-tools-1.60-netstat-probe.patch
-
-# prevent 'netstat -nr -A inet6' from smashing stack (#668047)
-Patch23: net-tools-1.60-scanf-format.patch
+Patch14: net-tools-1.60-netstat-probe.patch
 
 # let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address
-Patch24: net-tools-1.60-ib-warning.patch
+Patch15: net-tools-1.60-ib-warning.patch
 
 # use <linux/mii.h> instead of "mii.h" and fix Bug #491358
-Patch25: net-tools-1.60-mii-registers.patch
-
-# ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 (#473211)
-Patch26: net-tools-1.60-IA64.patch
-
-# fix memory leak in netstat when run with -c option
-Patch27: net-tools-1.60-netstat-leak.patch
+Patch16: net-tools-1.60-mii-registers.patch
 
 # Don't rely on eth0 being default network device name.
 # Since Fedora 15 network devices can have arbitrary names (#682367)
-Patch28: net-tools-1.60-arbitrary-device-names.patch
-
-# plipconfig man page and usage output fixes. (#694766)
-Patch29: net-tools-1.60-plipconfig.patch
-
-# netstat: remove part starting with colon in 'PID/Program name' column (#707427)
-Patch30: net-tools-1.60-netstat-p-basename.patch
-
-# Possible problems found by static analysis of code.
-Patch31: net-tools-1.60-coverity.patch
+Patch17: net-tools-1.60-arbitrary-device-names.patch
 
 # Update for 2 digit Linux version numbers (#718610)
-Patch32: net-tools-1.60-2digit.patch
+Patch18: net-tools-1.60-2digit.patch
 
 BuildRequires: gettext, libselinux
 BuildRequires: libselinux-devel
@@ -130,38 +88,24 @@ Most of them are obsolete. For replacement check iproute package.
 
 %prep
 %setup -q -c
-%patch1 -p1 -b .isofix
-%patch2 -p1 -b .cycle
-%patch3 -p1 -b .ipx
-%patch4 -p1 -b .inet6-lookup
-%patch5 -p1 -b .man
-%patch6 -p1 -b .interface
-%patch7 -p1 -b .return
-%patch8 -p1 -b .doubleword
-%patch9 -p1 -b .bcast
-%patch10 -p1 -b .dup-tcp
-%patch11 -p1 -b .statalias
-%patch12 -p1 -b .trim-iface
-%patch13 -p1 -b .overflow
-%patch14 -p1 -b .stack
-%patch15 -p1 -b .selinux
-%patch16 -p1 -b .fgets
-%patch17 -p1 -b .x25
-%patch18 -p1 -b .sctp
-%patch19 -p1 -b .long_iface
-%patch20 -p1 -b .strncpy
-%patch21 -p1 -b .clear-flag
-%patch22 -p1 -b .probe
-%patch23 -p1 -b .scanf-format
-%patch24 -p1 -b .ib-warning
-%patch25 -p1 -b .mii-registers
-%patch26 -p1 -b .IA64
-%patch27 -p1 -b .netstat-leak
-%patch28 -p1 -b .arbitrary-device-names
-%patch29 -p1 -b .plipconfig
-%patch30 -p1 -b .p-basename
-%patch31 -p1 -b .coverity
-%patch32 -p1 -b .2digit
+%patch1 -p1 -b .cycle
+%patch2 -p1 -b .ipx
+%patch3 -p1 -b .inet6-lookup
+%patch4 -p1 -b .man
+%patch5 -p1 -b .interface
+%patch6 -p1 -b .dup-tcp
+%patch7 -p1 -b .statalias
+%patch8 -p1 -b .trim-iface
+%patch9 -p1 -b .stack
+%patch10 -p1 -b .selinux
+%patch11 -p1 -b .fgets
+%patch12 -p1 -b .sctp
+%patch13 -p1 -b .long_iface
+%patch14 -p1 -b .probe
+%patch15 -p1 -b .ib-warning
+%patch16 -p1 -b .mii-registers
+%patch17 -p1 -b .arbitrary-device-names
+%patch18 -p1 -b .2digit
 
 cp %SOURCE1 ./config.h
 cp %SOURCE2 ./config.make
@@ -219,6 +163,11 @@ mv man/pt_BR man/pt
 
 make BASEDIR=%{buildroot} mandir=%{_mandir} install
 
+# ifconfig and route are installed into /bin by default
+# mv them back to /sbin for now as I (jpopelka) don't think customers would be happy
+mv %{buildroot}/bin/ifconfig %{buildroot}/sbin
+mv %{buildroot}/bin/route %{buildroot}/sbin
+
 install -m 755 ether-wake %{buildroot}/sbin
 install -m 755 mii-diag %{buildroot}/sbin
 
@@ -228,7 +177,7 @@ rm %{buildroot}%{_mandir}/de/man8/rarp.8*
 rm %{buildroot}%{_mandir}/fr/man8/rarp.8*
 rm %{buildroot}%{_mandir}/pt/man8/rarp.8*
 
-#remove hostname (has its own package)
+# remove hostname (has its own package)
 rm %{buildroot}/bin/dnsdomainname
 rm %{buildroot}/bin/domainname
 rm %{buildroot}/bin/hostname
@@ -255,7 +204,17 @@ fi
 %files -f %{name}.lang
 %doc COPYING
 /bin/netstat
-/sbin/*
+/sbin/ifconfig
+/sbin/route
+/sbin/arp
+/sbin/ether-wake
+/sbin/ipmaddr
+/sbin/iptunnel
+/sbin/mii-diag
+/sbin/mii-tool
+/sbin/nameif
+/sbin/plipconfig
+/sbin/slattach
 %{_mandir}/man[58]/*
 %lang(de)  %{_mandir}/de/man[58]/*
 %lang(fr)  %{_mandir}/fr/man[58]/*
@@ -263,6 +222,12 @@ fi
 %attr(0644,root,root)   %{_unitdir}/arp-ethers.service
 
 %changelog
+* Thu Jan 05 2012 Jiri Popelka <jpopelka at redhat.com> - 1.60-131.20120105git
+- next 11 patches merged upstream
+- removed bcast.patch (seems to be fixed upstream)
+- removed netstat-p-basename.patch (upstream is not happy with it)
+- netstat-leak.patch merged into duplicate-tcp.patch
+
 * Wed Dec 07 2011 Jiri Popelka <jpopelka at redhat.com> - 1.60-130.20111207git
 - removed virtualname.patch
 - added back isofix.patch
diff --git a/sources b/sources
index 635be2e..8617f48 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f1e09d6ce544f0a655da0566771e817d  net-tools-1.60.20111207git.tar.xz
+3a18ec81ad1350317e9ea7517b0c8ad2  net-tools-1.60.20120105git.tar.xz


More information about the scm-commits mailing list