aboutsummaryrefslogtreecommitdiffstats
path: root/main/net-tools
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-01 15:02:05 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-01 15:02:05 +0000
commitf4c96c9bb3df4cfbfd771d2903db955cb0e58732 (patch)
tree05dd64dad3a43c452cbef4d5e4ad699286f7ab64 /main/net-tools
parente814ea412808c69d413d20a86ebd31beb67c1102 (diff)
downloadaports-f4c96c9bb3df4cfbfd771d2903db955cb0e58732.tar.bz2
aports-f4c96c9bb3df4cfbfd771d2903db955cb0e58732.tar.xz
main/net-tools: upgrade to git 20140218 and fix musl build
Diffstat (limited to 'main/net-tools')
-rw-r--r--main/net-tools/APKBUILD15
-rw-r--r--main/net-tools/git.patch1220
-rw-r--r--main/net-tools/musl-fixes.patch94
3 files changed, 1099 insertions, 230 deletions
diff --git a/main/net-tools/APKBUILD b/main/net-tools/APKBUILD
index 8779357dde..339d3159e8 100644
--- a/main/net-tools/APKBUILD
+++ b/main/net-tools/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=net-tools
-pkgver=1.60_git20130615
+pkgver=1.60_git20140218
_ver=${pkgver%_git*}
pkgrel=0
pkgdesc="Linux networking base tools"
@@ -13,7 +13,9 @@ makedepends="$depends_dev bash"
install=""
subpackages="$pkgname-doc mii-tool:mii_tool"
source="https://downloads.sourceforge.net/project/net-tools/net-tools-$_ver.tar.bz2
- git.patch"
+ git.patch
+ musl-fixes.patch
+ "
_builddir="$srcdir"/net-tools-$_ver
prepare() {
@@ -84,8 +86,11 @@ mii_tool() {
}
md5sums="888774accab40217dde927e21979c165 net-tools-1.60.tar.bz2
-6c2b55f5258d23477fa0d9261bd363a5 git.patch"
+fe7b9dfa9f68adcf6ca23b9616decdb4 git.patch
+d57bcd8c1aa8b92b1128a4fea4f033df musl-fixes.patch"
sha256sums="7ae4dd6d44d6715f18e10559ffd270511b6e55a8900ca54fbebafe0ae6cf7d7b net-tools-1.60.tar.bz2
-3d27ff819c909c97c515837971f4cdb76744e0a20adefd563b1840cbeafcf789 git.patch"
+6e0acc8f88135f2e12b79777914a732c64789b1f629ea97c1860ed324b21724c git.patch
+538f0115911867423d27ee9b3fcc1177e339b474c131332eb7758f5c220928e1 musl-fixes.patch"
sha512sums="8e1ae9bca726ad7d795a06c58388f9e11c1d617d94eebb9ed18bd11e5f34c6541e1ffe631706c407996db86e78df6e5cf1968a2d90b242b473596fda3b6d1eae net-tools-1.60.tar.bz2
-95865c5be07585cc9994a1142a6585f482fdcc8f56a59fb87e71e8e947471af5ac42e99c6bccfa34dbc378449c9fcaad315815636879800950c97a6889e69d4a git.patch"
+5edc92e8cf46da11898ac1999cfccb5b7ae3407f649c75c2da43c4264e1271b010eafbc84283e4c41219870bf89722e09666b25d28c84cb4ac60ceebee9adb2d git.patch
+08c9e7681e069a42f4da714faf0b93ad1c569cf942a94a1b41103e86850235b507c0291e2f3839c84dd02aba0b1a16d79580fbfc55dd2af8d09b0ff71d714e9f musl-fixes.patch"
diff --git a/main/net-tools/git.patch b/main/net-tools/git.patch
index 920c4fa05c..eb35885e81 100644
--- a/main/net-tools/git.patch
+++ b/main/net-tools/git.patch
@@ -1,3 +1,12 @@
+diff --git a/.cvsignore b/.cvsignore
+index 1d4a063..ff65062 100644
+--- a/.cvsignore
++++ b/.cvsignore
+@@ -1,2 +1,3 @@
+ arp hostname ifconfig ipmaddr iptunnel netstat plipconfig rarp route slattach
+ version.h config.make config.status config.h nameif mii-tool
++.git
+diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9184162
--- /dev/null
@@ -39,8 +48,149 @@ index 0000000..9184162
+/rarp
+/route
+/slattach
+diff --git a/COPYING b/COPYING
+index a43ea21..d159169 100644
+--- a/COPYING
++++ b/COPYING
+@@ -1,12 +1,12 @@
+- GNU GENERAL PUBLIC LICENSE
+- Version 2, June 1991
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
+
+- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+- 675 Mass Ave, Cambridge, MA 02139, USA
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+- Preamble
++ Preamble
+
+ The licenses for most software are designed to take away your
+ freedom to share and change it. By contrast, the GNU General Public
+@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
+ General Public License applies to most of the Free Software
+ Foundation's software and to any other program whose authors commit to
+ using it. (Some other Free Software Foundation software is covered by
+-the GNU Library General Public License instead.) You can apply it to
++the GNU Lesser General Public License instead.) You can apply it to
+ your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+ modification follow.
+-
+- GNU GENERAL PUBLIC LICENSE
++
++ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+-
++
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Program,
+ and can be reasonably considered independent and separate works in
+@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+-
++
+ 4. You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense or distribute the Program is
+@@ -225,7 +225,7 @@ impose that choice.
+
+ This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.
+-
++
+ 8. If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Program under this License
+@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
+ of preserving the free status of all derivatives of our free software and
+ of promoting the sharing and reuse of software generally.
+
+- NO WARRANTY
++ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGES.
+
+- END OF TERMS AND CONDITIONS
+-
+- Appendix: How to Apply These Terms to Your New Programs
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+ possible use to the public, the best way to achieve this is to make it
+@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
+ the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+- Copyright (C) 19yy <name of author>
++ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Also add information on how to contact you by electronic and paper mail.
+
+ If the program is interactive, make it output a short notice like this
+ when it starts in an interactive mode:
+
+- Gnomovision version 69, Copyright (C) 19yy name of author
++ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
+ This General Public License does not permit incorporating your program into
+ proprietary programs. If your program is a subroutine library, you may
+ consider it more useful to permit linking proprietary applications with the
+-library. If this is what you want to do, use the GNU Library General
++library. If this is what you want to do, use the GNU Lesser General
+ Public License instead of this License.
+diff --git a/INSTALLING b/INSTALLING
+index c49f21f..f6180c8 100644
+--- a/INSTALLING
++++ b/INSTALLING
+@@ -27,7 +27,7 @@ of the other options should work as well.
+
+
+ COMPILE
+--------
++-------
+ To compile simply use "make".
+
+ There should be no warnings or errors.
diff --git a/Makefile b/Makefile
-index 8fcc55c..0020202 100644
+index 8fcc55c..edf80ec 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,10 @@
@@ -59,7 +209,7 @@ index 8fcc55c..0020202 100644
#
# Based on: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# Copyright 1988-1993 MicroWalt Corporation
-@@ -22,55 +18,14 @@
+@@ -22,55 +18,16 @@
# Alan Cox <A.Cox@swansea.ac.uk>
# Copyright 1993-1994 Swansea University Computer Society
#
@@ -116,10 +266,12 @@ index 8fcc55c..0020202 100644
+# set the base of the Installation
# BASEDIR = /mnt
+BASEDIR ?= $(DESTDIR)
++BINDIR ?= /bin
++SBINDIR ?= /sbin
# path to the net-lib support library. Default: lib
NET_LIB_PATH = lib
-@@ -88,20 +43,26 @@ endif
+@@ -88,20 +45,26 @@ endif
# Compiler and Linker Options
# You may need to uncomment and edit these if you are using libc5 and IPv6.
@@ -152,7 +304,7 @@ index 8fcc55c..0020202 100644
.EXPORT_ALL_VARIABLES:
-@@ -113,22 +74,22 @@ endif
+@@ -113,22 +76,22 @@ endif
NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
@@ -186,7 +338,7 @@ index 8fcc55c..0020202 100644
all: config.h version.h subdirs $(PROGS)
-@@ -154,12 +115,21 @@ clobber: clean
+@@ -154,12 +117,21 @@ clobber: clean
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clobber) ; done
@@ -212,7 +364,7 @@ index 8fcc55c..0020202 100644
@echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
@if [ config.status -nt config.in ]; \
then ./configure.sh config.status; \
-@@ -175,62 +145,68 @@ $(NET_LIB): config.h version.h intl.h libdir
+@@ -175,85 +147,91 @@ $(NET_LIB): config.h version.h intl.h libdir
i18n.h: i18ndir
@@ -282,26 +434,72 @@ index 8fcc55c..0020202 100644
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(RESLIB)
installbin:
+- install -m 0755 -d ${BASEDIR}/sbin
+- install -m 0755 -d ${BASEDIR}/bin
+- install -m 0755 arp ${BASEDIR}/sbin
+- install -m 0755 hostname ${BASEDIR}/bin
+- install -m 0755 ifconfig ${BASEDIR}/sbin
+- install -m 0755 nameif ${BASEDIR}/sbin
+- install -m 0755 netstat ${BASEDIR}/bin
+- install -m 0755 plipconfig $(BASEDIR)/sbin
+- install -m 0755 rarp ${BASEDIR}/sbin
+- install -m 0755 route ${BASEDIR}/sbin
+- install -m 0755 slattach $(BASEDIR)/sbin
+ @echo
+ @echo "######################################################"
+ @echo "Notice: ifconfig and route are now installed into /bin"
+ @echo "######################################################"
+ @echo
- install -m 0755 -d ${BASEDIR}/sbin
- install -m 0755 -d ${BASEDIR}/bin
- install -m 0755 arp ${BASEDIR}/sbin
- install -m 0755 hostname ${BASEDIR}/bin
-- install -m 0755 ifconfig ${BASEDIR}/sbin
-+ install -m 0755 ifconfig ${BASEDIR}/bin
- install -m 0755 nameif ${BASEDIR}/sbin
- install -m 0755 netstat ${BASEDIR}/bin
- install -m 0755 plipconfig $(BASEDIR)/sbin
- install -m 0755 rarp ${BASEDIR}/sbin
-- install -m 0755 route ${BASEDIR}/sbin
-+ install -m 0755 route ${BASEDIR}/bin
- install -m 0755 slattach $(BASEDIR)/sbin
++ install -m 0755 -d ${BASEDIR}${SBINDIR}
++ install -m 0755 -d ${BASEDIR}${BINDIR}
++ install -m 0755 arp ${BASEDIR}${SBINDIR}
++ install -m 0755 hostname ${BASEDIR}${BINDIR}
++ install -m 0755 ifconfig ${BASEDIR}${BINDIR}
++ install -m 0755 nameif ${BASEDIR}${SBINDIR}
++ install -m 0755 netstat ${BASEDIR}${BINDIR}
++ install -m 0755 plipconfig $(BASEDIR)${SBINDIR}
++ install -m 0755 rarp ${BASEDIR}${SBINDIR}
++ install -m 0755 route ${BASEDIR}${BINDIR}
++ install -m 0755 slattach $(BASEDIR)${SBINDIR}
ifeq ($(HAVE_IP_TOOLS),1)
- install -m 0755 ipmaddr $(BASEDIR)/sbin
+- install -m 0755 ipmaddr $(BASEDIR)/sbin
+- install -m 0755 iptunnel $(BASEDIR)/sbin
++ install -m 0755 ipmaddr $(BASEDIR)${SBINDIR}
++ install -m 0755 iptunnel $(BASEDIR)${SBINDIR}
+ endif
+ ifeq ($(HAVE_MII),1)
+- install -m 0755 mii-tool $(BASEDIR)/sbin
++ install -m 0755 mii-tool $(BASEDIR)${SBINDIR}
+ endif
+- ln -fs hostname $(BASEDIR)/bin/dnsdomainname
+- ln -fs hostname $(BASEDIR)/bin/ypdomainname
+- ln -fs hostname $(BASEDIR)/bin/nisdomainname
+- ln -fs hostname $(BASEDIR)/bin/domainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/dnsdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/ypdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/nisdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/domainname
+ ifeq ($(HAVE_AFDECnet),1)
+- ln -fs hostname $(BASEDIR)/bin/nodename
++ ln -fs hostname $(BASEDIR)${BINDIR}/nodename
+ endif
+
+ savebin:
+- @for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
+- ${BASEDIR}/bin/netstat \
+- ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
+- ${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
+- ${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
+- ${BASEDIR}/bin/domainname ; do \
++ @for i in ${BASEDIR}${SBINDIR}/arp ${BASEDIR}${SBINDIR}/ifconfig \
++ ${BASEDIR}${BINDIR}/netstat \
++ ${BASEDIR}${SBINDIR}/rarp ${BASEDIR}${SBINDIR}/route \
++ ${BASEDIR}${BINDIR}/hostname ${BASEDIR}${BINDIR}/ypdomainname \
++ ${BASEDIR}${BINDIR}/dnsdomainname ${BASEDIR}${BINDIR}/nisdomainname \
++ ${BASEDIR}${BINDIR}/domainname ; do \
+ [ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
+
+ installdata:
diff --git a/README b/README
index 4e35868..aa6cc9a 100644
--- a/README
@@ -904,7 +1102,7 @@ index 9859b59..64b594f 100755
> config.new
> ${CONFIG}
diff --git a/hostname.c b/hostname.c
-index 8793fb9..3508224 100644
+index 8793fb9..ae98ca6 100644
--- a/hostname.c
+++ b/hostname.c
@@ -6,23 +6,22 @@
@@ -971,7 +1169,14 @@ index 8793fb9..3508224 100644
static char *program_name;
static int opt_v;
-@@ -78,6 +85,7 @@ static void setnname(char *nname)
+@@ -72,12 +79,13 @@ static void setnname(char *nname)
+ if (setnodename(nname, strlen(nname))) {
+ switch(errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the node name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the node name\n"), program_name);
+ break;
+ case EINVAL:
fprintf(stderr, _("%s: name too long\n"), program_name);
break;
default:
@@ -979,7 +1184,13 @@ index 8793fb9..3508224 100644
}
exit(1);
}
-@@ -97,7 +105,6 @@ static void sethname(char *hname)
+@@ -92,12 +100,11 @@ static void sethname(char *hname)
+ if (sethostname(hname, strlen(hname))) {
+ switch (errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the host name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the host name\n"), program_name);
+ break;
case EINVAL:
fprintf(stderr, _("%s: name too long\n"), program_name);
break;
@@ -987,7 +1198,13 @@ index 8793fb9..3508224 100644
}
exit(1);
};
-@@ -116,7 +123,6 @@ static void setdname(char *dname)
+@@ -111,12 +118,11 @@ static void setdname(char *dname)
+ if (setdomainname(dname, strlen(dname))) {
+ switch (errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the domain name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the domain name\n"), program_name);
+ break;
case EINVAL:
fprintf(stderr, _("%s: name too long\n"), program_name);
break;
@@ -2236,7 +2453,7 @@ index 2134e81..e4ed41d 100644
if (argv[1][0] != '-')
break;
diff --git a/iptunnel.c b/iptunnel.c
-index 4943d83..2215d68 100644
+index 4943d83..ddf43b2 100644
--- a/iptunnel.c
+++ b/iptunnel.c
@@ -68,13 +68,11 @@
@@ -2367,14 +2584,18 @@ index 4943d83..2215d68 100644
while (fgets(buf, sizeof(buf), fp) != NULL) {
char *ptr;
-@@ -485,6 +488,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
+@@ -485,9 +488,10 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
if ((ptr = strchr(buf, ':')) == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
fprintf(stderr, _("Wrong format of /proc/net/dev. Sorry.\n"));
+ fclose(fp);
return -1;
}
- if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
+- if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
++ if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*u%lu%lu%lu%lu%lu%lu%lu",
+ &rx_bytes, &rx_packets, &rx_errs, &rx_drops,
+ &rx_fifo, &rx_frame, &rx_multi,
+ &tx_bytes, &tx_packets, &tx_errs, &tx_drops,
@@ -521,6 +525,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
tx_packets, tx_bytes, tx_errs, tx_colls, tx_carrier, tx_drops);
}
@@ -2424,7 +2645,7 @@ index d714b2e..431f258 100644
.SUFFIXES: .a .so
diff --git a/lib/af.c b/lib/af.c
-index 4f002c4..36bf03c 100644
+index 4f002c4..0500a0a 100644
--- a/lib/af.c
+++ b/lib/af.c
@@ -2,7 +2,7 @@
@@ -2467,7 +2688,7 @@ index 4f002c4..36bf03c 100644
0, 0, 0
}
};
-@@ -193,7 +201,7 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
+@@ -193,15 +201,14 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
char *tmp;
char *buf;
@@ -2476,7 +2697,16 @@ index 4f002c4..36bf03c 100644
if (!(tmp = strrchr(argv0, '/')))
tmp = argv0; /* no slash?! */
-@@ -219,7 +227,7 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
+ else
+ tmp++;
+
+- if (!(buf = strdup(tmp)))
+- return;
++ buf = xstrdup(tmp);
+
+ if (strlen(tool) >= strlen(tmp)) {
+ free(buf);
+@@ -219,7 +226,7 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
afname[0] = '\0';
if (aftrans_opt(buf))
@@ -2485,7 +2715,7 @@ index 4f002c4..36bf03c 100644
free(buf);
}
-@@ -296,7 +304,6 @@ int aftrans_opt(const char *arg)
+@@ -296,7 +303,6 @@ int aftrans_opt(const char *arg)
if (tmp2)
*(tmp2++) = '\0';
@@ -2493,7 +2723,7 @@ index 4f002c4..36bf03c 100644
for (paft = aftrans; paft->alias; paft++) {
if (strcmp(tmp1, paft->alias))
continue;
-@@ -335,7 +342,7 @@ void print_aflist(int type) {
+@@ -335,7 +341,7 @@ void print_aflist(int type) {
if ((type == 1 && ((*afp)->rprint == NULL)) || ((*afp)->af == 0)) {
afp++; continue;
}
@@ -3625,7 +3855,7 @@ index 0000000..1eeb7f0
+
+#endif /* HAVE_HWIB */
diff --git a/lib/inet.c b/lib/inet.c
-index ae90664..8fd38b7 100644
+index ae90664..fc23b17 100644
--- a/lib/inet.c
+++ b/lib/inet.c
@@ -3,7 +3,7 @@
@@ -3693,16 +3923,58 @@ index ae90664..8fd38b7 100644
int host = 0;
/* Grmpf. -FvK */
-@@ -155,7 +155,7 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+@@ -155,24 +155,34 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
errno = EAFNOSUPPORT;
return (-1);
}
- ad = (unsigned long) sin->sin_addr.s_addr;
+ ad = sin->sin_addr.s_addr;
#ifdef DEBUG
- fprintf (stderr, "rresolve: %08lx, mask %08x, num %08x \n", ad, netmask, numeric);
+- fprintf (stderr, "rresolve: %08lx, mask %08x, num %08x \n", ad, netmask, numeric);
++ fprintf (stderr, "rresolve: %08lx, mask %08x, num %08x, len %d\n", ad, netmask, numeric, len);
#endif
-@@ -210,12 +210,12 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
++
++ // if no symbolic names are requested we shortcut with ntoa
++ if (numeric & 0x0FFF) {
++ safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
++ return (0);
++ }
++
++ // we skip getnetbyaddr for 0.0.0.0/0 and 0.0.0.0/~0
+ if (ad == INADDR_ANY) {
+- if ((numeric & 0x0FFF) == 0) {
++ if (netmask == INADDR_ANY) {
++ // for 0.0.0.0/0 we hardcode symbolic name
+ if (numeric & 0x8000)
+ safe_strncpy(name, "default", len);
+ else
+ safe_strncpy(name, "*", len);
+ return (0);
++ } else {
++ // for 0.0.0.0/1 we skip getnetbyname()
++ safe_strncpy(name, "0.0.0.0", len);
++ return (0);
+ }
+ }
+- if (numeric & 0x0FFF) {
+- safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
+- return (0);
+- }
+
++ // it is a host address if flagged or any host bits set
+ if ((ad & (~netmask)) != 0 || (numeric & 0x4000))
+ host = 1;
+ #if 0
+@@ -183,7 +193,7 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+ if (pn->addr.sin_addr.s_addr == ad && pn->host == host) {
+ safe_strncpy(name, pn->name, len);
+ #ifdef DEBUG
+- fprintf (stderr, "rresolve: found %s %08lx in cache\n", (host? "host": "net"), ad);
++ fprintf (stderr, "rresolve: found %s %08lx in cache (name=%s, len=%d)\n", (host? "host": "net"), ad, name, len);
+ #endif
+ return (0);
+ }
+@@ -210,12 +220,11 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
}
if ((ent == NULL) && (np == NULL))
safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
@@ -3713,12 +3985,11 @@ index ae90664..8fd38b7 100644
pn->host = host;
- pn->name = (char *) malloc(strlen(name) + 1);
- strcpy(pn->name, name);
-+ pn->name = (char *) xmalloc(strlen(name) + 1);
-+ safe_strncpy(pn->name, name, sizeof(pn->name));
++ pn->name = xstrdup(name);
INET_nn = pn;
return (0);
-@@ -229,35 +229,35 @@ static void INET_reserror(char *text)
+@@ -229,35 +238,35 @@ static void INET_reserror(char *text)
/* Display an Internet socket address. */
@@ -3759,18 +4030,20 @@ index ae90664..8fd38b7 100644
numeric, netmask) != 0)
return (NULL);
return (buff);
-@@ -385,9 +385,7 @@ static int read_services(void)
+@@ -385,10 +394,8 @@ static int read_services(void)
setservent(1);
while ((se = getservent())) {
/* Allocate a service entry. */
- item = (struct service *) malloc(sizeof(struct service));
- if (item == NULL)
- perror("netstat");
+- item->name = strdup(se->s_name);
+ item = (struct service *) xmalloc(sizeof(struct service));
- item->name = strdup(se->s_name);
++ item->name = xstrdup(se->s_name);
item->number = se->s_port;
-@@ -398,15 +396,16 @@ static int read_services(void)
+ /* Fill it in. */
+@@ -398,16 +405,17 @@ static int read_services(void)
add2list(&udp_name, item);
} else if (!strcmp(se->s_proto, "raw")) {
add2list(&raw_name, item);
@@ -3786,11 +4059,13 @@ index ae90664..8fd38b7 100644
- item = (struct service *) malloc(sizeof(struct service));
- if (item == NULL)
- perror("netstat");
+- item->name = strdup(pe->p_name);
+ item = (struct service *) xmalloc(sizeof(struct service));
- item->name = strdup(pe->p_name);
++ item->name = xstrdup(pe->p_name);
item->number = htons(pe->p_proto);
add2list(&raw_name, item);
-@@ -416,35 +415,38 @@ static int read_services(void)
+ }
+@@ -416,35 +424,38 @@ static int read_services(void)
}
@@ -3846,7 +4121,7 @@ index ae90664..8fd38b7 100644
}
diff --git a/lib/inet6.c b/lib/inet6.c
-index 1f936b3..0b72dca 100644
+index 1f936b3..b428d07 100644
--- a/lib/inet6.c
+++ b/lib/inet6.c
@@ -3,7 +3,7 @@
@@ -3880,25 +4155,48 @@ index 1f936b3..0b72dca 100644
static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
{
struct addrinfo req, *ai;
-@@ -83,14 +98,14 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
+@@ -69,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
+ #endif
+
+
+-static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
++static int INET6_rresolve(char *name, size_t namelen,
++ struct sockaddr_in6 *sin6, int numeric)
+ {
+- int s;
+-
+ /* Grmpf. -FvK */
+ if (sin6->sin6_family != AF_INET6) {
+ #ifdef DEBUG
+@@ -83,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
return (-1);
}
if (numeric & 0x7FFF) {
- inet_ntop(AF_INET6, &sin6->sin6_addr, name, 80);
-+ inet_ntop( AF_INET6, &sin6->sin6_addr, name, 80);
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
return (0);
}
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
if (numeric & 0x8000)
- strcpy(name, "default");
-+ safe_strncpy(name, "default", sizeof(name));
++ safe_strncpy(name, "default", namelen);
else
- strcpy(name, "*");
-+ safe_strncpy(name, "[::]", sizeof(name));
++ safe_strncpy(name, "[::]", namelen);
return (0);
}
-@@ -109,19 +124,20 @@ static void INET6_reserror(char *text)
+- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
+- name, 255 /* !! */ , NULL, 0, 0))) {
+- fputs("getnameinfo failed\n", stderr);
+- return -1;
++ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
++ name, namelen , NULL, 0, 0)) {
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
+ }
+ return (0);
+ }
+@@ -109,41 +122,48 @@ static void INET6_reserror(char *text)
}
@@ -3922,9 +4220,11 @@ index 1f936b3..0b72dca 100644
{
static char buff[128];
-@@ -129,21 +145,26 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric)
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
+- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
++ if (INET6_rresolve(buff, sizeof(buff),
++ (struct sockaddr_in6 *) sap, numeric) != 0)
return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff));
- return (buff);
+ return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr));
@@ -3952,7 +4252,7 @@ index 1f936b3..0b72dca 100644
}
diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
-index 14f32eb..cd21a66 100644
+index 14f32eb..72b4a66 100644
--- a/lib/inet6_gr.c
+++ b/lib/inet6_gr.c
@@ -1,4 +1,4 @@
@@ -4002,7 +4302,7 @@ index 14f32eb..cd21a66 100644
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&prefix_len,
-@@ -87,13 +92,17 @@ int rprint_fib6(int ext, int numeric)
+@@ -87,20 +92,24 @@ int rprint_fib6(int ext, int numeric)
&slen,
naddr6p[0], naddr6p[1], naddr6p[2], naddr6p[3],
naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7],
@@ -4026,8 +4326,20 @@ index 14f32eb..cd21a66 100644
/* Fetch and resolve the target address. */
snprintf(addr6, sizeof(addr6), "%s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
-@@ -112,7 +121,12 @@ int rprint_fib6(int ext, int numeric)
- inet6_aftype.sprint((struct sockaddr *) &snaddr6, 1));
+ 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,10 +118,15 @@ int rprint_fib6(int ext, int numeric)
+ 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");
@@ -5882,10 +6194,10 @@ index adf54b2..ec82fe8 100644
if (atoi(buffer) == n) {
buffer[15] = 0;
diff --git a/lib/nstrcmp.c b/lib/nstrcmp.c
-index 8b1ff30..b1fed12 100644
+index 8b1ff30..e05c778 100644
--- a/lib/nstrcmp.c
+++ b/lib/nstrcmp.c
-@@ -1,34 +1,157 @@
+@@ -1,34 +1,190 @@
/* Copyright 1998 by Andi Kleen. Subject to the GPL. */
-/* $Id: nstrcmp.c,v 1.2 1998/11/15 20:11:38 freitag Exp $ */
+/* rewritten by bernd eckenfels because of complicated alias semantic */
@@ -5900,27 +6212,7 @@ index 8b1ff30..b1fed12 100644
+
+/* return numerical :999 suffix or null. sideeffect: replace ':' with \0 */
+char* cutalias(char* name)
- {
-- const char *a = astr;
--
-- while (*a == *b) {
-- if (*a == '\0')
-- return 0;
-- a++;
-- b++;
-- }
-- if (isdigit(*a)) {
-- if (!isdigit(*b))
-- return -1;
-- while (a > astr) {
-- a--;
-- if (!isdigit(*a)) {
-- a++;
-- break;
-- }
-- if (!isdigit(*b))
-- return -1;
-- b--;
++{
+ int digit = 0;
+ int pos;
+
@@ -5934,10 +6226,7 @@ index 8b1ff30..b1fed12 100644
+ if (!isdigit(name[pos-1]))
+ break;
+ digit = 1;
- }
-- return atoi(a) > atoi(b) ? 1 : -1;
-- }
-- return *a - *b;
++ }
+ return NULL;
+}
+
@@ -5959,8 +6248,8 @@ index 8b1ff30..b1fed12 100644
+/* like strcmp(), but knows about numbers and ':' alias suffix */
+int nstrcmp(const char *ap, const char *bp)
+{
-+ char *a = (char*)strdup(ap);
-+ char *b = (char*)strdup(bp);
++ char *a = xstrdup(ap);
++ char *b = xstrdup(bp);
+ char *an, *bn;
+ int av = 0, bv = 0;
+ char *aalias=cutalias(a);
@@ -5970,14 +6259,19 @@ index 8b1ff30..b1fed12 100644
+ int complen=(aindex<bindex)?aindex:bindex;
+ int res = strncmp(a, b, complen);
+
-+ if (res != 0)
-+ { free(a); free(b); return res; }
++ if (res != 0) {
++ goto out;
++ }
+
-+ if (aindex > bindex)
-+ { free(a); free(b); return 1; }
++ if (aindex > bindex) {
++ res = 1;
++ goto out;
++ }
+
-+ if (aindex < bindex)
-+ { free(a); free(b); return -1; }
++ if (aindex < bindex) {
++ res = -1;
++ goto out;
++ }
+
+ an = a+aindex;
+ bn = b+bindex;
@@ -5985,11 +6279,20 @@ index 8b1ff30..b1fed12 100644
+ av = atoi(an);
+ bv = atoi(bn);
+
-+ if (av < bv)
-+ { free(a); free(b); return -1; }
++ if (av < bv) {
++ res = -1;
++ goto out;
++ }
+
-+ if (av > bv)
-+ { free(a); free(b); return 1; }
++ if (av > bv) {
++ res = 1;
++ goto out;
++ }
++
++ res = strcmp(a, b);
++ if (res != 0) {
++ goto out;
++ }
+
+ av = -1;
+ if (aalias != NULL)
@@ -5999,15 +6302,25 @@ index 8b1ff30..b1fed12 100644
+ if (balias != NULL)
+ bv = atoi(balias);
+
-+ free(a); free(b);
++ if (av < bv) {
++ res = -1;
++ goto out;
++ }
+
-+ if (av < bv)
-+ return -1;
++ if (av > bv) {
++ res = 1;
++ goto out;
++ }
+
-+ if (av > bv)
-+ return 1;
++ if (aalias && balias) {
++ res = strcmp(aalias, balias);
++ }
+
-+ return 0;
++out:
++
++ free(a); free(b);
++
++ return res;
+}
+
+
@@ -6027,10 +6340,34 @@ index 8b1ff30..b1fed12 100644
+ int err = (cs(res) != cs(exp));
+ printf("nstrcmp(\"%s\", \"%s\")=%d %d %s\n", a, b, res, exp, err?"WRONG":"OK");
+ return err;
- }
++}
+
+int main()
-+{
+ {
+- const char *a = astr;
+-
+- while (*a == *b) {
+- if (*a == '\0')
+- return 0;
+- a++;
+- b++;
+- }
+- if (isdigit(*a)) {
+- if (!isdigit(*b))
+- return -1;
+- while (a > astr) {
+- a--;
+- if (!isdigit(*a)) {
+- a++;
+- break;
+- }
+- if (!isdigit(*b))
+- return -1;
+- b--;
+- }
+- return atoi(a) > atoi(b) ? 1 : -1;
+- }
+- return *a - *b;
+ int err = 0;
+
+ err |= dotest("eth1", "eth1", 0);
@@ -6065,8 +6402,17 @@ index 8b1ff30..b1fed12 100644
+ err |= dotest("a:", "a", 1);
+ err |= dotest("a1b12", "a1b2", 1);
+
++ err |= dotest("eth1", "eth01", 1);
++ err |= dotest("eth01", "eth1", -1);
++ err |= dotest("eth1:1", "eth01:1", 1);
++ err |= dotest("eth01:1", "eth1:1", -1);
++ err |= dotest("eth1:1", "eth01:01", 1);
++ err |= dotest("eth1:01", "eth01:1", 1);
++ err |= dotest("eth01:1", "eth1:01", -1);
++ err |= dotest("eth01:01", "eth1:1", -1);
++
+ return err;
-+}
+ }
+
+#endif
diff --git a/lib/pathnames.h b/lib/pathnames.h
@@ -6140,10 +6486,10 @@ index 8bf1499..27d660c 100644
* 980701 {1.12} Arnaldo Carvalho de Melo - GNU gettext instead of catgets
*
diff --git a/lib/proc.c b/lib/proc.c
-index bf34dbe..feea1d1 100644
+index bf34dbe..8e4711d 100644
--- a/lib/proc.c
+++ b/lib/proc.c
-@@ -1,11 +1,13 @@
+@@ -1,11 +1,14 @@
/* Tolerant /proc file parser. Copyright 1998 Andi Kleen */
-/* $Id: proc.c,v 1.4 1999/01/05 20:54:00 philip Exp $ */
-/* Fixme: cannot currently cope with removed fields */
@@ -6156,11 +6502,16 @@ index bf34dbe..feea1d1 100644
+#include <stdlib.h>
#include <ctype.h>
+#include <unistd.h>
++#include "util.h"
/* Caller must free return string. */
-@@ -49,7 +51,7 @@ char *proc_gen_fmt(char *name, int more, FILE * fh,...)
- return strdup(format);
+@@ -46,10 +49,10 @@ char *proc_gen_fmt(char *name, int more, FILE * fh,...)
+ name, title);
+ return NULL;
+ }
+- return strdup(format);
++ return xstrdup(format);
}
-/*
@@ -6168,7 +6519,7 @@ index bf34dbe..feea1d1 100644
* this will generate a bitmask of present/missing fields in the header of
* a /proc file.
*/
-@@ -72,3 +74,22 @@ int proc_guess_fmt(char *name, FILE *fh, ...)
+@@ -72,3 +75,22 @@ int proc_guess_fmt(char *name, FILE *fh, ...)
va_end(ap);
return flag;
}
@@ -6490,7 +6841,7 @@ index 43a7f1c..b077f35 100644
#ifdef RESOLVE_HOSTNAMES
if (resolve_hosts) {
diff --git a/lib/util.c b/lib/util.c
-index ac932f4..705c862 100644
+index ac932f4..0397f1e 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -1,4 +1,4 @@
@@ -6499,7 +6850,23 @@ index ac932f4..705c862 100644
/* $Id: util.c,v 1.4 1998/11/17 15:17:02 freitag Exp $ */
#include <stdio.h>
#include <stdlib.h>
-@@ -33,19 +33,19 @@ void *xrealloc(void *oldp, size_t sz)
+@@ -22,6 +22,15 @@ void *xmalloc(size_t sz)
+ return p;
+ }
+
++/* Like strdup, but oom() instead of NULL */
++char *xstrdup(const char *s)
++{
++ char *d = strdup(s);
++ if (!d)
++ oom();
++ return d;
++}
++
+ void *xrealloc(void *oldp, size_t sz)
+ {
+ void *p = realloc(oldp, sz);
+@@ -33,19 +42,19 @@ void *xrealloc(void *oldp, size_t sz)
int kernel_version(void)
{
struct utsname uts;
@@ -6525,10 +6892,18 @@ index ac932f4..705c862 100644
+ return strncpy(dst,src,size-1);
}
diff --git a/lib/util.h b/lib/util.h
-index 6acb158..97ce379 100644
+index 6acb158..b7598e8 100644
--- a/lib/util.h
+++ b/lib/util.h
-@@ -12,5 +12,8 @@ int kernel_version(void);
+@@ -2,6 +2,7 @@
+
+ void *xmalloc(size_t sz);
+ void *xrealloc(void *p, size_t sz);
++char *xstrdup(const char *src);
+
+ #define new(p) ((p) = xmalloc(sizeof(*(p))))
+
+@@ -12,5 +13,8 @@ int kernel_version(void);
int nstrcmp(const char *, const char *);
@@ -6539,7 +6914,7 @@ index 6acb158..97ce379 100644
+#define netmin(a,b) ((a)<(b) ? (a) : (b))
+#define netmax(a,b) ((a)>(b) ? (a) : (b))
diff --git a/lib/x25.c b/lib/x25.c
-index 1ffb569..5c7be2c 100644
+index 1ffb569..45de5af 100644
--- a/lib/x25.c
+++ b/lib/x25.c
@@ -38,6 +38,7 @@
@@ -6579,7 +6954,7 @@ index 1ffb569..5c7be2c 100644
char *p;
unsigned int sigdigits;
-@@ -88,7 +89,9 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+@@ -88,9 +89,11 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
/* Address the correct length ? */
if (strlen(bufp)>18) {
@@ -6588,9 +6963,12 @@ index 1ffb569..5c7be2c 100644
+ _("Address can't exceed eighteen digits with sigdigits"),
+ sizeof(X25_errmsg));
#ifdef DEBUG
- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
+- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
#endif
-@@ -105,8 +108,9 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+ errno = EINVAL;
+ return(-1);
+@@ -105,10 +108,11 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
}
if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) {
@@ -6600,9 +6978,24 @@ index 1ffb569..5c7be2c 100644
+ *p = '/';
+ safe_strncpy(X25_errmsg, _("Invalid address"), sizeof(X25_errmsg));
#ifdef DEBUG
- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
+- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
#endif
-@@ -152,7 +156,7 @@ struct hwtype x25_hwtype = {
+ errno = EINVAL;
+ return(-1);
+@@ -118,10 +122,7 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+
+ /* All done. */
+ #ifdef DEBUG
+- fprintf(stderr, "x25_input(%s): ", orig);
+- for (i = 0; i < sizeof(x25_address); i++)
+- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+- fprintf(stderr, "\n");
++ fprintf(stderr, "x25_input(%s)\n", bufp);
+ #endif
+
+ return sigdigits;
+@@ -152,7 +153,7 @@ struct hwtype x25_hwtype = {
};
struct aftype x25_aftype =
@@ -7075,7 +7468,7 @@ index aa2a4a0..9713965 100644
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br
diff --git a/man/de_DE/netstat.8 b/man/de_DE/netstat.8
-index f59aec0..d6b77ff 100644
+index f59aec0..fdb76c9 100644
--- a/man/de_DE/netstat.8
+++ b/man/de_DE/netstat.8
@@ -9,7 +9,7 @@
@@ -7087,7 +7480,16 @@ index f59aec0..d6b77ff 100644
.SH NAME
netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstatistiken, maskierten Verbindungen, Netlink-Nachrichten und Mitgliedschaft in Multicastgruppen
-@@ -44,7 +44,6 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+@@ -20,6 +20,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-groups | \-g ]
+ .RB [ \-\-unix | \-x ]
+@@ -44,7 +46,6 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
.B netstat
.RB [ \-veenpac ]
.RB { \-\-interfaces | \-i }
@@ -7095,7 +7497,7 @@ index f59aec0..d6b77ff 100644
.PP
-@@ -68,6 +67,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+@@ -68,6 +69,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
.SH BESCHREIBUNG
.B Netstat
zeigt Informationen des Linux Netzwerkssystems an.
@@ -7104,7 +7506,7 @@ index f59aec0..d6b77ff 100644
.SS "(no option)"
Ohne Optionen zeigt
-@@ -103,18 +104,17 @@ benutzt das Ausgabeformat von
+@@ -103,18 +106,17 @@ benutzt das Ausgabeformat von
Wegen Details siehe
.BR route (8).
@@ -7126,7 +7528,7 @@ index f59aec0..d6b77ff 100644
.BR ifconfig .
Die
.B -a
-@@ -182,7 +182,7 @@ Dies hat den gleichen Effekt wie die Langoptionen
+@@ -182,7 +184,7 @@ Dies hat den gleichen Effekt wie die Langoptionen
und
.BR \-\-ddp.
@@ -7135,7 +7537,7 @@ index f59aec0..d6b77ff 100644
Mit dieser Option wiederholt
.B netstat
im Sekundenabstand die Ausgabe, bis es abgebrochen wird.
-@@ -414,7 +414,7 @@ werden.)
+@@ -414,7 +416,7 @@ werden.)
Seit der Kern Version 2.2 zeigt netstat -i keine Schnittstellenstatistiken
von Schnittstellenaliasen mehr an. Um Statistiken per Schnittstelle zur
erhalten, m\(:ussen jetzt mit dem
@@ -7144,7 +7546,7 @@ index f59aec0..d6b77ff 100644
Befehl explizite Regeln zugef\(:ugt werden.
.SH DATEIEN
-@@ -477,10 +477,7 @@ Befehl explizite Regeln zugef\(:ugt werden.
+@@ -477,10 +479,7 @@ Befehl explizite Regeln zugef\(:ugt werden.
.SH SIEHE AUCH
.BR route (8),
.BR ifconfig (8),
@@ -7503,25 +7905,172 @@ index f3ba116..5a02892 100644
.\"}}}
.SH EXAMPLES \"{{{
diff --git a/man/en_US/hostname.1 b/man/en_US/hostname.1
-index cea3f6e..9f7dd7f 100644
+index cea3f6e..c45b7b6 100644
--- a/man/en_US/hostname.1
+++ b/man/en_US/hostname.1
-@@ -1,4 +1,4 @@
+@@ -1,66 +1,60 @@
-.TH HOSTNAME 1 "28 Jan 1996" "net-tools" "Linux Programmer's Manual"
-+.TH HOSTNAME 1 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
++.TH HOSTNAME 1 "2013\-08\-29" "net\-tools" "Linux System Administrator's Manual"
.SH NAME
hostname \- show or set the system's host name
-@@ -23,7 +23,7 @@ nodename \- show or set the system's DECnet node name
- .RB [ \-f ]
- .RB [ \-\-fqdn ]
- .RB [ \-i ]
+ .br
+-domainname \- show or set the system's NIS/YP domain name
+-.br
+ dnsdomainname \- show the system's DNS domain name
+ .br
+-nisdomainname \- show or set system's NIS/YP domain name
++domainname \- show or set the system's NIS/YP domain name
+ .br
+-ypdomainname \- show or set the system's NIS/YP domain name
++nisdomainname \- show or set system's NIS/YP domain name
+ .br
+ nodename \- show or set the system's DECnet node name
++.br
++ypdomainname \- show or set the system's NIS/YP domain name
+
+ .SH SYNOPSIS
+ .B hostname
+ .RB [ \-v ]
+-.RB [ \-a ]
+-.RB [ \-\-alias ]
+-.RB [ \-d ]
+-.RB [ \-\-domain ]
+-.RB [ \-f ]
+-.RB [ \-\-fqdn ]
+-.RB [ \-i ]
-.RB [ \-\-ip-address ]
-+.RB [ \-\-ip\-address ]
- .RB [ \-\-long ]
- .RB [ \-s ]
- .RB [ \-\-short ]
-@@ -181,7 +181,7 @@ part of the FQDN) in the \fI/etc/hosts\fR file.
+-.RB [ \-\-long ]
+-.RB [ \-s ]
+-.RB [ \-\-short ]
+-.RB [ \-y ]
+-.RB [ \-\-yp ]
+-.RB [ \-\-nis ]
+-.RB [ \-n ]
+-.RB [ \-\-node ]
++.RB [ \-s | \-\-short ]
++
++.PP
++.B hostname
++.RB [ \-v ]
++.RB [ \-a | \-\-alias ]
++.RB [ \-d | \-\-domain ]
++.RB [ \-f | \-\-fqdn | \-\-long ]
++.RB [ \-i | \-\-ip\-address ]
++
++.PP
++.B hostname
++.RB [ \-v ]
++.RB [ \-y | \-\-yp | \-\-nis ]
++.RB [ \-n | \-\-node ]
+
+ .PP
+ .B hostname
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ hostname ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B domainname
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ name ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B nodename
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ name ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B hostname
+-.RB [ \-v ]
+-.RB [ \-h ]
+-.RB [ \-\-help ]
+-.RB [ \-V ]
+-.RB [ \-\-version ]
++.RB [ \-v | \-\-verbose ]
++.RB [ \-h | \-\-help ]
++.RB [ \-V | \-\-version ]
+
+ .PP
+ .B dnsdomainname
+@@ -124,12 +118,8 @@ command (see
+ below).
+
+ .LP
+-The host name is usually set once at system startup in
+-.I /etc/rc.d/rc.inet1
+-or
+-.I /etc/init.d/boot
+-(normally by reading the contents of a file which contains
+-the host name, e.g.
++The host name is usually set once at system startup by reading the
++contents of a file which contains the host name, e.g.
+ .IR /etc/hostname ).
+
+ .SS THE FQDN
+@@ -142,16 +132,17 @@ with this command. The FQDN of the system is the name that the
+ returns for the host name.
+
+ .LP
+-Technically: The FQDN is the name
+-.BR gethostbyname (2)
+-returns for the host name returned by
+-.BR gethostname (2).
+-The DNS domain name is the part after the first dot.
++Technically: The FQDN is the canonical name returned by
++.BR gethostbyname2 (2)
++when resolving the result of the
++.BR gethostname (2)
++name. The DNS domain name is the part after the first dot.
+ .LP
+ Therefore it depends on the configuration (usually in
+ .IR /etc/host.conf )
+-how you can change it. Usually (if the hosts file is parsed before DNS or
+-NIS) you can change it in
++how you can change it. If
++.B hosts
++is the first lookup method, you can change the FQDN in
+ .IR /etc/hosts .
+
+
+@@ -161,27 +152,23 @@ NIS) you can change it in
+ Display the alias name of the host (if used).
+ .TP
+ .I "\-d, \-\-domain"
+-Display the name of the DNS domain. Don't use the command
+-.B domainname
+-to get the DNS domain name because it will show the NIS domain name and
+-not the DNS domain name. Use
++Display the name of the DNS domain (this is the FQDN without the segment up
++to the first dot). This is equivalent to using the
+ .B dnsdomainname
+-instead.
++command.
+ .TP
+ .I "\-F, \-\-file filename"
+-Read the host name from the specified file. Comments (lines starting with
++Read the new host name from the specified file. Comments (lines starting with
+ a `#') are ignored.
+ .TP
+ .I "\-f, \-\-fqdn, \-\-long"
+-Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a
+-short host name and the DNS domain name. Unless you are using bind or NIS
+-for host lookups you can change the FQDN and the DNS domain name (which is
+-part of the FQDN) in the \fI/etc/hosts\fR file.
++Display the FQDN (Fully Qualified Domain Name). A FQDN consists of name
++including the DNS domain.
+ .TP
.I "\-h, \-\-help"
Print a usage message and exit.
.TP
@@ -7530,9 +8079,14 @@ index cea3f6e..9f7dd7f 100644
Display the IP address(es) of the host.
.TP
.I "\-n, \-\-node"
-@@ -205,9 +205,9 @@ Display the NIS domain name. If a parameter is given (or
+@@ -203,11 +190,13 @@ Display the NIS domain name. If a parameter is given (or
+ .B \-\-file name
+ ) then root can also set a new NIS domain.
.SH FILES
++.B /etc/hostname
.B /etc/hosts
++.B /etc/host.conf
++
.SH AUTHOR
-Peter Tobias, <tobias@et-inf.fho-emden.de>
+Peter Tobias, <tobias@et\-inf.fho\-emden.de>
@@ -7541,7 +8095,7 @@ index cea3f6e..9f7dd7f 100644
+Bernd Eckenfels, <net\-tools@lina.inka.de> (NIS and manpage).
.br
Steve Whitehouse, <SteveW@ACM.org> (DECnet support and manpage).
-
+-
diff --git a/man/en_US/ifconfig.8 b/man/en_US/ifconfig.8
index e75cf59..0243be3 100644
--- a/man/en_US/ifconfig.8
@@ -7824,7 +8378,7 @@ index ff2430f..195304d 100644
.SH NOTES
diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8
-index b33996a..1aba23b 100644
+index b33996a..3157dc4 100644
--- a/man/en_US/netstat.8
+++ b/man/en_US/netstat.8
@@ -6,9 +6,10 @@
@@ -7839,11 +8393,12 @@ index b33996a..1aba23b 100644
.SH NAME
netstat \- Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
-@@ -19,17 +20,19 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+@@ -19,17 +20,20 @@ netstat \- Print network connections, routing tables, interface statistics, masq
.RI [ address_family_options ]
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
+.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [ \-\-listening | \-l ]
.RB [ \-\-all | \-a ]
@@ -7860,7 +8415,7 @@ index b33996a..1aba23b 100644
.P
.B netstat
.RB { \-\-route | \-r }
-@@ -37,37 +40,37 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+@@ -37,37 +41,38 @@ netstat \- Print network connections, routing tables, interface statistics, masq
.RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
.RB [ \-\-verbose | \-v ]
.RB [ \-\-numeric | \-n ]
@@ -7900,10 +8455,11 @@ index b33996a..1aba23b 100644
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
+.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.P
.B netstat
-@@ -78,13 +81,26 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+@@ -78,13 +83,26 @@ netstat \- Print network connections, routing tables, interface statistics, masq
.P
.IR address_family_options :
.PP
@@ -7933,7 +8489,7 @@ index b33996a..1aba23b 100644
.SH DESCRIPTION
.B Netstat
-@@ -98,12 +114,17 @@ displays a list of open sockets. If you don't specify any
+@@ -98,12 +116,17 @@ displays a list of open sockets. If you don't specify any
address families, then the active sockets of all configured address
families will be printed.
.SS "\-\-route , \-r"
@@ -7955,7 +8511,7 @@ index b33996a..1aba23b 100644
.SS "\-\-masquerade , \-M"
Display a list of masqueraded connections.
.SS "\-\-statistics , \-s"
-@@ -112,16 +133,19 @@ Display summary statistics for each protocol.
+@@ -112,16 +135,19 @@ Display summary statistics for each protocol.
.SS "\-\-verbose , \-v"
Tell the user what is going on by being verbose. Especially print some
useful information about unconfigured address families.
@@ -7978,7 +8534,7 @@ index b33996a..1aba23b 100644
shows numerical user IDs but does not affect the resolution of host or
port names.
-@@ -131,15 +155,18 @@ protocols) for which connections are to be shown.
+@@ -131,15 +157,18 @@ protocols) for which connections are to be shown.
.I family
is a comma (',') separated list of address family keywords like
.BR inet ,
@@ -7999,7 +8555,7 @@ index b33996a..1aba23b 100644
.BR \-\-ipx ,
.BR \-\-ax25 ,
.BR \-\-netrom ,
-@@ -149,7 +176,7 @@ options.
+@@ -149,7 +178,7 @@ options.
.P
The address family
.B inet
@@ -8008,7 +8564,7 @@ index b33996a..1aba23b 100644
.SS "\-c, \-\-continuous"
This will cause
.B netstat
-@@ -164,23 +191,24 @@ Show the PID and name of the program to which each socket belongs.
+@@ -164,23 +193,24 @@ Show the PID and name of the program to which each socket belongs.
Show only listening sockets. (These are omitted by default.)
.SS "\-a, \-\-all"
Show both listening and non-listening sockets. With the
@@ -8042,7 +8598,7 @@ index b33996a..1aba23b 100644
.SS "Local Address"
Address and port number of the local end of the socket. Unless the
.BR \-\-numeric " (" \-n )
-@@ -192,7 +220,7 @@ Address and port number of the remote end of the socket.
+@@ -192,7 +222,7 @@ Address and port number of the remote end of the socket.
Analogous to "Local Address."
.SS "State"
The state of the socket. Since there are no states in raw mode and usually no
@@ -8051,7 +8607,7 @@ index b33996a..1aba23b 100644
of several values:
.TP
.I
-@@ -221,7 +249,7 @@ TIME_WAIT
+@@ -221,7 +251,7 @@ TIME_WAIT
The socket is waiting after close to handle packets still in the network.
.TP
.I
@@ -8060,7 +8616,7 @@ index b33996a..1aba23b 100644
The socket is not being used.
.TP
.I
-@@ -255,7 +283,7 @@ The username or the user id (UID) of the owner of the socket.
+@@ -255,7 +285,7 @@ The username or the user id (UID) of the owner of the socket.
.SS "PID/Program name"
Slash-separated pair of the process id (PID) and process name of the
process that owns the socket.
@@ -8069,7 +8625,7 @@ index b33996a..1aba23b 100644
causes this column to be included. You will also need
.I superuser
privileges to see this information on sockets you don't own. This
-@@ -356,13 +384,6 @@ to the socket.
+@@ -356,13 +386,6 @@ to the socket.
.SS Active AX.25 sockets
(this needs to be done by somebody who knows it)
.PP
@@ -8083,7 +8639,7 @@ index b33996a..1aba23b 100644
.SH FILES
.ta
-@@ -385,6 +406,9 @@ status information via the following files.
+@@ -385,6 +408,9 @@ status information via the following files.
.I /proc/net/udp
-- UDP socket information
@@ -8093,7 +8649,7 @@ index b33996a..1aba23b 100644
.I /proc/net/igmp
-- IGMP multicast information
-@@ -428,9 +452,10 @@ status information via the following files.
+@@ -428,9 +454,10 @@ status information via the following files.
.SH SEE ALSO
.BR route (8),
.BR ifconfig (8),
@@ -8105,7 +8661,7 @@ index b33996a..1aba23b 100644
.P
.SH BUGS
Occasionally strange information may appear if a socket changes
-@@ -438,12 +463,10 @@ as it is viewed. This is unlikely to occur.
+@@ -438,12 +465,10 @@ as it is viewed. This is unlikely to occur.
.P
.SH AUTHORS
The netstat user interface was written by Fred Baumgarten
@@ -8193,12 +8749,12 @@ index e462799..d9d31f9 100644
can be used. For the Ethernet class, this is 6 bytes in hexadecimal,
separated by colons.
diff --git a/man/en_US/route.8 b/man/en_US/route.8
-index f59c074..3d97077 100644
+index f59c074..19895e9 100644
--- a/man/en_US/route.8
+++ b/man/en_US/route.8
-@@ -1,14 +1,18 @@
+@@ -1,57 +1,62 @@
-.TH ROUTE 8 "2 January 2000" "net-tools" "Linux Programmer's Manual"
-+.TH ROUTE 8 "2013\-06\-15" "net\-tools" "Linux System Administrator's Manual"
++.TH ROUTE 8 "2014\-02\-17" "net\-tools" "Linux System Administrator's Manual"
.SH NAME
route \- show / manipulate the IP routing table
.SH SYNOPSIS
@@ -8217,18 +8773,58 @@ index f59c074..3d97077 100644
+.RB | \-4 | \-6 ]
.B add
.RB [ \-net | \-host ]
- target
-@@ -34,7 +38,8 @@ If]
+-target
++.I target
+ .RB [ netmask
+-Nm]
++.IR Nm ]
+ .RB [ gw
+-Gw]
++.IR Gw ]
+ .RB [ metric
+-N]
++.IR N ]
+ .RB [ mss
+-M]
++.IR M ]
+ .RB [ window
+-W]
++.IR W ]
+ .RB [ irtt
+-I]
++.IR I ]
+ .RB [ reject ]
+ .RB [ mod ]
+ .RB [ dyn ]
+ .RB [ reinstate ]
+ .RB [[ dev ]
+-If]
++.IR If ]
+ .TP
.B route
.RB [ \-v ]
.RB [ \-A
-family]
-+family
++.I family
+.RB | \-4 | \-6 ]
.B del
.RB [ \-net | \-host ]
- target
-@@ -51,7 +56,7 @@ If]
+-target
++.I target
+ .RB [ gw
+-Gw]
++.IR Gw ]
+ .RB [ netmask
+-Nm]
++.IR Nm ]
+ .RB [ metric
+-N]
++.IR M ]
+ .RB [[ dev ]
+-If]
++.IR If ]
+ .TP
+ .B route
.RB [ \-V ]
.RB [ \-\-version ]
.RB [ \-h ]
@@ -8237,12 +8833,14 @@ index f59c074..3d97077 100644
.SH DESCRIPTION
.B Route
manipulates the kernel's IP routing tables. Its primary use is to set
-@@ -73,16 +78,25 @@ displays the current contents of the routing tables.
+@@ -72,19 +77,27 @@ displays the current contents of the routing tables.
+
.SH OPTIONS
.TP
- .B \-A family
+-.B \-A family
-use the specified address family (eg `inet'; use `route --help' for a full
-list).
++\fB\-A \fIfamily\fR
+use the specified address family (eg `inet'). Use
+.B route \-\-help
+for a full list. You can use
@@ -8252,7 +8850,7 @@ index f59c074..3d97077 100644
+and
+.B \-4
+as an alias for
-+.B -A inet
++.B \-A inet
+.
.TP
@@ -8265,9 +8863,11 @@ index f59c074..3d97077 100644
-.B -C
+.B \-C
operate on the kernel's routing cache.
-
+-
.TP
-@@ -96,7 +110,7 @@ nameserver has vanished.
+ .B \-v
+ select verbose operation.
+@@ -96,11 +109,10 @@ nameserver has vanished.
.TP
.B \-e
use
@@ -8276,32 +8876,106 @@ index f59c074..3d97077 100644
for displaying the routing table.
.B \-ee
will generate a very long line with all parameters from the routing table.
-@@ -117,7 +131,7 @@ the
- .B target
+-
+ .TP
+ .B del
+ delete a route.
+@@ -108,25 +120,27 @@ delete a route.
+ .B add
+ add a new route.
+ .TP
+-.B target
+-the destination network or host. You can provide IP addresses in dotted
+-decimal or host/network names.
++.I target
++the destination network or host. You can provide an addresses or symbolic
++network or host name. Optionally you can use \fB/\fIprefixlen\fR notation
++instead of using the \fBnetmask\fR option.
+ .TP
+ .B \-net
+ the
+-.B target
++.I target
is a network.
.TP
-.B -host
+.B \-host
the
- .B target
+-.B target
++.I target
is a host.
-@@ -138,12 +152,9 @@ compatibility hack.
- set the metric field in the routing table (used by routing daemons) to M.
+ .TP
+-.B netmask NM
++\fBnetmask \fINM\fR
+ when adding a network route, the netmask to be used.
+ .TP
+-.B gw GW
++\fBgw \fIGW\fR
+ route packets via a gateway.
++.br
+ .B NOTE:
+ The specified gateway must be reachable first. This usually means that
+ you have to set up a static route to the gateway beforehand. If you specify
+@@ -134,91 +148,94 @@ the address of one of your local interfaces, it will be used to decide about
+ the interface to which the packets should be routed to. This is a BSDism
+ compatibility hack.
+ .TP
+-.B metric M
+-set the metric field in the routing table (used by routing daemons) to M.
++\fBmetric \fIM\fR
++set the metric field in the routing table (used by routing daemons) to \fIM\fR. If this option is not specified the metric for inet6 (IPv6) address family defaults to '1', for inet (IPv4) it defaults to '0'. You should always specify an explicit metric value to not rely on those defaults - they also differ from iproute2.
.TP
- .B mss M
+-.B mss M
-set the TCP Maximum Segment Size (MSS) for connections over this route
-to M bytes.
-The default is the device MTU minus headers, or a lower MTU when path mtu
-discovery occured. This setting can be used to force smaller TCP packets on the
-other end when path mtu discovery does not work (usually because of
-misconfigured firewalls that block ICMP Fragmentation Needed)
-+sets MTU (Maximum Transmission Unit) of the route to M bytes.
++\fBmss \fIM\fR
++sets MTU (Maximum Transmission Unit) of the route to \fIM\fR bytes.
+Note that the current implementation of the route command does not allow
+the option to set the Maximum Segment Size (MSS).
.TP
- .B window W
- set the TCP window size for connections over this route to W
-@@ -179,24 +190,27 @@ modifiers (metric - netmask - gw - dev) doesn't matter.
+-.B window W
+-set the TCP window size for connections over this route to W
++\fBwindow \fIW\fR
++set the TCP window size for connections over this route to \fIW\fR
+ bytes. This is typically only used on AX.25 networks and with drivers
+ unable to handle back to back frames.
+ .TP
+-.B irtt I
++\fBirtt \fII\fR
+ set the initial round trip time (irtt) for TCP connections over this
+-route to I milliseconds (1-12000). This is typically only used on
++route to \fII\fR milliseconds (1-12000). This is typically only used on
+ AX.25 networks. If omitted the RFC 1122 default of 300ms is used.
+ .TP
+ .B reject
+ install a blocking route, which will force a route lookup to fail.
+ This is for example used to mask out networks before using the default
+-route. This is NOT for firewalling.
++route. This is NOT for firewalling.
+ .TP
+ .B mod, dyn, reinstate
+ install a dynamic or modified route. These flags are for diagnostic
+ purposes, and are generally only set by routing daemons.
+ .TP
+-.B dev If
++\fBdev \fIIf\fR
+ force the route to be associated with the specified device, as the
+ kernel will otherwise try to determine the device on its own (by
+ checking already existing routes and device specifications, and where
+ the route is added to). In most normal networks you won't need this.
+
+-If
+-.B dev If
++If \fBdev \fIIf\fR
+ is the last option on the command line, the word
+ .B dev
+ may be omitted, as it's the default. Otherwise the order of the route
+-modifiers (metric - netmask - gw - dev) doesn't matter.
++modifiers (\fBmetric netmask gw dev\fR) doesn't matter.
.SH EXAMPLES
.TP
@@ -8309,7 +8983,7 @@ index f59c074..3d97077 100644
-adds the normal loopback entry, using netmask 255.0.0.0 (class A net,
-determined from the destination address) and associated with the
-"lo" device (assuming this device was prviously set up correctly with
-+.B route add \-net 127.0.0.0 netmask 255.0.0.0 dev lo
++.B route add \-net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo
+adds the normal loopback entry, using netmask 255.0.0.0 and associated with the
+"lo" device (assuming this device was previously set up correctly with
.BR ifconfig (8)).
@@ -8319,33 +8993,38 @@ index f59c074..3d97077 100644
-adds a route to the network 192.56.76.x via
-"eth0". The Class C netmask modifier is not really necessary here because
-192.* is a Class C IP address. The word "dev" can be omitted here.
-+.B route add \-net 192.56.76.0 netmask 255.255.255.0 dev eth0
++.B route add \-net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0
+adds a route to the local network 192.56.76.x via
+"eth0". The word "dev" can be omitted here.
-+
-+.TP
-+.B route del default
-+deletes the current default route, which is labeled "default" or 0.0.0.0
-+in the destination field of the current routing table.
.TP
-.B route add default gw mango-gw
-+.B route add default gw mango\-gw
++.B route del default
++deletes the current default route, which is labeled "default" or 0.0.0.0
++in the destination field of the current routing table.
++
++.TP
++.B route add default gw mango
adds a default route (which will be used if no other route matches).
-All packets using this route will be gatewayed through "mango-gw". The
-+All packets using this route will be gatewayed through "mango\-gw". The
++All packets using this route will be gatewayed through the address of a node
++named "mango". The
device which will actually be used for that route depends on how we
-can reach "mango-gw" - the static route to "mango-gw" will have to be
-+can reach "mango\-gw" - the static route to "mango\-gw" will have to be
- set up before.
+-set up before.
++can reach "mango" - "mango" must be on directly reachable route.
.TP
-@@ -205,18 +219,18 @@ Adds the route to the "ipx4" host via the SLIP interface (assuming that
- "ipx4" is the SLIP host).
+-.B route add ipx4 sl0
+-Adds the route to the "ipx4" host via the SLIP interface (assuming that
+-"ipx4" is the SLIP host).
++.B route add mango sl0
++Adds the route to the host named "mango" via the SLIP interface (assuming that
++"mango" is the SLIP host).
.TP
-.B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
-+.B route add \-net 192.57.66.0 netmask 255.255.255.0 gw ipx4
++.B route add \-net 192.57.66.0 netmask 255.255.255.0 gw mango
This command adds the net "192.57.66.x" to be gatewayed through the former
route to the SLIP interface.
@@ -8358,11 +9037,25 @@ index f59c074..3d97077 100644
.TP
-.B route add -net 10.0.0.0 netmask 255.0.0.0 reject
-+.B route add \-net 10.0.0.0 netmask 255.0.0.0 reject
++.B route add \-net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject
This installs a rejecting route for the private network "10.x.x.x."
++.TP
++.B route -6 add 2001:0002::/48 metric 1 dev eth0
++This adds a IPv6 route with the specified metric to be directly reachable via eth0.
++
.LP
-@@ -282,14 +296,14 @@ recent kernels, but may be needed by routing daemons.
+ .SH OUTPUT
+ The output of the kernel routing table is organized in the following columns
+@@ -275,21 +292,20 @@ entry)
+ route)
+ .TP
+ .B Metric
+-The 'distance' to the target (usually counted in hops). It is not used by
+-recent kernels, but may be needed by routing daemons.
++The 'distance' to the target (usually counted in hops).
+ .TP
+ .B Ref
Number of references to this route. (Not used in the Linux kernel.)
.TP
.B Use
@@ -8380,7 +9073,22 @@ index f59c074..3d97077 100644
.TP
.B Window
Default window size for TCP connections over this route.
-@@ -323,4 +337,4 @@ for Linux was originally written by Fred N. van Kempen,
+@@ -313,8 +329,12 @@ Whether or not the hardware address for the cached route is up to date.
+ .br
+ .I /proc/net/rt_cache
+ .LP
+-.SH SEE ALSO
+-.I ifconfig(8), netstat(8), arp(8), rarp(8)
++.SH "SEE ALSO"
++.IR ifconfig (8),
++.IR netstat (8),
++.IR arp (8),
++.IR rarp (8),
++.IR ip (8)
+ .LP
+ .SH HISTORY
+ .B Route
+@@ -323,4 +343,4 @@ for Linux was originally written by Fred N. van Kempen,
Linus Torvalds for pl15. Alan Cox added the mss and window options for
Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.
.SH AUTHOR
@@ -9354,7 +10062,7 @@ index 0c29eb0..821f164 100644
+N'hésitez pas à signaler à l'auteur ou au traducteur, selon le cas, toute
+erreur dans cette page de manuel.
diff --git a/man/fr_FR/netstat.8 b/man/fr_FR/netstat.8
-index bf16bc6..fedbe4f 100644
+index bf16bc6..c65d0be 100644
--- a/man/fr_FR/netstat.8
+++ b/man/fr_FR/netstat.8
@@ -8,11 +8,11 @@
@@ -9372,7 +10080,16 @@ index bf16bc6..fedbe4f 100644
et les membres multicast.
.SH SYNOPSIS
-@@ -68,34 +68,34 @@ et les membres multicast.
+@@ -21,6 +21,8 @@ et les membres multicast.
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-groups | \-g ]
+ .RB [ \-\-unix | \-x ]
+@@ -68,34 +70,34 @@ et les membres multicast.
.PP
.SH DESCRIPTION
.B Netstat
@@ -9421,7 +10138,7 @@ index bf16bc6..fedbe4f 100644
commande
.B "route -e"
.
-@@ -104,44 +104,44 @@ utilisera le format de la commande
+@@ -104,44 +106,44 @@ utilisera le format de la commande
.BR route .
Veuillez consulter
.BR route (8)
@@ -9486,7 +10203,7 @@ index bf16bc6..fedbe4f 100644
.I /dev/route
(36,0).
-@@ -149,23 +149,23 @@ suppression d'interfaces ou de routes
+@@ -149,23 +151,23 @@ suppression d'interfaces ou de routes
.SH OPTIONS
.SS "\-v, \-\-verbose"
active le mode verbeux. Affiche quelques informations utiles concernant les
@@ -9518,7 +10235,7 @@ index bf16bc6..fedbe4f 100644
.BR inet ,
.BR unix ,
.BR ipx ,
-@@ -173,7 +173,7 @@ est une liste de familles d'adresses s
+@@ -173,7 +175,7 @@ est une liste de familles d'adresses s
.B netrom
et
.BR ddp .
@@ -9527,7 +10244,7 @@ index bf16bc6..fedbe4f 100644
.BR \-\-inet ,
.BR \-\-unix ,
.BR \-\-ipx ,
-@@ -183,9 +183,9 @@ et
+@@ -183,9 +185,9 @@ et
.BR \-\-ddp.
.SS "\-c, \-\-continous"
@@ -9539,7 +10256,7 @@ index bf16bc6..fedbe4f 100644
l'interrompiez.
.PP
-@@ -195,102 +195,102 @@ l'interrompiez.
+@@ -195,102 +197,102 @@ l'interrompiez.
.SS Connexions Internet actives \fR(TCP, UDP, RAW)\fR
.SS "Proto"
@@ -9674,7 +10391,7 @@ index bf16bc6..fedbe4f 100644
.PP
-@@ -298,28 +298,28 @@ avec les sockets IPX.
+@@ -298,28 +300,28 @@ avec les sockets IPX.
.SS "Proto"
@@ -9711,7 +10428,7 @@ index bf16bc6..fedbe4f 100644
.TP
.I
SOCK_STREAM
-@@ -327,90 +327,89 @@ C'est une socket `stream' (connexion).
+@@ -327,90 +329,89 @@ C'est une socket `stream' (connexion).
.TP
.I
SOCK_RAW
@@ -9823,7 +10540,7 @@ index bf16bc6..fedbe4f 100644
.SH FICHIERS
.ta
-@@ -418,7 +417,7 @@ devez d
+@@ -418,7 +419,7 @@ devez d
-- Le fichier de correspondance des services
.I /proc/net/dev
@@ -9832,7 +10549,7 @@ index bf16bc6..fedbe4f 100644
.I /proc/net/raw
-- informations sockets RAW
-@@ -471,31 +470,28 @@ devez d
+@@ -471,31 +472,28 @@ devez d
.SH VOIR AUSSI
.BR route (8),
.BR ifconfig (8),
@@ -11195,7 +11912,7 @@ index 0a97683..1432dc5 100644
+Jorge Luiz Godoy Filho <jorge@bestway.com.br> (revisão)
diff --git a/man/pt_BR/netstat.8 b/man/pt_BR/netstat.8
-index b9b359a..1903bbb 100644
+index b9b359a..d2d04ef 100644
--- a/man/pt_BR/netstat.8
+++ b/man/pt_BR/netstat.8
@@ -5,13 +5,13 @@
@@ -11215,7 +11932,16 @@ index b9b359a..1903bbb 100644
mascaradas.
.SH SINOPSE
-@@ -63,90 +63,90 @@ mascaradas.
+@@ -19,6 +19,8 @@ mascaradas.
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-unix | \-x ]
+ .RB [ \-\-inet | \-\-ip ]
+@@ -63,90 +65,90 @@ mascaradas.
.RB { \-h | \-\-help }
.PP
@@ -11346,7 +12072,7 @@ index b9b359a..1903bbb 100644
(',') como
.BR inet ,
.BR unix ,
-@@ -155,7 +155,7 @@ Usa um m
+@@ -155,7 +157,7 @@ Usa um m
.B netrom
e
.BR ddp .
@@ -11355,7 +12081,7 @@ index b9b359a..1903bbb 100644
.BR \-\-inet ,
.BR \-\-unix ,
.BR \-\-ipx ,
-@@ -165,99 +165,99 @@ e
+@@ -165,99 +167,99 @@ e
.BR \-\-ddp.
.SS "\-c, \-\-continuous"
@@ -11488,7 +12214,7 @@ index b9b359a..1903bbb 100644
O nome ou UID do dono do socket.
.SS "Temporizador"
-@@ -272,198 +272,195 @@ O nome ou UID do dono do socket.
+@@ -272,198 +274,195 @@ O nome ou UID do dono do socket.
O protocolo (normalmente unix) usado pelo socket.
.SS "CntRef"
@@ -13166,7 +13892,7 @@ index 8d79b50..b280e59 100644
+}
diff --git a/netstat.c b/netstat.c
-index 1ef790e..4f62e87 100644
+index 1ef790e..d0c364f 100644
--- a/netstat.c
+++ b/netstat.c
@@ -6,7 +6,7 @@
@@ -13662,7 +14388,7 @@ index 1ef790e..4f62e87 100644
- prg_cache_add(inode, finbuf);
+#if HAVE_SELINUX
+ if (getpidcon(atoi(direproc->d_name), &scon) == -1) {
-+ scon=strdup("-");
++ scon=xstrdup("-");
+ }
+ prg_cache_add(inode, finbuf, scon);
+ freecon(scon);
@@ -14413,7 +15139,7 @@ index 1ef790e..4f62e87 100644
}
printf(_("Active IPX sockets\nProto Recv-Q Send-Q Local Address Foreign Address State")); /* xxx */
if (flag_exp > 1)
-@@ -1369,9 +1596,11 @@ static int ipx_info(void)
+@@ -1369,19 +1596,22 @@ static int ipx_info(void)
printf("\n");
if ((ap = get_afntype(AF_IPX)) == NULL) {
EINTERN("netstat.c", "AF_IPX missing");
@@ -14425,8 +15151,11 @@ index 1ef790e..4f62e87 100644
+ /* eat line */;
while (fgets(buf, 255, f) != NULL) {
- sscanf(buf, "%s %s %lX %lX %d %d",
-@@ -1381,7 +1610,8 @@ static int ipx_info(void)
+- sscanf(buf, "%s %s %lX %lX %d %d",
++ sscanf(buf, "%s %s %lX %lX %u %u",
+ sad, dad, &txq, &rxq, &state, &uid);
+ if ((st = rindex(sad, ':'))) {
+ *st++ = '\0';
sscanf(st, "%X", &sport); /* net byt order */
sport = ntohs(sport);
} else {
@@ -14441,7 +15170,7 @@ index 1ef790e..4f62e87 100644
dport = ntohs(dport);
} else {
- EINTERN("netstat.c", _PATH_PROCNET_IPX " dport format error");
-+ EINTERN("netstat.c", "ipx soket format error in destination port");
++ EINTERN("netstat.c", "ipx socket format error in destination port");
+ fclose(f);
return (-1);
}
@@ -14651,8 +15380,8 @@ index 1ef790e..4f62e87 100644
- 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, _("\n <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix}\n"));
-+ fprintf(stderr, _(" --ax25 --ipx --netrom\n"));
++ fprintf(stderr, _("\n <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}\n"));
++ fprintf(stderr, _(" {-x|--unix} --ax25 --ipx --netrom\n"));
+ fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
fprintf(stderr, _(" List of possible address families (which support routing):\n"));
print_aflist(1); /* 1 = routeable */
@@ -19641,7 +20370,7 @@ index b4b66a1..c1d6a8a 100644
-#~ msgstr " jmna potae) v souboru /etc/hosts.\n"
+#~ msgstr " jména počítače) v souboru /etc/hosts.\n"
diff --git a/po/de.po b/po/de.po
-index f884dd9..309829a 100644
+index f884dd9..9f8f679 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,4 +1,4 @@
@@ -19659,7 +20388,18 @@ index f884dd9..309829a 100644
"Content-Transfer-Encoding: 8bit\n"
#: ../arp.c:110 ../arp.c:269
-@@ -64,7 +64,7 @@ msgstr "Adresse\t\t\tHWTyp\tHWAdresse\t Flags Maske\t\t Iface\n"
+@@ -59,12 +59,16 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: Kann Eintrag auf Zeile %u von Etherdatei %s nicht setzen!\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Adresse\t\t\tHWTyp\tHWAdresse\t Flags Maske\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Adresse HW-Typ HW-Adresse Flags Maske "
++"Iface\n"
#: ../arp.c:467
msgid "(incomplete)"
@@ -21237,7 +21977,7 @@ index d748410..827406d 100644
msgstr "Ei saa avada soklit"
diff --git a/po/fr.po b/po/fr.po
-index e8e7542..d021e0f 100644
+index e8e7542..e4e8245 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -9,7 +9,7 @@ msgstr ""
@@ -21249,6 +21989,21 @@ index e8e7542..d021e0f 100644
"Content-Transfer-Encoding: 8bit\n"
#: ../arp.c:110 ../arp.c:269
+@@ -59,8 +59,12 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: ne peut dfinir l'entre en ligne %u du fichier ether %s !\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Adresse\t\t\tTypeMap\tAdresseMat\t Indicateurs\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Adresse TypeMap AdresseMat Indicateurs "
++"Iface\n"
+
+ #: ../arp.c:467
+ msgid "(incomplete)"
diff --git a/po/net-tools.pot b/po/net-tools.pot
index 0231aac..cdeccc9 100644
--- a/po/net-tools.pot
@@ -24308,7 +25063,7 @@ index 0231aac..cdeccc9 100644
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
-index 7c5dd37..9d94d5a 100644
+index 7c5dd37..17f1e5a 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -2,7 +2,7 @@
@@ -24329,7 +25084,22 @@ index 7c5dd37..9d94d5a 100644
"Content-Transfer-Encoding: 8bit\n"
#: ../arp.c:110 ../arp.c:269
-@@ -2361,17 +2361,15 @@ msgstr "aten
+@@ -64,8 +64,12 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: no foi possvel configurar a linha %u do arquivo etherfile %s!\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Endereo\t\tTipoHW\tEndereoHW\t Flags Mascara\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Endereo TipoHW EndereoHW Flags Mascara "
++"Iface\n"
+
+ #: ../arp.c:467
+ msgid "(incomplete)"
+@@ -2361,17 +2365,15 @@ msgstr "aten
msgid "Warning: cannot open %s (%s). Limited output.\n"
msgstr "Ateno: no foi possvel abrir %s (%s). Sada limitada.\n"
diff --git a/main/net-tools/musl-fixes.patch b/main/net-tools/musl-fixes.patch
new file mode 100644
index 0000000000..4d6170ca96
--- /dev/null
+++ b/main/net-tools/musl-fixes.patch
@@ -0,0 +1,94 @@
+diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
+index 72b4a66..2361809 100644
+--- a/lib/inet6_gr.c
++++ b/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc doesn't have this */
+ #endif
+ #include "version.h"
+diff --git a/lib/inet6_sr.c b/lib/inet6_sr.c
+index 1ad9510..96dbd5f 100644
+--- a/lib/inet6_sr.c
++++ b/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+diff --git a/lib/inet_sr.c b/lib/inet_sr.c
+index 1a876ae..6a26a76 100644
+--- a/lib/inet_sr.c
++++ b/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+diff --git a/lib/util-ank.c b/lib/util-ank.c
+index b077f35..4ee59f6 100644
+--- a/lib/util-ank.c
++++ b/lib/util-ank.c
+@@ -14,6 +14,7 @@
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ */
+
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/mii-tool.c b/mii-tool.c
+index 1cfecc2..fbc3b34 100644
+--- a/mii-tool.c
++++ b/mii-tool.c
+@@ -46,10 +46,6 @@
+ #include <net/if.h>
+ #include <linux/sockios.h>
+
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include <linux/mii.h>
+ #include <linux/sockios.h>
+ #include "version.h"
+diff --git a/netstat.c b/netstat.c
+index d0c364f..8453f18 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -88,6 +88,7 @@
+ #include <sys/stat.h>
+ #include <net/if.h>
+ #include <dirent.h>
++#include <asm-generic/param.h>
+
+ #include "net-support.h"
+ #include "pathnames.h"
+diff --git a/slattach.c b/slattach.c
+index 5c81584..3ccde28 100644
+--- a/slattach.c
++++ b/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+
+ #if defined(__GLIBC__)