[packages/net-tools] - trying to update to current git snap; review welcome
arekm
arekm at pld-linux.org
Fri Oct 2 11:03:32 CEST 2015
commit 03596bd764b80d8bd883e79fd6cbd5aa1d339464
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Oct 2 11:03:16 2015 +0200
- trying to update to current git snap; review welcome
net-tools-Werror.patch | 33 ----
net-tools-arp_overflow.patch | 11 --
net-tools-config.patch | 9 +-
net-tools-cycle.patch | 311 -------------------------------
net-tools-et.patch | 11 --
net-tools-gcc34.patch | 54 ------
net-tools-get_name.patch | 58 ------
net-tools-ifaceopt.patch | 52 ------
net-tools-inet6-lookup.patch | 81 --------
net-tools-interface.patch | 126 ++++++-------
net-tools-ipvs.patch | 13 --
net-tools-ipx.patch | 36 ----
net-tools-make_config_h.patch | 29 +--
net-tools-manydevs.patch | 13 --
net-tools-mii-tool-GigE.patch | 341 ----------------------------------
net-tools-mii.patch | 17 --
net-tools-nameif.patch | 67 -------
net-tools-netstat-netlink-diag.patch | 14 +-
net-tools-netstat-overflow.patch | 63 -------
net-tools-opt.patch | 11 ++
net-tools-statistics_buffer.patch | 12 --
net-tools-tr.patch | 9 +-
net-tools-virtualname.patch | 36 ----
net-tools-x25_address_is_struct.patch | 24 ---
net-tools.spec | 94 +++++-----
25 files changed, 147 insertions(+), 1378 deletions(-)
---
diff --git a/net-tools.spec b/net-tools.spec
index f0e7026..a1f57bc 100644
--- a/net-tools.spec
+++ b/net-tools.spec
@@ -1,5 +1,6 @@
# TODO
# - changing config.in is not sufficent, must patch config.h and config.make manually
+%define snap 20151002
Summary: Basic Networking Tools
Summary(es.UTF-8): Herramientas básicas de Red
Summary(ja.UTF-8): ネットワークをセットアップするための基本的なツール
@@ -8,39 +9,23 @@ Summary(pt_BR.UTF-8): Ferramentas básicas de Rede
Summary(ru.UTF-8): Базовые сетевые программы
Summary(uk.UTF-8): Базові програми мережі
Name: net-tools
-Version: 1.60
-Release: 35
+Version: 1.61
+Release: 0.%{snap}.1
License: GPL v2+
Group: Networking/Admin
-Source0: http://download.berlios.de/net-tools/%{name}-%{version}.tar.bz2
-# Source0-md5: 888774accab40217dde927e21979c165
+# git clone git://git.code.sf.net/p/net-tools/code net-tools
+Source0: %{name}-%{snap}.tar.bz2
+# Source0-md5: 000b3d8aaa9ec85054513cd365a3ccca
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 9cee6ac0a07a0bf34fbc71add1eb2ead
Patch0: %{name}-config.patch
Patch1: %{name}-man.patch
-Patch2: %{name}-ipvs.patch
-Patch3: %{name}-et.patch
-Patch4: %{name}-mii-tool-GigE.patch
-Patch5: %{name}-x25_address_is_struct.patch
-Patch6: %{name}-make_config_h.patch
-Patch7: %{name}-mii.patch
-Patch8: %{name}-gcc34.patch
-Patch9: %{name}-nameif.patch
-Patch10: %{name}-inet6-lookup.patch
-Patch11: %{name}-ipx.patch
-Patch12: %{name}-manydevs.patch
-Patch13: %{name}-get_name.patch
-Patch14: %{name}-arp_overflow.patch
-Patch15: %{name}-virtualname.patch
-Patch16: %{name}-cycle.patch
-Patch17: %{name}-interface.patch
-Patch18: %{name}-ifaceopt.patch
-Patch19: %{name}-netstat-overflow.patch
-Patch20: %{name}-netstat-netlink-diag.patch
-Patch21: %{name}-statistics_buffer.patch
-Patch22: %{name}-tr.patch
-Patch23: %{name}-Werror.patch
-URL: http://net-tools.berlios.de/
+Patch2: %{name}-opt.patch
+Patch3: %{name}-make_config_h.patch
+Patch4: %{name}-tr.patch
+Patch5: %{name}-netstat-netlink-diag.patch
+Patch6: net-tools-interface.patch
+URL: https://sourceforge.net/projects/net-tools/
BuildRequires: gettext-tools
Requires: hostname
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -131,31 +116,36 @@ zależą od hardware portu równoległego, kabla, szybkości CPU każdej
maszyny połączonej poprzez PLIP.
%prep
-%setup -q
+%setup -q -n %{name}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
-%patch4 -p2
-%patch5 -p1
+%patch4 -p1
+%patch5 -p0
%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-%patch20 -p0
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
+
+#%patch3 -p1
+#%patch4 -p2
+#%patch5 -p1
+#%patch6 -p1
+#%patch7 -p1
+#%patch8 -p1
+#%patch9 -p1
+#%patch10 -p1
+#%patch11 -p1
+#%patch12 -p1
+#%patch13 -p1
+#%patch14 -p1
+#%patch15 -p1
+#%patch16 -p1
+#%patch17 -p1
+#%patch18 -p1
+#%patch19 -p1
+#%patch20 -p0
+#%patch21 -p1
+#%patch22 -p1
+#%patch23 -p1
mv po/et_EE.po po/et.po
@@ -186,6 +176,10 @@ mv -f $RPM_BUILD_ROOT%{_mandir}/{fr_FR,fr}
# we can do it safely as no pt/pt_PT man pages appeared here yet
mv $RPM_BUILD_ROOT%{_mandir}/{pt_BR,pt}
+# for compatibility
+ln -s %{_bindir}/ifconfig $RPM_BUILD_ROOT%{_sbindir}/ifconfig
+ln -s %{_bindir}/route $RPM_BUILD_ROOT%{_sbindir}/route
+
# remove hostname (has its own package)
%{__rm} $RPM_BUILD_ROOT/bin/dnsdomainname
%{__rm} $RPM_BUILD_ROOT%{_mandir}/{,*/}man1/dnsdomainname*
@@ -210,15 +204,17 @@ rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc README README.ipv6 TODO
+%doc README TODO
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mactab
+%attr(755,root,root) %{_bindir}/ifconfig
%attr(755,root,root) %{_bindir}/netstat
+%attr(755,root,root) %{_bindir}/route
%attr(755,root,root) %{_sbindir}/arp
%attr(755,root,root) %{_sbindir}/ifconfig
%attr(755,root,root) %{_sbindir}/mii-tool
+%attr(755,root,root) %{_sbindir}/nameif
%attr(755,root,root) %{_sbindir}/rarp
%attr(755,root,root) %{_sbindir}/route
-%attr(755,root,root) %{_sbindir}/nameif
%lang(de) %{_mandir}/de/man5/ethers.5*
%lang(de) %{_mandir}/de/man8/[!ps]*
diff --git a/net-tools-Werror.patch b/net-tools-Werror.patch
deleted file mode 100644
index 1968edb..0000000
--- a/net-tools-Werror.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- net-tools-1.60/rarp.c~ 2001-04-08 19:05:05.000000000 +0200
-+++ net-tools-1.60/rarp.c 2013-02-16 22:41:25.888096075 +0100
-@@ -225,7 +225,7 @@
- case 'h':
- usage();
- case 'V':
-- fprintf(stderr, version_string);
-+ fprintf(stderr, "%s", version_string);
- exit(E_VERSION);
- break;
- case 'v':
---- net-tools-1.60/slattach.c~ 2000-10-28 12:59:41.000000000 +0200
-+++ net-tools-1.60/slattach.c 2013-02-16 22:42:41.059884440 +0100
-@@ -565,7 +565,7 @@
- "[-c cmd] [-s speed] [-p protocol] tty | -\n"
- " slattach -V | --version\n";
-
-- fprintf(stderr, usage_msg);
-+ fprintf(stderr, "%s", usage_msg);
- exit(1);
- }
-
---- net-tools-1.60/mii-tool.c~ 2013-02-16 22:42:58.786976322 +0100
-+++ net-tools-1.60/mii-tool.c 2013-02-16 22:43:17.657430178 +0100
-@@ -271,7 +271,7 @@
-
- if (opt_watch) {
- if (opt_log) {
-- syslog(LOG_INFO, buf);
-+ syslog(LOG_INFO, "%s", buf);
- } else {
- char s[20];
- time_t t = time(NULL);
diff --git a/net-tools-arp_overflow.patch b/net-tools-arp_overflow.patch
deleted file mode 100644
index 4679a51..0000000
--- a/net-tools-arp_overflow.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- net-tools-1.60/arp.c.old 2005-08-03 08:23:46.000000000 +0200
-+++ net-tools-1.60/arp.c 2005-08-03 11:02:10.000000000 +0200
-@@ -235,7 +235,7 @@
- struct ifreq ifr;
- struct hwtype *xhw;
-
-- strcpy(ifr.ifr_name, ifname);
-+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
- fprintf(stderr, _("arp: cant get HW-Address for `%s': %s.\n"), ifname, strerror(errno));
- return (-1);
diff --git a/net-tools-config.patch b/net-tools-config.patch
index 88e9b5f..5d38d84 100644
--- a/net-tools-config.patch
+++ b/net-tools-config.patch
@@ -1,7 +1,7 @@
diff -Nru net-tools-1.56/config.h net-tools-1.56.new/config.h
--- net-tools-1.56/config.h Thu Jan 1 01:00:00 1970
+++ net-tools-1.56.new/config.h Tue May 30 03:19:19 2000
-@@ -0,0 +1,74 @@
+@@ -0,0 +1,75 @@
+/*
+* config.h Automatically generated configuration includefile
+*
@@ -76,10 +76,11 @@ diff -Nru net-tools-1.56/config.h net-tools-1.56.new/config.h
+#define HAVE_FW_MASQUERADE 1
+#define HAVE_IP_TOOLS 0
+#define HAVE_MII 1
++#define HAVE_SELINUX 1
diff -Nru net-tools-1.56/config.make net-tools-1.56.new/config.make
--- net-tools-1.56/config.make Thu Jan 1 01:00:00 1970
+++ net-tools-1.56.new/config.make Tue May 30 03:19:19 2000
-@@ -0,0 +1,35 @@
+@@ -0,0 +1,36 @@
+I18N=1
+HAVE_AFUNIX=1
+HAVE_AFINET=1
@@ -115,10 +116,11 @@ diff -Nru net-tools-1.56/config.make net-tools-1.56.new/config.make
+# HAVE_FW_MASQUERADE=1
+# HAVE_IP_TOOLS=0
+HAVE_MII=1
++HAVE_SELINUX=1
diff -Nru net-tools-1.56/config.status net-tools-1.56.new/config.status
--- net-tools-1.56/config.status Thu Jan 1 01:00:00 1970
+++ net-tools-1.56.new/config.status Tue May 30 03:19:19 2000
-@@ -0,0 +1,91 @@
+@@ -0,0 +1,92 @@
+#
+# config.in Configure.sh source for the net-tools.
+# This file contains the definition of what the support
@@ -210,3 +212,4 @@ diff -Nru net-tools-1.56/config.status net-tools-1.56.new/config.status
+bool 'IP Masquerading support' HAVE_FW_MASQUERADE y
+bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS n
+bool 'Build mii-tool' HAVE_MII y
++bool 'SELinux support' HAVE_SELINUX y
diff --git a/net-tools-cycle.patch b/net-tools-cycle.patch
deleted file mode 100644
index ce659ec..0000000
--- a/net-tools-cycle.patch
+++ /dev/null
@@ -1,311 +0,0 @@
---- net-tools-1.60/lib/interface.c.cycle 2003-02-11 14:29:29.000000000 +0100
-+++ net-tools-1.60/lib/interface.c 2003-02-11 14:29:29.000000000 +0100
-@@ -90,6 +90,7 @@
- static struct interface *int_list, *int_last;
-
- static int if_readlist_proc(char *);
-+static int if_readlist_rep(char *, struct interface *);
-
- static struct interface *add_interface(char *name)
- {
-@@ -128,11 +129,13 @@
- int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
- {
- struct interface *ife;
-+ int err;
-
- if (!int_list && (if_readlist() < 0))
- return -1;
- for (ife = int_list; ife; ife = ife->next) {
-- int err = doit(ife, cookie);
-+ if_readlist_rep(ife->name, ife);
-+ err = doit(ife, cookie);
- if (err)
- return err;
- }
-@@ -369,6 +372,42 @@
- return err;
- }
-
-+
-+static int if_readlist_rep(char *target, struct interface *ife)
-+{
-+ FILE *fh;
-+ char buf[512];
-+ int err;
-+
-+ fh = fopen(_PATH_PROCNET_DEV, "r");
-+ if (!fh) {
-+ 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);
-+
-+ procnetdev_vsn = procnetdev_version(buf);
-+
-+ err = 0;
-+ while (fgets(buf, sizeof buf, fh)) {
-+ char *s, name[IFNAMSIZ];
-+ s = get_name(name, buf);
-+ get_dev_fields(s, ife);
-+ ife->statistics_valid = 1;
-+ if (target && !strcmp(target,name))
-+ break;
-+ }
-+ if (ferror(fh)) {
-+ perror(_PATH_PROCNET_DEV);
-+ err = -1;
-+ }
-+
-+ fclose(fh);
-+ return err;
-+}
-+
- int if_readlist(void)
- {
- int err = if_readlist_proc(NULL);
---- net-tools-1.60/man/en_US/netstat.8.cycle 2001-01-07 13:43:57.000000000 +0100
-+++ net-tools-1.60/man/en_US/netstat.8 2003-02-11 14:29:29.000000000 +0100
-@@ -30,6 +30,7 @@
- .RB [ \-\-program | \-p ]
- .RB [ \-\-verbose | \-v ]
- .RB [ \-\-continuous | \-c]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-route | \-r }
-@@ -39,6 +40,7 @@
- .RB [ \-\-numeric | \-n ]
- .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
- .RB [ \-\-continuous | \-c]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-interfaces | \-i }
-@@ -50,12 +52,14 @@
- .RB [ \-\-numeric | \-n ]
- .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
- .RB [ \-\-continuous | \-c]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-groups | \-g }
- .RB [ \-\-numeric | \-n ]
- .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
- .RB [ \-\-continuous | \-c]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-masquerade | \-M }
-@@ -63,12 +67,14 @@
- .RB [ \-\-numeric | \-n ]
- .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
- .RB [ \-\-continuous | \-c]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-statistics | -s }
- .RB [ \-\-tcp | \-t ]
- .RB [ \-\-udp | \-u ]
- .RB [ \-\-raw | \-w ]
-+.RB [delay]
- .P
- .B netstat
- .RB { \-\-version | \-V }
-@@ -170,6 +176,10 @@
- Print routing information from the FIB. (This is the default.)
- .SS "\-C"
- Print routing information from the route cache.
-+.SS delay
-+Netstat will cycle printing through statistics every
-+.B delay
-+seconds.
- .IR UP .
- .P
- .SH OUTPUT
---- net-tools-1.60/netstat.c.cycle 2003-02-11 14:29:29.000000000 +0100
-+++ net-tools-1.60/netstat.c 2003-02-11 15:07:26.000000000 +0100
-@@ -102,7 +102,7 @@
- #endif
-
- /* prototypes for statistics.c */
--void parsesnmp(int, int, int);
-+int parsesnmp(int, int, int);
- void inittab(void);
-
- typedef enum {
-@@ -1440,6 +1440,8 @@
-
- static int iface_info(void)
- {
-+ static int count=0;
-+
- if (skfd < 0) {
- if ((skfd = sockets_open(0)) < 0) {
- perror("socket");
-@@ -1449,20 +1451,21 @@
- }
- if (flag_exp < 2) {
- ife_short = 1;
-- printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
-+ if(!(count % 8))
-+ printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
- }
-
- if (for_all_interfaces(do_if_print, &flag_all) < 0) {
- perror(_("missing interface information"));
- exit(1);
- }
-- if (flag_cnt)
-+ if (!flag_cnt) {
- free_interface_list();
-- else {
- close(skfd);
- skfd = -1;
- }
-
-+ count++;
- return 0;
- }
-
-@@ -1478,7 +1481,7 @@
- {
- fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
- fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
-- fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n\n"));
-+ fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
-
- fprintf(stderr, _(" -r, --route display routing table\n"));
- fprintf(stderr, _(" -i, --interfaces display interface table\n"));
-@@ -1514,6 +1517,7 @@
- (int argc, char *argv[]) {
- int i;
- int lop;
-+ int reptimer = 1;
- struct option longopts[] =
- {
- AFTRANS_OPTS,
-@@ -1655,6 +1659,12 @@
- flag_sta++;
- }
-
-+ if(argc == optind + 1) {
-+ if((reptimer = atoi(argv[optind])) <= 0)
-+ usage();
-+ flag_cnt++;
-+ }
-+
- if (flag_int + flag_rou + flag_mas + flag_sta > 1)
- usage();
-
-@@ -1666,7 +1676,7 @@
-
- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
- + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
--
-+
- if (flag_mas) {
- #if HAVE_FW_MASQUERADE && HAVE_AFINET
- #if MORE_THAN_ONE_MASQ_AF
-@@ -1678,7 +1688,7 @@
- flag_not & FLAG_NUM_PORT, flag_exp);
- if (i || !flag_cnt)
- break;
-- sleep(1);
-+ sleep(reptimer);
- }
- #else
- ENOSUPP("netstat.c", "FW_MASQUERADE");
-@@ -1688,9 +1698,15 @@
- }
-
- if (flag_sta) {
-+ for(;;) {
- inittab();
-- parsesnmp(flag_raw, flag_tcp, flag_udp);
-- exit(0);
-+ i = parsesnmp(flag_raw, flag_tcp, flag_udp);
-+
-+ if(i || !flag_cnt)
-+ break;
-+ sleep(reptimer);
-+ }
-+ return(i);
- }
-
- if (flag_rou) {
-@@ -1712,7 +1728,7 @@
- i = route_info(afname, options);
- if (i || !flag_cnt)
- break;
-- sleep(1);
-+ sleep(reptimer);
- }
- return (i);
- }
-@@ -1721,7 +1737,7 @@
- i = iface_info();
- if (!flag_cnt || i)
- break;
-- sleep(1);
-+ sleep(reptimer);
- }
- return (i);
- }
-@@ -1847,7 +1863,7 @@
- }
- if (!flag_cnt || i)
- break;
-- sleep(1);
-+ sleep(reptimer);
- prg_cache_clear();
- }
- return (i);
---- net-tools-1.60/statistics.c.cycle 2001-02-02 19:01:23.000000000 +0100
-+++ net-tools-1.60/statistics.c 2003-02-11 14:29:29.000000000 +0100
-@@ -338,7 +338,7 @@
- }
-
-
--void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
-+int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
- {
- FILE *f;
-
-@@ -347,12 +347,14 @@
- f = fopen("/proc/net/snmp", "r");
- if (!f) {
- perror(_("cannot open /proc/net/snmp"));
-- return;
-+ return(1);
- }
- process_fd(f);
-
-- if (ferror(f))
-+ if (ferror(f)) {
- perror("/proc/net/snmp");
-+ return(1);
-+ }
-
- fclose(f);
-
-@@ -361,12 +363,14 @@
- if (f) {
- process_fd(f);
-
-- if (ferror(f))
-- perror("/proc/net/netstat");
-+ if (ferror(f)) {
-+ perror("/proc/net/netstat");
-+ return(1);
-+ }
-
- fclose(f);
- }
-- return;
-+ return(0);
- }
-
-
diff --git a/net-tools-et.patch b/net-tools-et.patch
deleted file mode 100644
index 2c99e22..0000000
--- a/net-tools-et.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- net-tools-1.60/po/Makefile~ Sun May 19 23:20:20 2002
-+++ net-tools-1.60/po/Makefile Sun May 19 23:20:20 2002
-@@ -9,7 +9,7 @@
-
- -include ../config.make
- ifeq ($(I18N),1)
--CATALOGS = de.mo fr.mo pt_BR.mo et_EE.mo cs.mo
-+CATALOGS = de.mo fr.mo pt_BR.mo et.mo cs.mo
- else
- CATALOGS =
- endif
diff --git a/net-tools-gcc34.patch b/net-tools-gcc34.patch
deleted file mode 100644
index d2ac85d..0000000
--- a/net-tools-gcc34.patch
+++ /dev/null
@@ -1,54 +0,0 @@
---- net-tools-1.60/lib/inet_sr.c.orig 2000-02-20 22:46:45.000000000 +0100
-+++ net-tools-1.60/lib/inet_sr.c 2004-03-08 11:48:59.122481000 +0100
-@@ -104,7 +104,6 @@
- isnet = 1; break;
- case 2:
- isnet = 0; break;
-- default:
- }
-
- /* Fill in the other fields. */
---- net-tools-1.60/hostname.c.orig 2001-04-08 19:04:23.000000000 +0200
-+++ net-tools-1.60/hostname.c 2004-03-08 11:51:41.000000000 +0100
-@@ -31,6 +31,7 @@
- * your option) any later version.
- */
- #include <stdio.h>
-+#include <stdlib.h>
- #include <unistd.h>
- #include <getopt.h>
- #include <string.h>
-@@ -97,7 +98,6 @@
- case EINVAL:
- fprintf(stderr, _("%s: name too long\n"), program_name);
- break;
-- default:
- }
- exit(1);
- };
-@@ -116,7 +116,6 @@
- case EINVAL:
- fprintf(stderr, _("%s: name too long\n"), program_name);
- break;
-- default:
- }
- exit(1);
- };
-@@ -173,7 +172,6 @@
- *p = '\0';
- printf("%s\n", hp->h_name);
- break;
-- default:
- }
- }
-
---- net-tools-1.60/lib/inet6_sr.c.orig 2006-05-03 11:58:01.000000000 +0200
-+++ net-tools-1.60/lib/inet6_sr.c 2006-05-03 12:00:49.000000000 +0200
-@@ -33,6 +33,7 @@
- #include "pathnames.h"
- #include "intl.h"
- #include "net-features.h"
-+#include "util.h"
-
-
-
diff --git a/net-tools-get_name.patch b/net-tools-get_name.patch
deleted file mode 100644
index 6f58acf..0000000
--- a/net-tools-get_name.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -Nrup net-tools-1.60.orig/lib/interface.c net-tools-1.60/lib/interface.c
---- net-tools-1.60.orig/lib/interface.c 2004-08-12 05:54:09.000000000 -0400
-+++ net-tools-1.60/lib/interface.c 2004-08-12 06:03:20.000000000 -0400
-@@ -203,28 +203,34 @@ out:
-
- static char *get_name(char *name, char *p)
- {
-- while (isspace(*p))
-- p++;
-- while (*p) {
-- if (isspace(*p))
-- break;
-- if (*p == ':') { /* could be an alias */
-- char *dot = p, *dotname = name;
-- *name++ = *p++;
-- while (isdigit(*p))
-- *name++ = *p++;
-- if (*p != ':') { /* it wasn't, backup */
-- p = dot;
-- name = dotname;
-- }
-- if (*p == '\0')
-- return NULL;
-- p++;
-- break;
-+ /* Extract <name>[:<alias>] from nul-terminated p where p matches
-+ <name>[:<alias>]: after leading whitespace.
-+ If match is not made, set name empty and return unchanged p */
-+ int namestart=0, nameend=0, aliasend;
-+ while (isspace(p[namestart]))
-+ namestart++;
-+ nameend=namestart;
-+ while (p[nameend] && p[nameend]!=':' && !isspace(p[nameend]))
-+ nameend++;
-+ if (p[nameend]==':') {
-+ aliasend=nameend+1;
-+ while (p[aliasend] && isdigit(p[aliasend]))
-+ aliasend++;
-+ if (p[aliasend]==':') {
-+ nameend=aliasend;
-+ }
-+ if ((nameend-namestart)<IFNAMSIZ) {
-+ memcpy(name,&p[namestart],nameend-namestart);
-+ name[nameend-namestart]='\0';
-+ p=&p[nameend+1];
-+ } else {
-+ /* Interface name too large */
-+ name[0]='\0';
- }
-- *name++ = *p++;
-+ } else {
-+ /* first ':' not found - return empty */
-+ name[0]='\0';
- }
-- *name++ = '\0';
- return p;
- }
-
diff --git a/net-tools-ifaceopt.patch b/net-tools-ifaceopt.patch
deleted file mode 100644
index a561d07..0000000
--- a/net-tools-ifaceopt.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- net-tools-1.60/netstat.c.ifaceopt 2005-03-01 12:11:43.695661632 +0100
-+++ net-tools-1.60/netstat.c 2005-03-01 12:16:37.601981080 +0100
-@@ -1658,10 +1658,11 @@
- {
- fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
- fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
-- fprintf(stderr, _(" netstat { [-veenNac] -i[<Iface>] | [-cnNe] -M | -s } [delay]\n\n"));
-+ fprintf(stderr, _(" netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
-
- fprintf(stderr, _(" -r, --route display routing table\n"));
-- fprintf(stderr, _(" -i, --interfaces=[<Iface>] display interface table\n"));
-+ fprintf(stderr, _(" -I, --interfaces=[<Iface>] display interface table for <Iface>\n"));
-+ fprintf(stderr, _(" -i, --interfaces display interface table\n"));
- fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
- fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
- #if HAVE_FW_MASQUERADE
-@@ -1700,7 +1701,8 @@
- {
- AFTRANS_OPTS,
- {"version", 0, 0, 'V'},
-- {"interfaces", 2, 0, 'i'},
-+ {"interfaces", 2, 0, 'I'},
-+ {"interfaces", 0, 0, 'i'},
- {"help", 0, 0, 'h'},
- {"route", 0, 0, 'r'},
- #if HAVE_FW_MASQUERADE
-@@ -1738,7 +1740,8 @@
- getroute_init(); /* Set up AF routing support */
-
- afname[0] = '\0';
-- while ((i = getopt_long(argc, argv, "MCFA:acdegphi::nNorstuVv?wxl", longopts, &lop)) != EOF)
-+
-+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxl", longopts, &lop)) != EOF)
- switch (i) {
- case -1:
- break;
-@@ -1779,11 +1782,14 @@
- case 'p':
- flag_prg++;
- break;
-- case 'i':
-+ case 'I':
- if (optarg && strcmp(optarg, "(null)"))
- flag_int_name = strdup(optarg);
- flag_int++;
- break;
-+ case 'i':
-+ flag_int++;
-+ break;
- case 'n':
- flag_not |= FLAG_NUM;
- break;
diff --git a/net-tools-inet6-lookup.patch b/net-tools-inet6-lookup.patch
deleted file mode 100644
index 3d4854a..0000000
--- a/net-tools-inet6-lookup.patch
+++ /dev/null
@@ -1,81 +0,0 @@
---- net-tools-1.60/lib/inet6.c.inet6-lookup 2000-10-28 13:04:00.000000000 +0200
-+++ net-tools-1.60/lib/inet6.c 2003-05-21 15:28:50.000000000 +0200
-@@ -133,28 +133,9 @@
- }
-
-
--static int INET6_getsock(char *bufp, struct sockaddr *sap)
--{
-- struct sockaddr_in6 *sin6;
--
-- sin6 = (struct sockaddr_in6 *) sap;
-- sin6->sin6_family = AF_INET6;
-- sin6->sin6_port = 0;
--
-- if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
-- return (-1);
--
-- return 16; /* ?;) */
--}
--
- static int INET6_input(int type, char *bufp, struct sockaddr *sap)
- {
-- switch (type) {
-- case 1:
-- return (INET6_getsock(bufp, sap));
-- default:
-- return (INET6_resolve(bufp, (struct sockaddr_in6 *) sap));
-- }
-+ return (INET6_resolve(bufp, (struct sockaddr_in6 *) sap));
- }
-
-
---- net-tools-1.60/lib/inet6_gr.c.inet6-lookup 2001-04-01 16:48:06.000000000 +0200
-+++ net-tools-1.60/lib/inet6_gr.c 2003-05-21 15:28:50.000000000 +0200
-@@ -100,7 +100,7 @@
- addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
- inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6);
- snprintf(addr6, sizeof(addr6), "%s/%d",
-- inet6_aftype.sprint((struct sockaddr *) &saddr6, 1),
-+ inet6_aftype.sprint((struct sockaddr *) &saddr6, numeric),
- prefix_len);
-
- /* Fetch and resolve the nexthop address. */
-@@ -109,7 +109,7 @@
- naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7]);
- inet6_aftype.input(1, naddr6, (struct sockaddr *) &snaddr6);
- snprintf(naddr6, sizeof(naddr6), "%s",
-- inet6_aftype.sprint((struct sockaddr *) &snaddr6, 1));
-+ inet6_aftype.sprint((struct sockaddr *) &snaddr6, numeric));
-
- /* Decode the flags. */
- strcpy(flags, "U");
---- net-tools-1.60/lib/inet6_sr.c.inet6-lookup 2000-05-22 23:18:37.000000000 +0200
-+++ net-tools-1.60/lib/inet6_sr.c 2003-05-21 15:28:50.000000000 +0200
-@@ -63,7 +63,7 @@
- if (*args == NULL)
- return (usage());
-
-- strcpy(target, *args++);
-+ safe_strncpy(target, *args++, sizeof(target));
- if (!strcmp(target, "default")) {
- prefix_len = 0;
- memset(&sa6, 0, sizeof(sa6));
-@@ -112,7 +112,7 @@
- return (usage());
- if (rt.rtmsg_flags & RTF_GATEWAY)
- return (usage());
-- strcpy(gateway, *args);
-+ safe_strncpy(gateway, *args, sizeof(gateway));
- if (inet6_aftype.input(1, gateway,
- (struct sockaddr *) &sa6) < 0) {
- inet6_aftype.herror(gateway);
-@@ -152,7 +152,7 @@
- }
- if (devname) {
- memset(&ifr, 0, sizeof(ifr));
-- strcpy(ifr.ifr_name, devname);
-+ safe_strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name));
-
- if (ioctl(skfd, SIOGIFINDEX, &ifr) < 0) {
- perror("SIOGIFINDEX");
diff --git a/net-tools-interface.patch b/net-tools-interface.patch
index 3a1bc91..8a45443 100644
--- a/net-tools-interface.patch
+++ b/net-tools-interface.patch
@@ -1,6 +1,33 @@
---- net-tools-1.60/netstat.c.interface 2003-08-25 17:06:30.000000000 +0200
-+++ net-tools-1.60/netstat.c 2003-08-25 17:08:41.000000000 +0200
-@@ -129,6 +129,7 @@
+diff -up net-tools-2.0/man/en_US/netstat.8.interface net-tools-2.0/man/en_US/netstat.8
+--- net-tools-2.0/man/en_US/netstat.8.interface 2014-11-24 14:52:45.648623478 +0100
++++ net-tools-2.0/man/en_US/netstat.8 2014-11-24 14:53:32.294972184 +0100
+@@ -49,9 +49,9 @@ netstat \- Print network connections, ro
+ .RB [delay]
+ .P
+ .B netstat
+-.RB { \-\-interfaces | \-i }
++.RB { \-\-interfaces | \-I | \-i }
+ .RB [ \-\-all | \-a ]
+-.RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
++.RB [ \-\-extend | \-e ]
+ .RB [ \-\-verbose | \-v ]
+ .RB [ \-\-program | \-p ]
+ .RB [ \-\-numeric | \-n ]
+@@ -134,8 +134,8 @@ and
+ produce the same output.
+ .SS "\-\-groups, \-g"
+ Display multicast group membership information for IPv4 and IPv6.
+-.SS "\-\-interfaces, \-i"
+-Display a table of all network interfaces.
++.SS "\-\-interfaces=\fIiface \fR, \fB\-I=\fIiface \fR, \fB\-i"
++Display a table of all network interfaces, or the specified \fIiface\fR.
+ .SS "\-\-masquerade, \-M"
+ Display a list of masqueraded connections.
+ .SS "\-\-statistics, \-s"
+diff -up net-tools-2.0/netstat.c.interface net-tools-2.0/netstat.c
+--- net-tools-2.0/netstat.c.interface 2014-11-24 14:52:45.644623534 +0100
++++ net-tools-2.0/netstat.c 2014-11-24 14:52:45.652623422 +0100
+@@ -144,6 +144,7 @@ static char *Release = RELEASE, *Signatu
#define E_IOCTL -3
int flag_int = 0;
@@ -8,16 +35,16 @@
int flag_rou = 0;
int flag_mas = 0;
int flag_sta = 0;
-@@ -1441,6 +1442,7 @@
+@@ -2083,6 +2083,7 @@ static int rfcomm_info(void)
+
static int iface_info(void)
{
- static int count=0;
+ struct interface *ife = NULL;
-
if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) {
-@@ -1455,7 +1457,11 @@
- printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
+ perror("socket");
+@@ -1802,7 +1804,11 @@ static int iface_info(void)
+ printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
}
- if (for_all_interfaces(do_if_print, &flag_all) < 0) {
@@ -29,82 +56,47 @@
perror(_("missing interface information"));
exit(1);
}
-@@ -1481,30 +1487,31 @@
+@@ -1825,9 +1826,10 @@ static void usage(void)
{
- fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
- fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
-- fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
-+ fprintf(stderr, _(" netstat { [-veenNac] -i[<Iface>] | [-cnNe] -M | -s } [delay]\n\n"));
-
-- fprintf(stderr, _(" -r, --route display routing table\n"));
-- fprintf(stderr, _(" -i, --interfaces display interface table\n"));
-- fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
-- fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
-+ fprintf(stderr, _(" -r, --route display routing table\n"));
-+ fprintf(stderr, _(" -i, --interfaces=[<Iface>] display interface table\n"));
-+ fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
-+ fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
- #if HAVE_FW_MASQUERADE
-- fprintf(stderr, _(" -M, --masquerade display masqueraded connections\n\n"));
-+ fprintf(stderr, _(" -M, --masquerade display masqueraded connections\n\n"));
- #endif
-- fprintf(stderr, _(" -v, --verbose be verbose\n"));
-- fprintf(stderr, _(" -n, --numeric don't resolve names\n"));
-- fprintf(stderr, _(" --numeric-hosts don't resolve host names\n"));
-- fprintf(stderr, _(" --numeric-ports don't resolve port names\n"));
-- fprintf(stderr, _(" --numeric-users don't resolve user names\n"));
-- fprintf(stderr, _(" -N, --symbolic resolve hardware names\n"));
-- fprintf(stderr, _(" -e, --extend display other/more information\n"));
-- fprintf(stderr, _(" -p, --programs display PID/Program name for sockets\n"));
-- fprintf(stderr, _(" -c, --continuous continuous listing\n\n"));
-- fprintf(stderr, _(" -l, --listening display listening server sockets\n"));
-- fprintf(stderr, _(" -a, --all, --listening display all sockets (default: connected)\n"));
-- 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"));
-+ fprintf(stderr, _(" -v, --verbose be verbose\n"));
-+ fprintf(stderr, _(" -n, --numeric don't resolve names\n"));
-+ fprintf(stderr, _(" --numeric-hosts don't resolve host names\n"));
-+ fprintf(stderr, _(" --numeric-ports don't resolve port names\n"));
-+ fprintf(stderr, _(" --numeric-users don't resolve user names\n"));
-+ fprintf(stderr, _(" -N, --symbolic resolve hardware names\n"));
-+ fprintf(stderr, _(" -e, --extend display other/more information\n"));
-+ fprintf(stderr, _(" -p, --programs display PID/Program name for sockets\n"));
-+ fprintf(stderr, _(" -c, --continuous continuous listing\n\n"));
-+ fprintf(stderr, _(" -l, --listening display listening server sockets\n"));
-+ fprintf(stderr, _(" -a, --all, --listening display all sockets (default: connected)\n"));
-+ 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"));
+ fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
+ fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
+- fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
++ fprintf(stderr, _(" netstat { [-vWeenNac] -I[<Iface>] | -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
-+ fprintf(stderr, _(" <Iface>: Name of interface to monitor/list.\n"));
- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
- fprintf(stderr, _(" <AF>=Use '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
- fprintf(stderr, _(" List of possible address families (which support routing):\n"));
-@@ -1522,7 +1529,7 @@
+ fprintf(stderr, _(" -r, --route display routing table\n"));
++ fprintf(stderr, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
+ fprintf(stderr, _(" -i, --interfaces display interface table\n"));
+ fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
+ fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
+@@ -1875,7 +1882,7 @@ int main
{
AFTRANS_OPTS,
{"version", 0, 0, 'V'},
- {"interfaces", 0, 0, 'i'},
-+ {"interfaces", 2, 0, 'i'},
++ {"interfaces", 2, 0, 'I'},
{"help", 0, 0, 'h'},
{"route", 0, 0, 'r'},
#if HAVE_FW_MASQUERADE
-@@ -1560,7 +1567,7 @@
+@@ -1919,7 +1926,7 @@ int main
getroute_init(); /* Set up AF routing support */
afname[0] = '\0';
-- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl", longopts, &lop)) != EOF)
-+ while ((i = getopt_long(argc, argv, "MCFA:acdegphi::nNorstuVv?wxl", longopts, &lop)) != EOF)
+- while ((i = getopt_long(argc, argv, "A:CFMacdeghilnNoprsStuUvVWw2fx64?Z", longopts, &lop)) != EOF)
++ while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWw2fx64?Z", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
-@@ -1602,6 +1609,8 @@
+@@ -1960,6 +1967,13 @@ int main
+ case 'p':
flag_prg++;
break;
++ case 'I':
++ if (optarg && strcmp(optarg, "(null)"))
++ if (optarg[0] == '=') optarg++;
++ if (optarg && strcmp(optarg, "(null)"))
++ flag_int_name = strdup(optarg);
++ flag_int++;
++ break;
case 'i':
-+ if (optarg && strcmp(optarg, "(null)"))
-+ flag_int_name = strdup(optarg);
flag_int++;
break;
- case 'n':
diff --git a/net-tools-ipvs.patch b/net-tools-ipvs.patch
deleted file mode 100644
index a596a4c..0000000
--- a/net-tools-ipvs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- net-tools-1.54/lib/masq_info.c.orig Sun Jun 13 07:04:49 1999
-+++ net-tools-1.54/lib/masq_info.c Tue Jun 27 10:37:09 2000
-@@ -118,7 +118,9 @@
- 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-ipx.patch b/net-tools-ipx.patch
deleted file mode 100644
index d4458b9..0000000
--- a/net-tools-ipx.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -urN net-tools-1.60/lib/ipx_gr.c net-tools-1.60.new/lib/ipx_gr.c
---- net-tools-1.60/lib/ipx_gr.c 2000-10-28 12:59:42.000000000 +0200
-+++ net-tools-1.60.new/lib/ipx_gr.c 2003-05-20 10:54:37.000000000 +0200
-@@ -64,7 +64,7 @@
- continue;
-
- /* Fetch and resolve the Destination */
-- (void) ap->input(5, net, &sa);
-+ (void) ap->input(1, net, &sa);
- strcpy(net, ap->sprint(&sa, numeric));
-
- /* Fetch and resolve the Router Net */
-diff -urN net-tools-1.60/netstat.c net-tools-1.60.new/netstat.c
---- net-tools-1.60/netstat.c 2003-05-20 11:00:57.000000000 +0200
-+++ net-tools-1.60.new/netstat.c 2003-05-20 10:58:25.000000000 +0200
-@@ -1412,13 +1412,13 @@
- }
-
- /* Fetch and resolve the Source */
-- (void) ap->input(4, sad, &sa);
-+ (void) ap->input(0, sad, &sa);
- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
- snprintf(sad, sizeof(sad), "%s:%04X", buf, sport);
-
- if (!nc) {
- /* Fetch and resolve the Destination */
-- (void) ap->input(4, dad, &sa);
-+ (void) ap->input(0, dad, &sa);
- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
- snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
- } else
-diff -urN net-tools-1.60/version.h net-tools-1.60.new/version.h
---- net-tools-1.60/version.h 1970-01-01 01:00:00.000000000 +0100
-+++ net-tools-1.60.new/version.h 2003-05-19 16:07:49.000000000 +0200
-@@ -0,0 +1 @@
-+#define RELEASE "net-tools 1.60"
diff --git a/net-tools-make_config_h.patch b/net-tools-make_config_h.patch
index 0916012..415316b 100644
--- a/net-tools-make_config_h.patch
+++ b/net-tools-make_config_h.patch
@@ -1,21 +1,22 @@
---- net-tools-1.60/Makefile.orig 2001-04-15 16:34:31.000000000 +0200
-+++ net-tools-1.60/Makefile 2004-01-05 19:21:08.972317088 +0100
-@@ -159,11 +159,14 @@
- @tar -cvz -f ../net-tools-$(RELEASE).tar.gz -C .. net-tools
+--- net-tools/Makefile~ 2015-10-02 10:24:26.000000000 +0200
++++ net-tools/Makefile 2015-10-02 10:26:37.964020572 +0200
+@@ -132,11 +132,14 @@ distcheck: dist
+ @printf "\nThe tarball is ready to go:\n%s\n" "`du -b net-tools-$(RELEASE).tar.xz`"
-
--config.h: config.in Makefile
+ config.h: config.in Makefile
- @echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
- @if [ config.status -nt config.in ]; \
-+config.h: config.in Makefile
-+ @if [ ! -f config.h ]; \
-+ then echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; \
-+ echo ; \
-+ if [ config.status -nt config.in ]; \
- then ./configure.sh config.status; \
+- then ./configure.sh config.status; \
- else ./configure.sh config.in; \
+- fi
++ @if [ ! -f config.h ]; \
++ then echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; \
++ echo ; \
++ if [ config.status -nt config.in ]; \
++ then ./configure.sh config.status; \
+ else ./configure.sh config.in; \
-+ fi ; \
- fi
++ fi ; \
++ fi
+ version.h: Makefile
diff --git a/net-tools-manydevs.patch b/net-tools-manydevs.patch
deleted file mode 100644
index b98e83d..0000000
--- a/net-tools-manydevs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- net-tools/lib/nstrcmp.c.bak Fri Apr 12 00:15:01 2002
-+++ net-tools/lib/nstrcmp.c Fri Apr 12 00:15:29 2002
-@@ -16,8 +16,8 @@
- b++;
- }
- if (isdigit(*a)) {
-- if (!isdigit(*b))
-- return -1;
-+ if (!isdigit(*b))
-+ return 1;
- while (a > astr) {
- a--;
- if (!isdigit(*a)) {
diff --git a/net-tools-mii-tool-GigE.patch b/net-tools-mii-tool-GigE.patch
deleted file mode 100644
index aae4f17..0000000
--- a/net-tools-mii-tool-GigE.patch
+++ /dev/null
@@ -1,341 +0,0 @@
-===================================================================
-RCS file: /cvsroot/net-tools/net-tools/include/mii.h,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- net-tools/net-tools/include/mii.h 2003/06/28 03:19:04 1.2
-+++ net-tools/net-tools/include/mii.h 2006/09/27 20:59:19 1.3
-@@ -41,6 +41,7 @@
- #define MII_BMCR_RESTART 0x0200
- #define MII_BMCR_DUPLEX 0x0100
- #define MII_BMCR_COLTEST 0x0080
-+#define MII_BMCR_SPEED1000 0x0040
-
- /* Basic Mode Status Register */
- #define MII_BMSR 0x01
-@@ -86,4 +87,17 @@
- #define MII_ANER_PAGE_RX 0x0002
- #define MII_ANER_LP_AN_ABLE 0x0001
-
-+#define MII_CTRL1000 0x09
-+#define MII_BMCR2_1000FULL 0x0200
-+#define MII_BMCR2_1000HALF 0x0100
-+
-+#define MII_STAT1000 0x0a
-+#define MII_LPA2_1000LOCALOK 0x2000
-+#define MII_LPA2_1000REMRXOK 0x1000
-+#define MII_LPA2_1000FULL 0x0800
-+#define MII_LPA2_1000HALF 0x0400
-+
-+/* Last register we need for show_basic_mii() */
-+#define MII_BASIC_MAX (MII_STAT1000+1)
-+
- #endif /* _LINUX_MII_H */
-===================================================================
-===================================================================
-RCS file: /cvsroot/net-tools/net-tools/mii-tool.c,v
-retrieving revision 1.1
-retrieving revision 1.9
-diff -u -r1.1 -r1.9
---- net-tools/net-tools/mii-tool.c 2000/05/21 13:44:36 1.1
-+++ net-tools/net-tools/mii-tool.c 2006/09/27 20:59:18 1.9
-@@ -29,8 +29,7 @@
- http://www.national.com/pf/DP/DP83840.html
- */
-
--static char version[] =
--"mii-tool.c 1.9 2000/04/28 00:56:08 (David Hinds)\n";
-+static char Version[] = "$Id$\n(Author: David Hinds based on Donald Becker's mii-diag)";
-
- #include <unistd.h>
- #include <stdlib.h>
-@@ -46,16 +45,19 @@
- #include <sys/socket.h>
- #include <sys/ioctl.h>
- #include <net/if.h>
-+#include <linux/sockios.h>
-+
- #ifndef __GLIBC__
- #include <linux/if_arp.h>
- #include <linux/if_ether.h>
- #endif
- #include "mii.h"
-+#include "version.h"
-
- #define MAX_ETH 8 /* Maximum # of interfaces */
-
- /* Table of known MII's */
--static struct {
-+static const struct {
- u_short id1, id2;
- char *name;
- } mii_id[] = {
-@@ -74,6 +76,9 @@
- { 0x0181, 0x4410, "Quality QS6612" },
- { 0x0282, 0x1c50, "SMSC 83C180" },
- { 0x0300, 0xe540, "TDK 78Q2120" },
-+ { 0x0141, 0x0c20, "Yukon 88E1011" },
-+ { 0x0141, 0x0cc0, "Yukon-EC 88E1111" },
-+ { 0x0141, 0x0c90, "Yukon-2 88E1112" },
- };
- #define NMII (sizeof(mii_id)/sizeof(mii_id[0]))
-
-@@ -137,40 +142,48 @@
-
- const struct {
- char *name;
-- u_short value;
-+ u_short value[2];
- } media[] = {
- /* The order through 100baseT4 matches bits in the BMSR */
-- { "10baseT-HD", MII_AN_10BASET_HD },
-- { "10baseT-FD", MII_AN_10BASET_FD },
-- { "100baseTx-HD", MII_AN_100BASETX_HD },
-- { "100baseTx-FD", MII_AN_100BASETX_FD },
-- { "100baseT4", MII_AN_100BASET4 },
-- { "100baseTx", MII_AN_100BASETX_FD | MII_AN_100BASETX_HD },
-- { "10baseT", MII_AN_10BASET_FD | MII_AN_10BASET_HD },
-+ { "10baseT-HD", {MII_AN_10BASET_HD} },
-+ { "10baseT-FD", {MII_AN_10BASET_FD} },
-+ { "100baseTx-HD", {MII_AN_100BASETX_HD} },
-+ { "100baseTx-FD", {MII_AN_100BASETX_FD} },
-+ { "100baseT4", {MII_AN_100BASET4} },
-+ { "100baseTx", {MII_AN_100BASETX_FD | MII_AN_100BASETX_HD} },
-+ { "10baseT", {MII_AN_10BASET_FD | MII_AN_10BASET_HD} },
-+
-+ { "1000baseT-HD", {0, MII_BMCR2_1000HALF} },
-+ { "1000baseT-FD", {0, MII_BMCR2_1000FULL} },
-+ { "1000baseT", {0, MII_BMCR2_1000HALF|MII_BMCR2_1000FULL} },
- };
- #define NMEDIA (sizeof(media)/sizeof(media[0]))
-
- /* Parse an argument list of media types */
--static int parse_media(char *arg)
-+static int parse_media(char *arg, unsigned *bmcr2)
- {
- int mask, i;
- char *s;
- mask = strtoul(arg, &s, 16);
- if ((*arg != '\0') && (*s == '\0')) {
- if ((mask & MII_AN_ABILITY_MASK) &&
-- !(mask & ~MII_AN_ABILITY_MASK))
-- return mask;
-+ !(mask & ~MII_AN_ABILITY_MASK)) {
-+ *bmcr2 = 0;
-+ return mask;
-+ }
- goto failed;
-- } else {
-- mask = 0;
-- s = strtok(arg, ", ");
-- do {
-+ }
-+ mask = 0;
-+ *bmcr2 = 0;
-+ s = strtok(arg, ", ");
-+ do {
- for (i = 0; i < NMEDIA; i++)
-- if (strcasecmp(media[i].name, s) == 0) break;
-+ if (s && strcasecmp(media[i].name, s) == 0) break;
- if (i == NMEDIA) goto failed;
-- mask |= media[i].value;
-- } while ((s = strtok(NULL, ", ")) != NULL);
-- }
-+ mask |= media[i].value[0];
-+ *bmcr2 |= media[i].value[1];
-+ } while ((s = strtok(NULL, ", ")) != NULL);
-+
- return mask;
- failed:
- fprintf(stderr, "Invalid media specification '%s'.\n", arg);
-@@ -179,11 +192,24 @@
-
- /*--------------------------------------------------------------------*/
-
--static char *media_list(int mask, int best)
-+static const char *media_list(unsigned mask, unsigned mask2, int best)
- {
- static char buf[100];
- int i;
- *buf = '\0';
-+
-+ if (mask & MII_BMCR_SPEED1000) {
-+ if (mask2 & MII_BMCR2_1000HALF) {
-+ strcat(buf, " ");
-+ strcat(buf, "1000baseT-HD");
-+ if (best) goto out;
-+ }
-+ if (mask2 & MII_BMCR2_1000FULL) {
-+ strcat(buf, " ");
-+ strcat(buf, "1000baseT-FD");
-+ if (best) goto out;
-+ }
-+ }
- mask >>= 5;
- for (i = 4; i >= 0; i--) {
- if (mask & (1<<i)) {
-@@ -192,6 +218,7 @@
- if (best) break;
- }
- }
-+ out:
- if (mask & (1<<5))
- strcat(buf, " flow-control");
- return buf;
-@@ -201,15 +228,15 @@
- {
- char buf[100];
- int i, mii_val[32];
-- int bmcr, bmsr, advert, lkpar;
-+ unsigned bmcr, bmsr, advert, lkpar, bmcr2, lpa2;
-
- /* Some bits in the BMSR are latched, but we can't rely on being
- the only reader, so only the current values are meaningful */
- mdio_read(sock, MII_BMSR);
-- for (i = 0; i < ((verbose > 1) ? 32 : 8); i++)
-+ for (i = 0; i < ((verbose > 1) ? 32 : MII_BASIC_MAX); i++)
- mii_val[i] = mdio_read(sock, i);
-
-- if (mii_val[MII_BMCR] == 0xffff) {
-+ if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
- fprintf(stderr, " No MII transceiver present!.\n");
- return -1;
- }
-@@ -217,6 +244,7 @@
- /* Descriptive rename. */
- bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
- advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR];
-+ bmcr2 = mii_val[MII_CTRL1000]; lpa2 = mii_val[MII_STAT1000];
-
- sprintf(buf, "%s: ", ifr.ifr_name);
- if (bmcr & MII_BMCR_AN_ENA) {
-@@ -224,7 +252,7 @@
- if (advert & lkpar) {
- strcat(buf, (lkpar & MII_AN_ACK) ?
- "negotiated" : "no autonegotiation,");
-- strcat(buf, media_list(advert & lkpar, 1));
-+ strcat(buf, media_list(advert & lkpar, bmcr2 & lpa2>>2, 1));
- strcat(buf, ", ");
- } else {
- strcat(buf, "autonegotiation failed, ");
-@@ -234,8 +262,10 @@
- }
- } else {
- sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ",
-- (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
-- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
-+ ((bmcr2 & (MII_BMCR2_1000HALF | MII_BMCR2_1000FULL)) & lpa2 >> 2)
-+ ? "1000"
-+ : (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
-+ (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
- }
- strcat(buf, (bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
-
-@@ -296,12 +326,13 @@
- if (bmsr & MII_BMSR_REMOTE_FAULT)
- printf("remote fault, ");
- printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
-- printf("\n capabilities:%s", media_list(bmsr >> 6, 0));
-- printf("\n advertising: %s", media_list(advert, 0));
-+ printf("\n capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
-+ printf("\n advertising: %s", media_list(advert, lpa2 >> 2, 0));
- if (lkpar & MII_AN_ABILITY_MASK)
-- printf("\n link partner:%s", media_list(lkpar, 0));
-+ printf("\n link partner:%s", media_list(lkpar, bmcr2, 0));
- printf("\n");
- }
-+ fflush(stdout);
- return 0;
- }
-
-@@ -329,7 +360,7 @@
- printf("resetting the transceiver...\n");
- mdio_write(skfd, MII_BMCR, MII_BMCR_RESET);
- }
-- if (nway_advertise) {
-+ if (nway_advertise > 0) {
- mdio_write(skfd, MII_ANAR, nway_advertise | 1);
- opt_restart = 1;
- }
-@@ -379,27 +410,38 @@
- /*--------------------------------------------------------------------*/
-
- const char *usage =
--"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
-- -V, --version display version information
-- -v, --verbose more verbose output
-- -R, --reset reset MII to poweron state
-- -r, --restart restart autonegotiation
-- -w, --watch monitor for link status changes
-- -l, --log with -w, write events to syslog
-- -A, --advertise=media,... advertise only specified media
-- -F, --force=media force specified media technology
--media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
-- (to advertise both HD and FD) 100baseTx, 10baseT\n";
-+"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
-+" -V, --version display version information\n"
-+" -v, --verbose more verbose output\n"
-+" -R, --reset reset MII to poweron state\n"
-+" -r, --restart restart autonegotiation\n"
-+" -w, --watch monitor for link status changes\n"
-+" -l, --log with -w, write events to syslog\n"
-+" -A, --advertise=media,... advertise only specified media\n"
-+" -F, --force=media force specified media technology\n"
-+"media: 1000baseTx-HD, 1000baseTx-FD,\n"
-+" 100baseT4, 100baseTx-FD, 100baseTx-HD,\n"
-+" 10baseT-FD, 10baseT-HD,\n"
-+" (to advertise both HD and FD) 1000baseTx, 100baseTx, 10baseT\n";
-+
-+
-+static void version(void)
-+{
-+ fprintf(stderr, "%s\n%s\n", Version, RELEASE);
-+ exit(5); /* E_VERSION */
-+}
-+
-
- int main(int argc, char **argv)
- {
- int i, c, ret, errflag = 0;
- char s[6];
-+ unsigned ctrl1000 = 0;
-
- while ((c = getopt_long(argc, argv, "A:F:p:lrRvVw?", longopts, 0)) != EOF)
- switch (c) {
-- case 'A': nway_advertise = parse_media(optarg); break;
-- case 'F': fixed_speed = parse_media(optarg); break;
-+ case 'A': nway_advertise = parse_media(optarg, &ctrl1000); break;
-+ case 'F': fixed_speed = parse_media(optarg, &ctrl1000); break;
- case 'p': override_phy = atoi(optarg); break;
- case 'r': opt_restart++; break;
- case 'R': opt_reset++; break;
-@@ -411,6 +453,10 @@
- }
- /* Check for a few inappropriate option combinations */
- if (opt_watch) verbose = 0;
-+
-+ if ((nway_advertise < 0) || (fixed_speed < 0))
-+ return 2;
-+
- if (errflag || (fixed_speed & (fixed_speed-1)) ||
- (fixed_speed && (opt_restart || nway_advertise))) {
- fprintf(stderr, usage, argv[0]);
-@@ -418,7 +464,7 @@
- }
-
- if (opt_version)
-- printf(version);
-+ version();
-
- /* Open a basic socket. */
- if ((skfd = socket(AF_INET, SOCK_DGRAM,0)) < 0) {
-@@ -426,6 +472,9 @@
- exit(-1);
- }
-
-+ if (verbose > 1)
-+ printf("Using SIOCGMIIPHY=0x%x\n", SIOCGMIIPHY);
-+
- /* No remaining args means show all interfaces. */
- if (optind == argc) {
- ret = 1;
diff --git a/net-tools-mii.patch b/net-tools-mii.patch
deleted file mode 100644
index 4859273..0000000
--- a/net-tools-mii.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- net-tools-1.60/include/mii.h.bar Tue Jul 31 11:49:39 2001
-+++ net-tools-1.60/include/mii.h Tue Jul 31 11:49:33 2001
-@@ -11,11 +11,9 @@
-
- /* network interface ioctl's for MII commands */
- #ifndef SIOCGMIIPHY
--#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Read from current PHY */
--#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read any PHY register */
--#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write any PHY register */
--#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters */
--#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters */
-+#define SIOCGMIIPHY 0x8947 /* Read from current PHY */
-+#define SIOCGMIIREG 0x8948 /* Read any PHY register */
-+#define SIOCSMIIREG 0x8949 /* Write any PHY register */
- #endif
-
- #include <linux/types.h>
diff --git a/net-tools-nameif.patch b/net-tools-nameif.patch
deleted file mode 100644
index 7ba1f00..0000000
--- a/net-tools-nameif.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- net-tools-1.60/nameif.c.nameif 2000-10-18 19:26:29.000000000 +0200
-+++ net-tools-1.60/nameif.c 2003-03-19 11:02:01.000000000 +0100
-@@ -3,7 +3,7 @@
- * Writen 2000 by Andi Kleen.
- * Subject to the Gnu Public License, version 2.
- * TODO: make it support token ring etc.
-- * $Id: nameif.c,v 1.1 2000/10/18 17:26:29 ak Exp $
-+ * $Id: nameif.c,v 1.3 2003/03/06 23:26:52 ecki Exp $
- */
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
-@@ -117,7 +117,8 @@
- }
-
- struct change {
-- struct change *next,**pprev;
-+ struct change *next;
-+ int found;
- char ifname[IFNAMSIZ+1];
- unsigned char mac[6];
- };
-@@ -139,10 +140,7 @@
- ch->ifname, pos);
- if (parsemac(p,ch->mac) < 0)
- complain(_("cannot parse MAC `%s' at %s"), p, pos);
-- if (clist)
-- clist->pprev = &ch->next;
- ch->next = clist;
-- ch->pprev = &clist;
- clist = ch;
- return 0;
- }
-@@ -200,7 +198,7 @@
-
- void usage(void)
- {
-- fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}"));
-+ fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
- exit(1);
- }
-
-@@ -277,21 +275,21 @@
- ch = lookupmac(mac);
- if (!ch)
- continue;
--
-- *ch->pprev = ch->next;
-+
-+ ch->found = 1;
- if (strcmp(p, ch->ifname)) {
- if (setname(p, ch->ifname) < 0)
- complain(_("cannot change name of %s to %s: %s"),
- p, ch->ifname, strerror(errno));
- }
-- free(ch);
- }
- fclose(ifh);
-
- while (clist) {
- struct change *ch = clist;
- clist = clist->next;
-- warning(_("interface '%s' not found"), ch->ifname);
-+ if (!ch->found)
-+ warning(_("interface '%s' not found"), ch->ifname);
- free(ch);
- }
-
diff --git a/net-tools-netstat-netlink-diag.patch b/net-tools-netstat-netlink-diag.patch
index e6d46c1..be737b9 100644
--- a/net-tools-netstat-netlink-diag.patch
+++ b/net-tools-netstat-netlink-diag.patch
@@ -178,7 +178,7 @@ diff -c -d -u -r1.55 netstat.c
+ r->idiag_inode);
+ }
+
-+ tcp_do_one (++lnr, linebuf);
++ tcp_do_one (++lnr, linebuf, r->idiag_family == AF_INET ? "tcp" : "tcp6");
+ }
+ h = NLMSG_NEXT(h, status);
+ }
@@ -196,7 +196,7 @@ diff -c -d -u -r1.55 netstat.c
static int tcp_info(void)
{
- INFO_GUTS6(_PATH_PROCNET_TCP, _PATH_PROCNET_TCP6, "AF INET (tcp)",
-- tcp_do_one);
+- tcp_do_one, "tcp", "tcp6");
+ int rv = -1;
+
+#ifdef HAVE_NETLINK
@@ -207,7 +207,7 @@ diff -c -d -u -r1.55 netstat.c
+ {
+ // netlink is not available - so parse /proc/net/tcp
+ INFO_GUTS6(_PATH_PROCNET_TCP, _PATH_PROCNET_TCP6, "AF INET (tcp)",
-+ tcp_do_one);
++ tcp_do_one, "tcp", "tcp6");
+ }
+ else if (rv == 0)
+ return 0;
@@ -216,26 +216,26 @@ diff -c -d -u -r1.55 netstat.c
}
+
- static void udp_do_one(int lnr, const char *line)
+ static void udp_do_one(int lnr, const char *line,const char *prot)
{
--- config.in~ 2009-03-10 04:37:40.000000000 +0200
+++ config.in 2009-03-10 04:38:14.092903210 +0200
@@ -89,3 +89,4 @@
- bool 'IP Masquerading support' HAVE_FW_MASQUERADE n
bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS n
bool 'Build mii-tool' HAVE_MII n
+ bool 'SELinux support' HAVE_SELINUX n
+bool 'Use Netlink Diag' HAVE_NETLINK y
--- config.h~ 2009-03-10 04:49:18.000000000 +0200
+++ config.h 2009-03-10 04:49:55.762832175 +0200
@@ -72,3 +72,4 @@
- #define HAVE_FW_MASQUERADE 1
#define HAVE_IP_TOOLS 0
#define HAVE_MII 1
+ #define HAVE_SELINUX 1
+#define HAVE_NETLINK 1
--- config.make~ 2009-03-10 04:49:18.000000000 +0200
+++ config.make 2009-03-10 04:50:19.880072014 +0200
@@ -33,3 +33,4 @@
- # HAVE_FW_MASQUERADE=1
# HAVE_IP_TOOLS=0
HAVE_MII=1
+ HAVE_SELINUX=1
+HAVE_NETLINK=1
diff --git a/net-tools-netstat-overflow.patch b/net-tools-netstat-overflow.patch
deleted file mode 100644
index d363149..0000000
--- a/net-tools-netstat-overflow.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -ur net-tools-1.60.orig/netstat.c net-tools-1.60/netstat.c
---- net-tools-1.60.orig/netstat.c 2004-04-07 11:47:05.000000000 -0400
-+++ net-tools-1.60/netstat.c 2004-04-07 16:47:15.000000000 -0400
-@@ -777,7 +777,8 @@
- local_addr[22 - strlen(buffer)] = '\0';
-
- strcat(local_addr, ":");
-- strcat(local_addr, buffer);
-+ strncat(local_addr, buffer, sizeof(local_addr));
-+ local_addr[sizeof(local_addr)-1] = 0;
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
-
-@@ -785,7 +786,8 @@
- rem_addr[22 - strlen(buffer)] = '\0';
-
- strcat(rem_addr, ":");
-- strcat(rem_addr, buffer);
-+ strncat(rem_addr, buffer, sizeof(rem_addr));
-+ rem_addr[sizeof(rem_addr)-1] = 0;
- timers[0] = '\0';
-
- if (flag_opt)
-@@ -926,7 +928,8 @@
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
- strcat(local_addr, ":");
-- strcat(local_addr, buffer);
-+ strncat(local_addr, buffer, sizeof(local_addr));
-+ local_addr[sizeof(local_addr)-1] = 0;
-
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
-@@ -935,7 +938,8 @@
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
- strcat(rem_addr, ":");
-- strcat(rem_addr, buffer);
-+ strncat(rem_addr, buffer, sizeof(rem_addr));
-+ rem_addr[sizeof(rem_addr)-1] = 0;
-
- timers[0] = '\0';
- if (flag_opt)
-@@ -1045,7 +1049,8 @@
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
- strcat(local_addr, ":");
-- strcat(local_addr, buffer);
-+ strncat(local_addr, buffer, sizeof(local_addr));
-+ local_addr[sizeof(local_addr)-1] = 0;
-
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
-@@ -1054,7 +1059,8 @@
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
- strcat(rem_addr, ":");
-- strcat(rem_addr, buffer);
-+ strncat(rem_addr, buffer, sizeof(rem_addr));
-+ rem_addr[sizeof(rem_addr)-1] = 0;
-
- timers[0] = '\0';
- if (flag_opt)
diff --git a/net-tools-opt.patch b/net-tools-opt.patch
new file mode 100644
index 0000000..e1a34ab
--- /dev/null
+++ b/net-tools-opt.patch
@@ -0,0 +1,11 @@
+--- net-tools/Makefile~ 2015-10-02 10:16:54.000000000 +0200
++++ net-tools/Makefile 2015-10-02 10:23:22.375643479 +0200
+@@ -44,7 +44,7 @@ PROGS += mii-tool
+ endif
+
+ # Compiler and Linker Options
+-CFLAGS ?= -O2 -g
++CFLAGS ?= $(COPTS)
+ CFLAGS += -Wall
+ CFLAGS += -fno-strict-aliasing # code needs a lot of work before strict aliasing is safe
+ CPPFLAGS += -D_GNU_SOURCE
diff --git a/net-tools-statistics_buffer.patch b/net-tools-statistics_buffer.patch
deleted file mode 100644
index 526c490..0000000
--- a/net-tools-statistics_buffer.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up net-tools-1.60/statistics.c.old net-tools-1.60/statistics.c
---- net-tools-1.60/statistics.c.old 2008-03-04 10:44:41.000000000 +0100
-+++ net-tools-1.60/statistics.c 2008-03-04 10:44:11.000000000 +0100
-@@ -352,7 +352,7 @@ struct tabtab *newtable(struct tabtab *t
-
- void process_fd(FILE *f,int file_desc) // added file_desc to show propriate error mesg
- {
-- char buf1[1024], buf2[1024];
-+ char buf1[2048], buf2[2048];
- char *sp, *np, *p;
- while (fgets(buf1, sizeof buf1, f)) {
- int endflag;
diff --git a/net-tools-tr.patch b/net-tools-tr.patch
index a165d4c..c92a50c 100644
--- a/net-tools-tr.patch
+++ b/net-tools-tr.patch
@@ -11,14 +11,13 @@
#include <errno.h>
--- net-tools-1.60/lib/tr.c~ 2013-02-16 22:39:03.864803754 +0100
+++ net-tools-1.60/lib/tr.c 2013-02-16 22:40:02.122803924 +0100
-@@ -31,6 +31,10 @@
- #include "pathnames.h"
+@@ -32,6 +32,9 @@
#include "intl.h"
+ #include "util.h"
+#ifndef TR_ALEN
+#define TR_ALEN FDDI_K_ALEN
+#endif
-+
- extern struct hwtype tr_hwtype;
- static char *pr_tr(unsigned char *ptr)
+ /* actual definition at the end of file */
+ extern struct hwtype tr_hwtype;
diff --git a/net-tools-virtualname.patch b/net-tools-virtualname.patch
deleted file mode 100644
index 326df1d..0000000
--- a/net-tools-virtualname.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- net-tools-1.60/lib/interface.c.virtualname 2001-02-10 20:31:15.000000000 +0100
-+++ net-tools-1.60/lib/interface.c 2003-08-19 13:18:01.000000000 +0200
-@@ -579,18 +579,18 @@
-
- void ife_print_short(struct interface *ptr)
- {
-- printf("%-5.5s ", ptr->name);
-- printf("%5d %3d", ptr->mtu, ptr->metric);
-+ printf("%-9.9s ", ptr->name);
-+ printf("%5d %3d ", ptr->mtu, ptr->metric);
- /* If needed, display the interface statistics. */
- if (ptr->statistics_valid) {
-- printf("%8llu %6lu %6lu %6lu",
-+ printf("%8llu %6lu %6lu %6lu ",
- ptr->stats.rx_packets, ptr->stats.rx_errors,
- ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors);
- printf("%8llu %6lu %6lu %6lu ",
- ptr->stats.tx_packets, ptr->stats.tx_errors,
- ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors);
- } else {
-- printf("%-56s", _(" - no statistics available -"));
-+ printf("%-60s", _(" - no statistics available -"));
- }
- /* DONT FORGET TO ADD THE FLAGS IN ife_print_long, too */
- if (ptr->flags == 0)
---- net-tools-1.60/netstat.c.virtualname 2001-04-15 16:41:17.000000000 +0200
-+++ net-tools-1.60/netstat.c 2003-08-19 13:18:34.000000000 +0200
-@@ -1449,7 +1449,7 @@
- }
- if (flag_exp < 2) {
- ife_short = 1;
-- printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
-+ printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
- }
-
- if (for_all_interfaces(do_if_print, &flag_all) < 0) {
diff --git a/net-tools-x25_address_is_struct.patch b/net-tools-x25_address_is_struct.patch
deleted file mode 100644
index 062fc0b..0000000
--- a/net-tools-x25_address_is_struct.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN net-tools-1.60.orig/lib/x25.c net-tools-1.60/lib/x25.c
---- net-tools-1.60.orig/lib/x25.c 2000-05-20 20:53:25.000000000 +0200
-+++ net-tools-1.60/lib/x25.c 2004-12-19 15:10:05.258134376 +0100
-@@ -119,7 +119,7 @@
- /* All done. */
- #ifdef DEBUG
- fprintf(stderr, "x25_input(%s): ", orig);
-- for (i = 0; i < sizeof(x25_address); i++)
-+ for (i = 0; i < sizeof(struct x25_address); i++)
- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
- fprintf(stderr, "\n");
- #endif
-diff -durN net-tools-1.60.orig/lib/x25_sr.c net-tools-1.60/lib/x25_sr.c
---- net-tools-1.60.orig/lib/x25_sr.c 2000-05-20 15:38:10.000000000 +0200
-+++ net-tools-1.60/lib/x25_sr.c 2004-12-19 15:10:05.259134224 +0100
-@@ -77,7 +77,7 @@
- rt.sigdigits=sigdigits;
-
- /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
-- memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
-+ memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
-
- while (*args) {
- if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/net-tools.git/commitdiff/03596bd764b80d8bd883e79fd6cbd5aa1d339464
More information about the pld-cvs-commit
mailing list