git snapshot !!!

This commit is contained in:
Jiri Popelka 2011-12-06 19:15:09 +01:00
parent 5011928408
commit 626e1f7d6b
29 changed files with 1283 additions and 1960 deletions

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/ifconfig.c.IA64 net-tools-1.60/ifconfig.c
--- net-tools-1.60/ifconfig.c.IA64 2010-01-02 11:35:39.000000000 +0100
+++ net-tools-1.60/ifconfig.c 2010-01-02 11:35:39.000000000 +0100
@@ -894,7 +894,8 @@ int main(int argc, char **argv)
--- net-tools-1.60/ifconfig.c.IA64 2011-12-06 14:36:57.158662389 +0100
+++ net-tools-1.60/ifconfig.c 2011-12-06 14:36:57.247661276 +0100
@@ -914,7 +914,8 @@ int main(int argc, char **argv)
continue;
}
@ -11,23 +11,3 @@ diff -up net-tools-1.60/ifconfig.c.IA64 net-tools-1.60/ifconfig.c
if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
fprintf(stderr, _("Interface %s not initialized\n"),
diff -up net-tools-1.60/lib/interface.c.IA64 net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.IA64 2010-01-02 11:35:39.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2010-01-02 12:03:05.000000000 +0100
@@ -491,14 +491,14 @@ int if_fetch(struct interface *ife)
if (ioctl(skfd, SIOCGOUTFILL, &ifr) < 0)
ife->outfill = 0;
else
- ife->outfill = (unsigned int) ifr.ifr_data;
+ ife->outfill = (unsigned long) ifr.ifr_data;
#endif
#ifdef SIOCGKEEPALIVE
strcpy(ifr.ifr_name, ifname);
if (ioctl(skfd, SIOCGKEEPALIVE, &ifr) < 0)
ife->keepalive = 0;
else
- ife->keepalive = (unsigned int) ifr.ifr_data;
+ ife->keepalive = (unsigned long) ifr.ifr_data;
#endif
}
#endif

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names net-tools-1.60/man/en_US/mii-tool.8
--- net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names 2011-03-07 16:41:22.000000000 +0100
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-03-07 16:41:22.000000000 +0100
@@ -16,7 +16,7 @@ mii-tool \- view, manipulate media-indep
--- net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-12-06 14:47:48.406520671 +0100
@@ -16,7 +16,7 @@ mii\-tool \- view, manipulate media-inde
[\fB\-l\fR, \fB\-\-log\fR]
[\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR]
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
@ -15,25 +15,25 @@ diff -up net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names net-tools-1.
.PP
The default short output reports the negotiated link speed and link
-status for each interface. If an interface or interfaces are not
-specified on the command line, then \fBmii-tool\fR will check any
-specified on the command line, then \fBmii\-tool\fR will check any
-available interfaces from \fBeth0\fR through \fBeth7\fR.
+status for each interface.
.SH OPTIONS
.TP
\fB\-v\fR, \fB\-\-verbose\fR
diff -up net-tools-1.60/mii-tool.c.arbitrary-device-names net-tools-1.60/mii-tool.c
--- net-tools-1.60/mii-tool.c.arbitrary-device-names 2011-03-07 16:41:22.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2011-03-07 16:44:52.000000000 +0100
@@ -419,7 +419,7 @@ static void watch_one_xcvr(int skfd, cha
--- net-tools-1.60/mii-tool.c.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2011-12-06 14:53:39.823127359 +0100
@@ -424,7 +424,7 @@ static void watch_one_xcvr(int skfd, cha
/*--------------------------------------------------------------------*/
const char *usage = "\
-usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\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\
@@ -474,13 +474,10 @@ int main(int argc, char **argv)
const char *usage =
-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\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"
@@ -491,13 +491,10 @@ int main(int argc, char **argv)
/* No remaining args means show all interfaces. */
if (optind == argc) {
@ -51,7 +51,7 @@ diff -up net-tools-1.60/mii-tool.c.arbitrary-device-names net-tools-1.60/mii-too
} else {
ret = 0;
for (i = optind; i < argc; i++) {
@@ -491,15 +488,8 @@ int main(int argc, char **argv)
@@ -508,15 +505,8 @@ int main(int argc, char **argv)
if (opt_watch && (ret == 0)) {
while (1) {
sleep(1);

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/ifconfig.c.broadcast 2004-11-03 12:05:30.000000000 +0100
+++ net-tools-1.60/ifconfig.c 2004-11-04 15:39:32.817077232 +0100
@@ -36,6 +36,7 @@
diff -up net-tools-1.60/ifconfig.c.bcast net-tools-1.60/ifconfig.c
--- net-tools-1.60/ifconfig.c.bcast 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/ifconfig.c 2011-12-02 16:16:06.793742329 +0100
@@ -35,6 +35,7 @@
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
@ -8,33 +9,21 @@
#include <net/if_arp.h>
#include <stdio.h>
#include <errno.h>
@@ -138,6 +139,7 @@
perror("SIOCSIFFLAGS");
return -1;
}
+
return (0);
}
@@ -212,17 +214,41 @@
exit(0);
@@ -239,9 +240,12 @@ static void version(void)
exit(E_USAGE);
}
-static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa)
+static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa, int new_bcast)
{
int err = 0;
-
- memcpy((char *) &ifr->ifr_netmask, (char *) sa,
- sizeof(struct sockaddr));
+ struct sockaddr_in * ip_addr, * netmask, *bcast;
+ struct ifreq ifraddr;
+ struct ifreq ifrbcast;
+
+ memcpy((char *) &ifr->ifr_netmask, (char *) sa,
+ sizeof(struct sockaddr));
if (ioctl(skfd, SIOCSIFNETMASK, ifr) < 0) {
fprintf(stderr, "SIOCSIFNETMASK: %s\n",
memcpy((char *) &ifr->ifr_netmask, (char *) sa,
sizeof(struct sockaddr));
@@ -250,6 +254,25 @@ static int set_netmask(int skfd, struct
strerror(errno));
err = 1;
}
@ -42,12 +31,10 @@
+ if (new_bcast) {
+ memcpy(&ifraddr,ifr,sizeof(struct ifreq));
+ memcpy(&ifrbcast,ifr,sizeof(struct ifreq));
+
+ if (ioctl(skfd, SIOCGIFADDR, &ifraddr) < 0) {
+ fprintf(stderr, "SIOCGIFADDR: %s\n", strerror(errno));
+ err = 1;
+ }
+
+ ip_addr = (struct sockaddr_in *)&ifraddr.ifr_addr;
+ netmask = (struct sockaddr_in *)&ifr->ifr_netmask;
+ bcast = (struct sockaddr_in *)&ifrbcast.ifr_broadaddr;
@ -59,19 +46,19 @@
+ err = 1;
+ }
+ }
return 0;
return err;
}
@@ -234,7 +260,7 @@
@@ -262,7 +285,7 @@ int main(int argc, char **argv)
struct aftype *ap;
struct hwtype *hw;
struct ifreq ifr;
- int goterr = 0, didnetmask = 0, donetmask = 0;
+ int goterr = 0, didnetmask = 0, donetmask = 0, dobcast = 1;
- int goterr = 0, didnetmask = 0, neednetmask=0;
+ int goterr = 0, didnetmask = 0, neednetmask=0, dobcast = 1;
char **spp;
int fd;
#if HAVE_AFINET6
@@ -506,6 +532,7 @@
@@ -547,6 +570,7 @@ int main(int argc, char **argv)
strerror(errno));
goterr = 1;
}
@ -79,21 +66,21 @@
spp++;
}
goterr |= set_flag(ifr.ifr_name, IFF_BROADCAST);
@@ -542,7 +569,7 @@
@@ -589,7 +613,7 @@ int main(int argc, char **argv)
continue;
}
didnetmask++;
- goterr = set_netmask(ap->fd, &ifr, &sa);
+ goterr = set_netmask(ap->fd, &ifr, &sa, dobcast);
- goterr |= set_netmask(ap->fd, &ifr, &sa);
+ goterr |= set_netmask(ap->fd, &ifr, &sa, dobcast);
spp++;
continue;
}
@@ -964,7 +991,7 @@
/* set CIDR netmask */
if (donetmask) {
donetmask = 0;
- goterr = set_netmask(skfd, &ifr, &sa_netmask);
+ goterr = set_netmask(skfd, &ifr, &sa_netmask, dobcast);
@@ -1045,7 +1069,7 @@ int main(int argc, char **argv)
}
if (neednetmask) {
- goterr |= set_netmask(skfd, &ifr, &samask);
+ goterr |= set_netmask(skfd, &ifr, &samask, dobcast);
didnetmask++;
}

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/ifconfig.c.clear-flag 2008-07-08 11:21:33.000000000 +0200
+++ net-tools-1.60/ifconfig.c 2008-07-08 11:22:55.000000000 +0200
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
diff -up net-tools-1.60/ifconfig.c.clear-flag net-tools-1.60/ifconfig.c
--- net-tools-1.60/ifconfig.c.clear-flag 2011-12-06 12:58:18.000000000 +0100
+++ net-tools-1.60/ifconfig.c 2011-12-06 13:02:37.881413090 +0100
@@ -464,7 +464,7 @@ int main(int argc, char **argv)
}
if (!strcmp(*spp, "-allmulti")) {
goterr |= clr_flag(ifr.ifr_name, IFF_ALLMULTI);
@ -10,15 +11,15 @@
spp++;
continue;
@@ -488,7 +488,7 @@ int main(int argc, char **argv)
}
if (!strcmp(*spp, "-dynamic")) {
goterr |= clr_flag(ifr.ifr_name, IFF_DYNAMIC);
spp++;
- if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
+ if (test_flag(ifr.ifr_name, IFF_DYNAMIC) > 0)
fprintf(stderr, _("Warning: Interface %s still in DYNAMIC mode.\n"), ifr.ifr_name);
spp++;
continue;
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
}
@@ -546,7 +546,7 @@ int main(int argc, char **argv)
if (!strcmp(*spp, "-broadcast")) {
goterr |= clr_flag(ifr.ifr_name, IFF_BROADCAST);
@ -27,12 +28,12 @@
fprintf(stderr, _("Warning: Interface %s still in BROADCAST mode.\n"), ifr.ifr_name);
spp++;
continue;
@@ -676,7 +676,7 @@ int main(int argc, char **argv)
}
@@ -685,7 +685,7 @@ int main(int argc, char **argv)
if (!strcmp(*spp, "-pointopoint")) {
goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
spp++;
- if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
+ if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0)
fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
spp++;
continue;
}

View File

@ -1,20 +1,19 @@
diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c
--- net-tools-1.60/ipmaddr.c.coverity 2001-04-08 19:04:23.000000000 +0200
+++ net-tools-1.60/ipmaddr.c 2011-04-28 16:35:24.000000000 +0200
@@ -160,7 +160,11 @@ void read_dev_mcast(struct ma_info **res
--- net-tools-1.60/ipmaddr.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/ipmaddr.c 2011-12-06 15:16:27.210032670 +0100
@@ -160,6 +160,11 @@ void read_dev_mcast(struct ma_info **res
len = parse_hex(hexa, (unsigned char*)&m.addr.data);
if (len >= 0) {
struct ma_info *ma = malloc(sizeof(m));
-
+ if (!ma) {
+ fprintf(stderr, "couldn't allocate memory\n");
+ fclose(fp);
+ return;
+ }
memcpy(ma, &m, sizeof(m));
ma->addr.bytelen = len;
ma->addr.bitlen = len<<3;
@@ -174,7 +178,7 @@ void read_dev_mcast(struct ma_info **res
@@ -174,7 +179,7 @@ void read_dev_mcast(struct ma_info **res
void read_igmp(struct ma_info **result_p)
{
@ -23,7 +22,7 @@ diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c
char buf[256];
FILE *fp = fopen(_PATH_PROCNET_IGMP, "r");
@@ -188,8 +192,6 @@ void read_igmp(struct ma_info **result_p
@@ -188,8 +193,6 @@ void read_igmp(struct ma_info **result_p
m.addr.bytelen = 4;
while (fgets(buf, sizeof(buf), fp)) {
@ -32,7 +31,7 @@ diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c
if (buf[0] != '\t') {
sscanf(buf, "%d%s", &m.index, m.name);
continue;
@@ -201,6 +203,12 @@ void read_igmp(struct ma_info **result_p
@@ -201,6 +204,12 @@ void read_igmp(struct ma_info **result_p
sscanf(buf, "%08x%d", (__u32*)&m.addr.data, &m.users);
ma = malloc(sizeof(m));
@ -45,7 +44,7 @@ diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c
memcpy(ma, &m, sizeof(m));
maddr_ins(result_p, ma);
}
@@ -232,6 +240,11 @@ void read_igmp6(struct ma_info **result_
@@ -232,6 +241,11 @@ void read_igmp6(struct ma_info **result_
len = parse_hex(hexa, (unsigned char*)&m.addr.data);
if (len >= 0) {
struct ma_info *ma = malloc(sizeof(m));
@ -58,8 +57,8 @@ diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c
memcpy(ma, &m, sizeof(m));
diff -up net-tools-1.60/iptunnel.c.coverity net-tools-1.60/iptunnel.c
--- net-tools-1.60/iptunnel.c.coverity 2001-04-08 19:04:23.000000000 +0200
+++ net-tools-1.60/iptunnel.c 2011-04-28 15:26:06.000000000 +0200
--- net-tools-1.60/iptunnel.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/iptunnel.c 2011-12-06 15:17:25.231307304 +0100
@@ -485,6 +485,7 @@ static int do_tunnels_list(struct ip_tun
if ((ptr = strchr(buf, ':')) == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
@ -77,8 +76,8 @@ diff -up net-tools-1.60/iptunnel.c.coverity net-tools-1.60/iptunnel.c
}
diff -up net-tools-1.60/lib/inet.c.coverity net-tools-1.60/lib/inet.c
--- net-tools-1.60/lib/inet.c.coverity 2000-05-22 23:27:13.000000000 +0200
+++ net-tools-1.60/lib/inet.c 2011-04-28 14:39:06.000000000 +0200
--- net-tools-1.60/lib/inet.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet.c 2011-12-06 15:20:21.183107604 +0100
@@ -211,10 +211,18 @@ static int INET_rresolve(char *name, siz
if ((ent == NULL) && (np == NULL))
safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
@ -126,29 +125,9 @@ diff -up net-tools-1.60/lib/inet.c.coverity net-tools-1.60/lib/inet.c
item->name = strdup(pe->p_name);
item->number = htons(pe->p_proto);
add2list(&raw_name, item);
diff -up net-tools-1.60/lib/ipx_gr.c.coverity net-tools-1.60/lib/ipx_gr.c
--- net-tools-1.60/lib/ipx_gr.c.coverity 2011-04-21 14:00:20.000000000 +0200
+++ net-tools-1.60/lib/ipx_gr.c 2011-04-28 14:16:49.000000000 +0200
@@ -38,7 +38,7 @@ int IPX_rprint(int options)
char net[128], router_net[128];
char router_node[128];
int num;
- FILE *fp = fopen(_PATH_PROCNET_IPX_ROUTE, "r");
+ FILE *fp = NULL;
struct aftype *ap;
struct sockaddr sa;
@@ -47,6 +47,7 @@ int IPX_rprint(int options)
return (-1);
}
+ fp = fopen(_PATH_PROCNET_IPX_ROUTE, "r");
if (!fp) {
perror(_PATH_PROCNET_IPX_ROUTE);
printf(_("IPX not configured in this system.\n"));
diff -up net-tools-1.60/lib/masq_info.c.coverity net-tools-1.60/lib/masq_info.c
--- net-tools-1.60/lib/masq_info.c.coverity 2011-04-21 14:00:20.000000000 +0200
+++ net-tools-1.60/lib/masq_info.c 2011-04-28 15:34:06.000000000 +0200
--- net-tools-1.60/lib/masq_info.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/masq_info.c 2011-12-06 15:22:21.768600077 +0100
@@ -208,10 +208,9 @@ int ip_masq_info(int numeric_host, int n
}
for (i = 0; i < ntotal; i++)
@ -163,8 +142,8 @@ diff -up net-tools-1.60/lib/masq_info.c.coverity net-tools-1.60/lib/masq_info.c
}
#endif
diff -up net-tools-1.60/lib/netrom_gr.c.coverity net-tools-1.60/lib/netrom_gr.c
--- net-tools-1.60/lib/netrom_gr.c.coverity 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/lib/netrom_gr.c 2011-04-28 14:15:38.000000000 +0200
--- net-tools-1.60/lib/netrom_gr.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/netrom_gr.c 2011-12-06 15:23:34.471691164 +0100
@@ -39,9 +39,7 @@ int NETROM_rprint(int options)
/*int ext = options & FLAG_EXT;
int numeric = options & FLAG_NUM_HOST; */
@ -176,9 +155,9 @@ diff -up net-tools-1.60/lib/netrom_gr.c.coverity net-tools-1.60/lib/netrom_gr.c
if (f1 == NULL || f2 == NULL) {
diff -up net-tools-1.60/lib/x25.c.coverity net-tools-1.60/lib/x25.c
--- net-tools-1.60/lib/x25.c.coverity 2011-04-21 14:00:20.000000000 +0200
+++ net-tools-1.60/lib/x25.c 2011-04-28 15:01:47.000000000 +0200
@@ -106,7 +106,8 @@ X25_input(int type, char *bufp, struct s
--- net-tools-1.60/lib/x25.c.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/x25.c 2011-12-06 15:24:37.189907079 +0100
@@ -105,7 +105,8 @@ X25_input(int type, char *bufp, struct s
}
if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) {
@ -187,10 +166,10 @@ diff -up net-tools-1.60/lib/x25.c.coverity net-tools-1.60/lib/x25.c
+ *p = '/';
strcpy(X25_errmsg, _("Invalid address"));
#ifdef DEBUG
fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
diff -up net-tools-1.60/nameif.c.coverity net-tools-1.60/nameif.c
--- net-tools-1.60/nameif.c.coverity 2011-04-21 14:00:20.000000000 +0200
+++ net-tools-1.60/nameif.c 2011-04-28 15:55:20.000000000 +0200
--- net-tools-1.60/nameif.c.coverity 2011-12-06 15:12:17.000000000 +0100
+++ net-tools-1.60/nameif.c 2011-12-06 15:28:06.417291375 +0100
@@ -154,6 +154,7 @@ void readconf(void)
FILE *ifh;
char *p;
@ -199,18 +178,17 @@ diff -up net-tools-1.60/nameif.c.coverity net-tools-1.60/nameif.c
ifh = fopen(fname, "r");
if (!ifh)
@@ -163,7 +164,7 @@ void readconf(void)
@@ -163,7 +164,6 @@ void readconf(void)
linel = 0;
linenum = 1;
while (getdelim(&line, &linel, '\n', ifh) > 0) {
- struct change *ch = xmalloc(sizeof(struct change));
+
char pos[20];
sprintf(pos, _("line %d"), linenum);
@@ -178,6 +179,11 @@ void readconf(void)
@@ -178,6 +178,11 @@ void readconf(void)
n = strcspn(p, " \t");
if (n > IFNAMSIZ)
if (n > IFNAMSIZ-1)
complain(_("interface name too long at line %d"), line);
+ ch = xmalloc(sizeof(struct change));
+ if (!ch) {
@ -221,9 +199,9 @@ diff -up net-tools-1.60/nameif.c.coverity net-tools-1.60/nameif.c
ch->ifname[n] = 0;
p += n;
diff -up net-tools-1.60/netstat.c.coverity net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.coverity 2011-04-21 14:00:20.000000000 +0200
+++ net-tools-1.60/netstat.c 2011-04-28 15:58:44.000000000 +0200
@@ -461,6 +461,8 @@ static void prg_cache_load(void)
--- net-tools-1.60/netstat.c.coverity 2011-12-06 15:12:17.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 15:32:36.060920366 +0100
@@ -434,6 +434,8 @@ static void prg_cache_load(void)
PATH_FD_SUFFl+1);
strcpy(line + procfdlen + 1, direfd->d_name);
lnamelen=readlink(line,lname,sizeof(lname)-1);
@ -231,17 +209,17 @@ diff -up net-tools-1.60/netstat.c.coverity net-tools-1.60/netstat.c
+ continue;
lname[lnamelen] = '\0'; /*make it a null-terminated string*/
extract_type_1_socket_inode(lname, &inode, &status);
@@ -902,7 +904,7 @@ static int x25_info(void)
if (extract_type_1_socket_inode(lname, &inode) < 0)
@@ -833,7 +835,7 @@ static int x25_info(void)
"ESTABLISHED",
"RECOVERY"
};
- if(!(f=fopen(_PATH_PROCNET_X25, "r")))
- if(!(f=proc_fopen(_PATH_PROCNET_X25)))
+ if(!f)
{
if (errno != ENOENT) {
perror(_PATH_PROCNET_X25);
@@ -1931,6 +1933,7 @@ static int ipx_info(void)
@@ -1716,6 +1718,7 @@ static int ipx_info(void)
printf("\n");
if ((ap = get_afntype(AF_IPX)) == NULL) {
EINTERN("netstat.c", "AF_IPX missing");
@ -249,18 +227,18 @@ diff -up net-tools-1.60/netstat.c.coverity net-tools-1.60/netstat.c
return (-1);
}
fgets(buf, 255, f);
@@ -1944,6 +1947,7 @@ static int ipx_info(void)
@@ -1729,6 +1732,7 @@ static int ipx_info(void)
sport = ntohs(sport);
} else {
EINTERN("netstat.c", _PATH_PROCNET_IPX " sport format error");
EINTERN("netstat.c", "ipx socket format error in source port");
+ fclose(f);
return (-1);
}
nc = 0;
@@ -1954,6 +1958,7 @@ static int ipx_info(void)
@@ -1739,6 +1743,7 @@ static int ipx_info(void)
dport = ntohs(dport);
} else {
EINTERN("netstat.c", _PATH_PROCNET_IPX " dport format error");
EINTERN("netstat.c", "ipx soket format error in destination port");
+ fclose(f);
return (-1);
}

View File

@ -1,32 +1,34 @@
--- 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 @@
diff -up net-tools-1.60/lib/interface.c.cycle net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.cycle 2011-12-06 16:23:45.051552704 +0100
+++ net-tools-1.60/lib/interface.c 2011-12-06 16:23:45.115551904 +0100
@@ -93,6 +93,7 @@ int if_list_all = 0; /* do we have reque
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)
static struct interface *if_cache_add(char *name)
{
@@ -128,11 +129,13 @@
@@ -138,11 +139,14 @@ struct interface *lookup_interface(char
int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
{
struct interface *ife;
+ int err;
if (!int_list && (if_readlist() < 0))
if (!if_list_all && (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 @@
@@ -376,6 +380,41 @@ static int if_readlist_proc(char *target
fclose(fh);
return err;
}
+
+static int if_readlist_rep(char *target, struct interface *ife)
+{
@ -62,59 +64,60 @@
+ 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 ]
diff -up net-tools-1.60/man/en_US/netstat.8.cycle net-tools-1.60/man/en_US/netstat.8
--- net-tools-1.60/man/en_US/netstat.8.cycle 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/netstat.8 2011-12-06 16:23:45.115551904 +0100
@@ -33,6 +33,7 @@ netstat \- Print network connections, ro
.RB [ \-\-verbose | \-v ]
.RB [ \-\-continuous | \-c]
.RB [ \-\-wide | \-W]
+.RB [delay]
.P
.B netstat
.RB { \-\-route | \-r }
@@ -39,6 +40,7 @@
@@ -42,6 +43,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-interfaces | \-i }
@@ -50,12 +52,14 @@
@@ -52,12 +54,14 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
.RB [ \-\-numeric-hosts "] [" \-\-numeric-ports "] [" \-\-numeric-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-groups | \-g }
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-masquerade | \-M }
@@ -63,12 +67,14 @@
@@ -65,6 +69,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-statistics | -s }
.RB [ \-\-tcp | \-t ]
@@ -72,6 +77,7 @@ netstat \- Print network connections, ro
.RB [ \-\-udp | \-u ]
.RB [ \-\-udplite | \-U ]
.RB [ \-\-raw | \-w ]
+.RB [delay]
.P
.B netstat
.RB { \-\-version | \-V }
@@ -170,6 +176,10 @@
@@ -188,6 +194,10 @@ option, show interfaces that are not up
Print routing information from the FIB. (This is the default.)
.SS "\-C"
Print routing information from the route cache.
@ -122,21 +125,38 @@
+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 @@
.P
diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.cycle 2011-12-06 16:23:45.052552691 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 16:23:45.116551892 +0100
@@ -106,9 +106,9 @@
#endif
/* prototypes for statistics.c */
-void parsesnmp(int, int, int);
+int parsesnmp(int, int, int);
void inittab(void);
-void parsesnmp6(int, int, int);
+int parsesnmp6(int, int, int);
void inittab6(void);
typedef enum {
@@ -1440,6 +1440,8 @@
@@ -302,10 +302,10 @@ static void prg_cache_clear(void)
prg_cache_loaded=0;
}
-static void wait_continous(void)
+static void wait_continous(int reptimer)
{
fflush(stdout);
- sleep(1);
+ sleep(reptimer);
}
static int extract_type_1_socket_inode(const char lname[], unsigned long * inode_p) {
@@ -1610,6 +1610,8 @@ static int ipx_info(void)
static int iface_info(void)
{
@ -145,7 +165,7 @@
if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) {
perror("socket");
@@ -1449,20 +1451,21 @@
@@ -1619,20 +1621,21 @@ static int iface_info(void)
}
if (flag_exp < 2) {
ife_short = 1;
@ -160,7 +180,7 @@
}
- if (flag_cnt)
+ if (!flag_cnt) {
free_interface_list();
if_cache_free();
- else {
close(skfd);
skfd = -1;
@ -170,24 +190,24 @@
return 0;
}
@@ -1478,7 +1481,7 @@
@@ -1648,7 +1651,7 @@ 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 }\n\n"));
+ fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\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 | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
fprintf(stderr, _(" -r, --route display routing table\n"));
fprintf(stderr, _(" -i, --interfaces display interface table\n"));
@@ -1514,6 +1517,7 @@
@@ -1685,6 +1688,7 @@ int main
(int argc, char *argv[]) {
int i;
int lop;
+ int reptimer = 1;
struct option longopts[] =
static struct option longopts[] =
{
AFTRANS_OPTS,
@@ -1655,6 +1659,12 @@
@@ -1844,6 +1848,12 @@ int main
flag_sta++;
}
@ -200,88 +220,99 @@
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 @@
@@ -1869,7 +1879,7 @@ int main
flag_not & FLAG_NUM_PORT, flag_exp);
if (i || !flag_cnt)
break;
- sleep(1);
+ sleep(reptimer);
- wait_continous();
+ wait_continous(reptimer);
}
#else
ENOSUPP("netstat.c", "FW_MASQUERADE");
@@ -1688,9 +1698,15 @@
}
ENOSUPP("netstat", "FW_MASQUERADE");
@@ -1881,18 +1891,18 @@ int main
if (flag_sta) {
+ for(;;) {
if (!afname[0])
strcpy(afname, DFLT_AF);
-
+ for (;;) {
if (!strcmp(afname, "inet")) {
#if HAVE_AFINET
inittab();
- parsesnmp(flag_raw, flag_tcp, flag_udp);
- exit(0);
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp);
+
#else
ENOSUPP("netstat", "AF INET");
#endif
} else if(!strcmp(afname, "inet6")) {
#if HAVE_AFINET6
inittab6();
- parsesnmp6(flag_raw, flag_tcp, flag_udp);
+ i = parsesnmp6(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET6");
#endif
@@ -1900,7 +1910,11 @@ int main
printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
exit(1);
}
- exit(0);
+ if(i || !flag_cnt)
+ break;
+ sleep(reptimer);
+ }
+ return(i);
+ return (i);
}
if (flag_rou) {
@@ -1712,7 +1728,7 @@
@@ -1922,7 +1936,7 @@ int main
i = route_info(afname, options);
if (i || !flag_cnt)
break;
- sleep(1);
+ sleep(reptimer);
- wait_continous();
+ wait_continous(reptimer);
}
return (i);
}
@@ -1721,7 +1737,7 @@
@@ -1931,7 +1945,7 @@ int main
i = iface_info();
if (!flag_cnt || i)
break;
- sleep(1);
+ sleep(reptimer);
- wait_continous();
+ wait_continous(reptimer);
}
return (i);
}
@@ -1847,7 +1863,7 @@
}
@@ -2084,7 +2098,7 @@ int main
if (!flag_cnt || i)
break;
- sleep(1);
+ sleep(reptimer);
- wait_continous();
+ wait_continous(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 @@
}
diff -up net-tools-1.60/statistics.c.cycle net-tools-1.60/statistics.c
--- net-tools-1.60/statistics.c.cycle 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/statistics.c 2011-12-06 16:24:24.062065007 +0100
@@ -502,7 +502,7 @@ void process6_fd(FILE *f)
}
-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,15 @@
f = fopen("/proc/net/snmp", "r");
@@ -511,14 +511,17 @@ void parsesnmp(int flag_raw, int flag_tc
f = proc_fopen("/proc/net/snmp");
if (!f) {
perror(_("cannot open /proc/net/snmp"));
- return;
+ return(1);
}
process_fd(f);
if (process_fd(f, 1, NULL) < 0)
fprintf(stderr, _("Problem while parsing /proc/net/snmp\n"));
- if (ferror(f))
+ if (ferror(f)) {
@ -292,9 +323,9 @@
fclose(f);
@@ -361,12 +363,15 @@
if (f) {
process_fd(f);
@@ -528,15 +531,18 @@ void parsesnmp(int flag_raw, int flag_tc
if (process_fd(f, 1, NULL) <0)
fprintf(stderr, _("Problem while parsing /proc/net/netstat\n"));
- if (ferror(f))
- perror("/proc/net/netstat");
@ -310,4 +341,36 @@
+ return(0);
}
-void parsesnmp6(int flag_raw, int flag_tcp, int flag_udp)
+int parsesnmp6(int flag_raw, int flag_tcp, int flag_udp)
{
FILE *f;
@@ -545,7 +551,7 @@ void parsesnmp6(int flag_raw, int flag_t
f = fopen("/proc/net/snmp6", "r");
if (!f) {
perror(_("cannot open /proc/net/snmp6"));
- return;
+ return(1);
}
process6_fd(f);
if (ferror(f))
@@ -555,13 +561,16 @@ void parsesnmp6(int flag_raw, int flag_t
f = fopen("/proc/net/snmp", "r");
if (!f) {
perror(_("cannot open /proc/net/snmp"));
- return;
+ return(1);
}
process_fd(f, 0, "Tcp");
- if (ferror(f))
+ if (ferror(f)) {
perror("/proc/net/snmp");
+ return(1);
+ }
fclose(f);
+ return(0);
}
void inittab(void)

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/netstat.c.foo Mon Apr 22 14:25:20 2002
+++ net-tools-1.60/netstat.c Mon Apr 22 14:25:22 2002
@@ -435,6 +435,162 @@
diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.dup-tcp 2011-12-02 16:24:08.479720425 +0100
+++ net-tools-1.60/netstat.c 2011-12-02 16:33:51.668429563 +0100
@@ -449,6 +449,120 @@ static void prg_cache_load(void)
" will not be shown, you would have to be root to see it all.)\n"));
}
@ -117,76 +118,26 @@
+
+ return 0;
+}
+
+#if 0
+static void tcp_node_hash_report_bucket_size(void)
+{
+ int max = 0;
+ int min = 0;
+ int num = 0;
+ int total = 0;
+ struct tcp_node *tmp_node;
+ int tmp, i;
+ float avg;
+
+ for (i=0; i < TCP_HASH_SIZE; i++) {
+ tmp_node = tcp_node_hash[i];
+ if (!tmp_node)
+ continue;
+
+ tmp = 0;
+
+ num++;
+ tmp = 1;
+
+ while (tmp_node) {
+ tmp++;
+ tmp_node = tmp_node->next;
+ }
+
+ total += tmp;
+ if (tmp > max)
+ max = tmp;
+
+ if (min == 0 || tmp < min)
+ min = tmp;
+ }
+
+ avg = (float)total/(float)num;
+
+ printf("%d nodes in %d buckets min/max/avg %d/%d/%.2f\n",
+ total, num, min, max, avg);
+
+}
+#endif
+
#if HAVE_AFNETROM
static const char *netrom_state[] =
{
@@ -752,11 +908,20 @@
fprintf(stderr, _("warning, got bogus tcp line.\n"));
@@ -960,6 +1074,12 @@ static void tcp_do_one(int lnr, const ch
return;
}
+
if ((ap = get_afntype(((struct sockaddr *) &localaddr)->sa_family)) == NULL) {
fprintf(stderr, _("netstat: unsupported address family %d !\n"),
((struct sockaddr *) &localaddr)->sa_family);
return;
}
+
+ /* make sure that we haven't seen this socket pair before */
+ if (tcp_node_hash_check_and_append(local_addr, local_port,
+ rem_addr, rem_port) < 0) {
+ if (tcp_node_hash_check_and_append(local_addr, local_port, rem_addr, rem_port) < 0) {
+ /* fprintf(stderr, _("warning, got duplicate tcp line.\n")); */
+ return;
+ }
+
if (state == TCP_LISTEN) {
time_len = 0;
retr = 0L;
@@ -1880,6 +2045,7 @@
addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "tcp");
addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "tcp");
@@ -2112,6 +2232,7 @@ int main
break;
sleep(reptimer);
wait_continous(reptimer);
prg_cache_clear();
+ tcp_node_hash_clear();
}

View File

@ -1,18 +1,7 @@
Fix for when arp_disp_2() is called without opt_n set. If there is a DNS lookup, an
entry is added to /proc/net/arp after fopen(), resulting in a duplicate entry.
--- net-tools-1.60/arp.c.fgets 2005-12-10 14:52:04.000000000 -0500
+++ net-tools-1.60/arp.c 2005-12-11 00:15:59.000000000 -0500
@@ -528,7 +528,7 @@ static int arp_show(char *name)
int type, flags;
FILE *fp;
char *hostname;
- int num, entries = 0, showed = 0;
+ int num, entries, showed = 0;
host[0] = '\0';
@@ -546,18 +546,21 @@ static int arp_show(char *name)
diff -up net-tools-1.60/arp.c.fgets net-tools-1.60/arp.c
--- net-tools-1.60/arp.c.fgets 2011-12-05 16:34:16.000000000 +0100
+++ net-tools-1.60/arp.c 2011-12-05 16:54:52.683352733 +0100
@@ -558,18 +558,21 @@ static int arp_show(char *name)
perror(_PATH_PROCNET_ARP);
return (-1);
}
@ -26,12 +15,12 @@ entry is added to /proc/net/arp after fopen(), resulting in a duplicate entry.
strcpy(dev, "-");
/* Read the ARP cache entries. */
- for (; fgets(line, sizeof(line), fp);) {
- num = sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n",
- num = sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
- ip, &type, &flags, hwa, mask, dev);
- if (num < 4)
+ for (num = 0; num < entries; num++) {
+ fgets(line, sizeof(line), fp);
+ if (sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n",
+ if (sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
+ ip, &type, &flags, hwa, mask, dev) < 4)
break;

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/lib/ib.c.ib-warning net-tools-1.60/lib/ib.c
--- net-tools-1.60/lib/ib.c.ib-warning 2009-09-01 13:45:55.000000000 +0200
+++ net-tools-1.60/lib/ib.c 2009-09-01 13:47:43.000000000 +0200
@@ -48,7 +48,10 @@ static char *pr_ib(unsigned char *ptr)
--- net-tools-1.60/lib/ib.c.ib-warning 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/ib.c 2011-12-06 13:40:32.463976896 +0100
@@ -47,7 +47,10 @@ static const char *pr_ib(const char *ptr
pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
}
buff[strlen(buff) - 1] = '\0';
@ -13,3 +13,19 @@ diff -up net-tools-1.60/lib/ib.c.ib-warning net-tools-1.60/lib/ib.c
/* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
(ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
diff -up net-tools-1.60/man/en_US/ifconfig.8.ib-warning net-tools-1.60/man/en_US/ifconfig.8
--- net-tools-1.60/man/en_US/ifconfig.8.ib-warning 2011-12-06 13:40:31.000000000 +0100
+++ net-tools-1.60/man/en_US/ifconfig.8 2011-12-06 13:41:20.467376771 +0100
@@ -221,6 +221,12 @@ for more information.
.br
.I /proc/net/if_inet6
.SH BUGS
+Ifconfig uses obsolete kernel interface.
+It uses the ioctl access method to get the full address information,
+which limits hardware addresses to 8 bytes.
+Since an Infiniband address is 20 bytes,
+only the first 8 bytes of Infiniband address are displayed.
+.LP
While appletalk DDP and IPX addresses will be displayed they cannot be
altered by this command.
.SH SEE ALSO

View File

@ -1,30 +1,30 @@
diff -Naurp net-tools-1.60-ifconfig-new/lib/interface.c net-tools-1.60-ifconfig/lib/interface.c
--- net-tools-1.60-ifconfig-new/lib/interface.c 2006-03-23 07:02:48.000000000 +0100
+++ net-tools-1.60-ifconfig/lib/interface.c 2006-03-23 09:58:45.000000000 +0100
@@ -203,6 +203,7 @@ out:
diff -up net-tools-1.60/lib/interface.c.long_iface net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.long_iface 2011-12-05 18:16:38.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2011-12-05 19:13:17.343530194 +0100
@@ -216,6 +216,7 @@ out:
static char *get_name(char **namep, char *p)
char *get_name(char **namep, char *p)
{
+ int count = 0;
while (isspace(*p))
p++;
char *name = *namep = p;
@@ -211,8 +212,13 @@ static char *get_name(char **namep, char
@@ -224,7 +225,13 @@ char *get_name(char **namep, char *p)
break;
if (*p == ':') { /* could be an alias */
char *dot = p, *dotname = name;
*name++ = *p++;
- while (isdigit(*p))
char *dot = p++;
- while (*p && isdigit(*p)) p++;
+ count++;
+ while (isdigit(*p)){
*name++ = *p++;
+ while (*p && isdigit(*p)) {
+ p++;
+ count++;
+ if (count == (IFNAMSIZ-1))
+ break;
+ }
if (*p != ':') { /* it wasn't, backup */
if (*p == ':') {
/* Yes it is, backup and copy it. */
p = dot;
name = dotname;
@@ -223,6 +229,9 @@ static char *get_name(char **namep, char
@@ -240,6 +247,9 @@ char *get_name(char **namep, char *p)
break;
}
*name++ = *p++;

View File

@ -1,20 +1,26 @@
--- 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 @@
diff -up net-tools-1.60/lib/inet6.c.inet6-lookup net-tools-1.60/lib/inet6.c
--- net-tools-1.60/lib/inet6.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6.c 2011-12-01 17:10:40.057969536 +0100
@@ -149,33 +149,9 @@ static const char *INET6_sprint(struct s
}
-static int INET6_getsock(char *bufp, struct sockaddr *sap)
-{
- struct sockaddr_in6 *sin6;
- char *p;
-
- sin6 = (struct sockaddr_in6 *) sap;
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = 0;
- sin6->sin6_scope_id = 0;
- sin6->sin6_flowinfo = 0;
-
- if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
- return (-1);
-
- p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
- return 16; /* ?;) */
-}
-
@ -30,9 +36,10 @@
}
--- 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 @@
diff -up net-tools-1.60/lib/inet6_gr.c.inet6-lookup net-tools-1.60/lib/inet6_gr.c
--- net-tools-1.60/lib/inet6_gr.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-12-01 17:11:21.958445708 +0100
@@ -108,7 +108,7 @@ int rprint_fib6(int ext, int numeric)
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6);
snprintf(addr6, sizeof(addr6), "%s/%d",
@ -41,7 +48,7 @@
prefix_len);
/* Fetch and resolve the nexthop address. */
@@ -109,7 +109,7 @@
@@ -117,7 +117,7 @@ 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",
@ -49,9 +56,10 @@
+ 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
diff -up net-tools-1.60/lib/inet6_sr.c.inet6-lookup net-tools-1.60/lib/inet6_sr.c
--- net-tools-1.60/lib/inet6_sr.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_sr.c 2011-12-01 17:14:32.707061021 +0100
@@ -32,6 +32,7 @@
#include "net-support.h"
#include "pathnames.h"
@ -60,8 +68,7 @@
#include "net-features.h"
@@ -63,7 +63,7 @@
@@ -63,7 +64,7 @@ static int INET6_setroute(int action, in
if (*args == NULL)
return (usage());
@ -70,7 +77,7 @@
if (!strcmp(target, "default")) {
prefix_len = 0;
memset(&sa6, 0, sizeof(sa6));
@@ -112,7 +112,7 @@
@@ -112,7 +113,7 @@ static int INET6_setroute(int action, in
return (usage());
if (rt.rtmsg_flags & RTF_GATEWAY)
return (usage());
@ -79,7 +86,7 @@
if (inet6_aftype.input(1, gateway,
(struct sockaddr *) &sa6) < 0) {
inet6_aftype.herror(gateway);
@@ -152,7 +152,7 @@
@@ -152,7 +153,7 @@ static int INET6_setroute(int action, in
}
if (devname) {
memset(&ifr, 0, sizeof(ifr));

View File

@ -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-1.60/man/en_US/netstat.8.interface net-tools-1.60/man/en_US/netstat.8
--- net-tools-1.60/man/en_US/netstat.8.interface 2011-12-06 12:30:47.028302044 +0100
+++ net-tools-1.60/man/en_US/netstat.8 2011-12-06 12:30:47.035301954 +0100
@@ -46,9 +46,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 ]
@@ -130,8 +130,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-1.60/netstat.c.interface net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.interface 2011-12-06 12:30:46.877303930 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 12:32:32.845979140 +0100
@@ -135,6 +135,7 @@ char *Release = RELEASE, *Version = "net
#define E_IOCTL -3
int flag_int = 0;
@ -8,7 +35,7 @@
int flag_rou = 0;
int flag_mas = 0;
int flag_sta = 0;
@@ -1441,6 +1442,7 @@
@@ -1611,6 +1612,7 @@ static int ipx_info(void)
static int iface_info(void)
{
static int count=0;
@ -16,7 +43,7 @@
if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) {
@@ -1455,7 +1457,11 @@
@@ -1625,7 +1627,11 @@ static int iface_info(void)
printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
}
@ -29,82 +56,47 @@
perror(_("missing interface information"));
exit(1);
}
@@ -1481,30 +1487,31 @@
@@ -1651,9 +1657,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, _("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] } [delay]\n\n"));
+ fprintf(stderr, _(" netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [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, _(" <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"));
@@ -1693,7 +1700,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 @@
@@ -1734,7 +1741,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:CFMacdeghilnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
@@ -1602,6 +1609,8 @@
@@ -1775,6 +1782,13 @@ int main
case 'p':
flag_prg++;
break;
case 'i':
+ 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':
flag_int++;
break;
case 'n':

View File

@ -1,13 +1,24 @@
Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminated
diff -up net-tools-1.60/include/interface.h.stack net-tools-1.60/include/interface.h
--- net-tools-1.60/include/interface.h.stack 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/include/interface.h 2011-12-06 16:14:06.477785871 +0100
@@ -73,7 +73,7 @@ extern int do_if_print(struct interface
--- lib/interface.c-old 2005-12-30 11:08:15.000000000 -0800
+++ lib/interface.c 2005-12-30 11:17:02.000000000 -0800
@@ -201,10 +201,11 @@
extern int procnetdev_version(char *buf);
extern int get_dev_fields(char *bp, struct interface *ife);
-extern char * get_name(char *name, char *p);
+extern char * get_name(char **namep, char *p);
extern void ife_print(struct interface *ptr);
diff -up net-tools-1.60/lib/interface.c.stack net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.stack 2011-12-06 16:12:32.515960556 +0100
+++ net-tools-1.60/lib/interface.c 2011-12-06 16:12:32.520960494 +0100
@@ -214,10 +214,11 @@ out:
return err;
}
-static char *get_name(char *name, char *p)
+static char *get_name(char **namep, char *p)
-char *get_name(char *name, char *p)
+char *get_name(char **namep, char *p)
{
while (isspace(*p))
p++;
@ -15,9 +26,9 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
while (*p) {
if (isspace(*p))
break;
@@ -305,9 +306,10 @@
@@ -320,9 +321,10 @@ int get_dev_fields(char *bp, struct inte
static int if_readlist_proc(char *target)
{
static int proc_read;
FILE *fh;
- char buf[512];
struct interface *ife;
@ -25,11 +36,11 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
+ char *line = NULL;
+ size_t linelen = 0;
if (proc_read)
return 0;
@@ -320,8 +322,11 @@
fh = fopen(_PATH_PROCNET_DEV, "r");
if (!fh) {
@@ -330,8 +332,11 @@ static int if_readlist_proc(char *target
_PATH_PROCNET_DEV, strerror(errno));
return if_readconf();
return -2;
}
- fgets(buf, sizeof buf, fh); /* eat line */
- fgets(buf, sizeof buf, fh);
@ -41,7 +52,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
#if 0 /* pretty, but can't cope with missing fields */
fmt = proc_gen_fmt(_PATH_PROCNET_DEV, 1, fh,
@@ -346,13 +351,13 @@
@@ -356,13 +361,13 @@ static int if_readlist_proc(char *target
if (!fmt)
return -1;
#else
@ -56,10 +67,10 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
+ while (getline(&line, &linelen, fh) != -1) {
+ char *s, *name;
+ s = get_name(&name, line);
ife = add_interface(name);
ife = if_cache_add(name);
get_dev_fields(s, ife);
ife->statistics_valid = 1;
@@ -368,6 +373,8 @@
@@ -377,6 +382,8 @@ static int if_readlist_proc(char *target
#if 0
free(fmt);
#endif
@ -68,7 +79,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
fclose(fh);
return err;
}
@@ -376,8 +383,9 @@
@@ -384,8 +391,9 @@ static int if_readlist_proc(char *target
static int if_readlist_rep(char *target, struct interface *ife)
{
FILE *fh;
@ -79,7 +90,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
fh = fopen(_PATH_PROCNET_DEV, "r");
if (!fh) {
@@ -385,15 +393,18 @@
@@ -393,15 +401,18 @@ static int if_readlist_rep(char *target,
_PATH_PROCNET_DEV, strerror(errno));
return if_readconf();
}
@ -104,7 +115,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
get_dev_fields(s, ife);
if (target && !strcmp(target,name))
{
@@ -406,6 +417,8 @@
@@ -414,6 +425,8 @@ static int if_readlist_rep(char *target,
err = -1;
}

View File

@ -1,7 +1,7 @@
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 @@
diff -up net-tools-1.60/lib/ipx_gr.c.ipx net-tools-1.60/lib/ipx_gr.c
--- net-tools-1.60/lib/ipx_gr.c.ipx 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/ipx_gr.c 2011-12-01 17:02:53.261805292 +0100
@@ -70,7 +70,7 @@ int IPX_rprint(int options)
continue;
/* Fetch and resolve the Destination */
@ -10,27 +10,27 @@ diff -urN net-tools-1.60/lib/ipx_gr.c net-tools-1.60.new/lib/ipx_gr.c
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 @@
diff -up net-tools-1.60/netstat.c.ipx net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.ipx 2011-12-01 17:02:53.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-12-01 17:06:26.071144809 +0100
@@ -1582,13 +1582,13 @@ static int ipx_info(void)
}
/* 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));
safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), 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));
safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), 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
diff -up net-tools-1.60/version.h.ipx net-tools-1.60/version.h
--- net-tools-1.60/version.h.ipx 2011-12-01 17:02:53.265805240 +0100
+++ net-tools-1.60/version.h 2011-12-01 17:02:53.265805240 +0100
@@ -0,0 +1 @@
+#define RELEASE "net-tools 1.60"

View File

@ -1,6 +1,6 @@
diff -up net-tools-1.60/man/de_DE/arp.8.man net-tools-1.60/man/de_DE/arp.8
--- net-tools-1.60/man/de_DE/arp.8.man 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/man/de_DE/arp.8 2011-07-21 17:52:05.796565807 +0200
--- net-tools-1.60/man/de_DE/arp.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/de_DE/arp.8 2011-12-06 13:38:28.094531727 +0100
@@ -120,11 +120,9 @@ Flagge) kann
.B Netmaske
f\(:ur ARP-Eintr\(:age f\(:ur ganze Subnetze angegeben werde. Von dieser
@ -28,57 +28,9 @@ diff -up net-tools-1.60/man/de_DE/arp.8.man net-tools-1.60/man/de_DE/arp.8
.SH AUTOREN
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> mit vielen Verbesserungen vom
Verwalter der Net-Tools Bernd Eckenfels <net-tools@lina.inka.de>.
diff -up net-tools-1.60/man/de_DE/hostname.1.man net-tools-1.60/man/de_DE/hostname.1
--- net-tools-1.60/man/de_DE/hostname.1.man 1999-03-15 21:31:16.000000000 +0100
+++ net-tools-1.60/man/de_DE/hostname.1 2011-07-21 17:52:05.796565807 +0200
@@ -15,8 +15,6 @@ dnsdomainname \- den DNS Domainnamen des
nisdomainname \- den NIS/YP Domainnamen anzeigen oder setzen
.br
ypdomainname \- den NIS/YP Domainnamen anzeigen oder setzen
-.br
-nodename \- den DECnet-Knotennamen anzeigen oder setzen
.SH SYNOPSIS
.B hostname
@@ -101,12 +99,6 @@ Funktion ermittelt wird, an. Dieser Nam
des Systems genannt.
.LP
-.B nodename
-druckt den DECnet-Knotennamen des Systems, wie er von der
-.BR getnodename (2)
-Function ermittelt wird, aus.
-
-.LP
.B dnsdomainname
druckt den Domainteil des FQDN (Fully Qualified Domain Name oder zu deutsch
vollst\(:andig spezifizierter Domainname) aus. Der vollst\(:andige FQDN
@@ -117,8 +109,8 @@ ausgegeben.
.SS "NAME SETZEN"
Wenn mit nur einem Argument oder mit der
.B \-\-file
-Option aufgerufen, dann setzen diese Kommandos den Rechnernamen, den NIS/YP
-Domainnamen oder den DECnet-Knotennamen.
+Option aufgerufen, dann setzen diese Kommandos den Rechnernamen oder den NIS/YP
+Domainnamen.
.LP
Nur der Superuser darf den Namen \(:andern.
@@ -198,11 +190,6 @@ Kurzanleitung ausdrucken und beenden.
.I "\-i, \-\-ip-address"
Die IP-Adresse(n) des Rechners anzeigen und beenden.
.TP
-.I "\-n, \-\-node"
-Den DECnet-Knotennamen anzeigen. Wenn ein Argument oder die
-.B \-\-file name
-Option angegeben wird, dann kann Root auch einen neuen Knotennamen setzen.
-.TP
.I "\-s, \-\-short"
Den Kurznamen anzeigen. Dies ist der ab dem ersten Punkt abgeschnittene
Rechnername.
diff -up net-tools-1.60/man/de_DE/ifconfig.8.man net-tools-1.60/man/de_DE/ifconfig.8
--- net-tools-1.60/man/de_DE/ifconfig.8.man 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/man/de_DE/ifconfig.8 2011-07-21 17:52:05.797565794 +0200
--- net-tools-1.60/man/de_DE/ifconfig.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/de_DE/ifconfig.8 2011-12-06 13:38:28.094531727 +0100
@@ -180,20 +180,21 @@ Seit Kernel Version 2.2 gibt es keine ex
Schnittstellenaliase mehr. Die Statistiken f\(:ur die Originaladresse werden
mit allen Aliasen auf das gleiche Ger\(:at geteilt. Um Statistiken per
@ -106,8 +58,8 @@ diff -up net-tools-1.60/man/de_DE/ifconfig.8.man net-tools-1.60/man/de_DE/ifconf
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br
diff -up net-tools-1.60/man/de_DE/netstat.8.man net-tools-1.60/man/de_DE/netstat.8
--- net-tools-1.60/man/de_DE/netstat.8.man 1999-03-15 21:31:20.000000000 +0100
+++ net-tools-1.60/man/de_DE/netstat.8 2011-07-21 17:52:05.797565794 +0200
--- net-tools-1.60/man/de_DE/netstat.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/de_DE/netstat.8 2011-12-06 13:38:28.142531127 +0100
@@ -475,12 +475,9 @@ Befehl explizite Regeln zugef\(:ugt werd
.PP
@ -125,8 +77,8 @@ diff -up net-tools-1.60/man/de_DE/netstat.8.man net-tools-1.60/man/de_DE/netstat
.PP
.SH PROBLEME
diff -up net-tools-1.60/man/de_DE/route.8.man net-tools-1.60/man/de_DE/route.8
--- net-tools-1.60/man/de_DE/route.8.man 2000-01-02 23:53:44.000000000 +0100
+++ net-tools-1.60/man/de_DE/route.8 2011-07-21 17:52:05.798565781 +0200
--- net-tools-1.60/man/de_DE/route.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/de_DE/route.8 2011-12-06 13:38:28.201530389 +0100
@@ -334,7 +334,7 @@ Nur wenn die Hardwareadresse f\(:ur die
.I /proc/net/rt_cache
.LP
@ -137,20 +89,20 @@ diff -up net-tools-1.60/man/de_DE/route.8.man net-tools-1.60/man/de_DE/route.8
.SH GESCHICHTE
.B Route
diff -up net-tools-1.60/man/en_US/arp.8.man net-tools-1.60/man/en_US/arp.8
--- net-tools-1.60/man/en_US/arp.8.man 2011-07-21 17:52:05.725566741 +0200
+++ net-tools-1.60/man/en_US/arp.8 2011-07-21 17:52:05.798565781 +0200
@@ -44,6 +44,10 @@ arp \- manipulate the system ARP cache
.RB [ "-i if" ]
.B -f [filename]
--- net-tools-1.60/man/en_US/arp.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/arp.8 2011-12-06 13:38:28.251529764 +0100
@@ -63,6 +63,10 @@ arp \- manipulate the system ARP cache
.B \-f
.RI [ filename ]
+.SH NOTE
+.P
+This program is obsolete. For replacement check \fBip neighbor\fR.
+This program is obsolete. For replacement check \fBip neigh\fR.
+
.SH DESCRIPTION
.B Arp
manipulates the kernel's ARP cache in various ways. The primary options
@@ -150,8 +154,8 @@ but this is not official. If no filename
manipulates or displays the kernel's IPv4 network neighbour cache. It can add
@@ -178,8 +182,8 @@ but this is not official. If no filename
is used as default.
.sp 1
The format of the file is simple; it
@ -161,21 +113,17 @@ diff -up net-tools-1.60/man/en_US/arp.8.man net-tools-1.60/man/en_US/arp.8
.BR "pub" , " temp" " and" " netmask"
flags can be used.
.LP
@@ -179,8 +183,10 @@ flag.
.I /etc/hosts
@@ -218,6 +222,6 @@ published proxy ARP entries and permanen
.br
.I /etc/ethers
+
.SH SEE ALSO
-rarp(8), route(8), ifconfig(8), netstat(8)
+.BR ip(8)
+
.SH AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> with a lot of improvements
from net-tools Maintainer Bernd Eckenfels <net-tools@lina.inka.de>.
Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net\-tools@lina.inka.de>.
diff -up net-tools-1.60/man/en_US/ethers.5.man net-tools-1.60/man/en_US/ethers.5
--- net-tools-1.60/man/en_US/ethers.5.man 1999-01-09 16:55:31.000000000 +0100
+++ net-tools-1.60/man/en_US/ethers.5 2011-07-21 17:52:05.799565768 +0200
--- net-tools-1.60/man/en_US/ethers.5.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/ethers.5 2011-12-06 13:38:28.301529135 +0100
@@ -26,6 +26,3 @@ can be resolved by DNS or a dot separate
.SH FILES \"{{{
/etc/ethers
@ -183,50 +131,13 @@ diff -up net-tools-1.60/man/en_US/ethers.5.man net-tools-1.60/man/en_US/ethers.5
-.SH "SEE ALSO" \"{{{
-rarp(8)
-.\"}}}
diff -up net-tools-1.60/man/en_US/hostname.1.man net-tools-1.60/man/en_US/hostname.1
--- net-tools-1.60/man/en_US/hostname.1.man 1999-02-27 13:11:14.000000000 +0100
+++ net-tools-1.60/man/en_US/hostname.1 2011-07-21 17:52:05.799565768 +0200
@@ -10,8 +10,6 @@ dnsdomainname \- show the system's DNS d
nisdomainname \- show or set system's NIS/YP domain name
.br
ypdomainname \- show or set the system's NIS/YP domain name
-.br
-nodename \- show or set the system's DECnet node name
.SH SYNOPSIS
.B hostname
@@ -96,12 +94,6 @@ will print the name of the system as ret
function. This is also known as the YP/NIS domain name of the system.
.LP
-.B nodename
-will print the DECnet node name of the system as returned by the
-.BR getnodename (2)
-function.
-
-.LP
.B dnsdomainname
will print the domain part of the FQDN (Fully Qualified Domain Name). The
complete FQDN of the system is returned with
@@ -184,11 +176,6 @@ Print a usage message and exit.
.I "\-i, \-\-ip-address"
Display the IP address(es) of the host.
.TP
-.I "\-n, \-\-node"
-Display the DECnet node name. If a parameter is given (or
-.B \-\-file name
-) the root can also set a new node name.
-.TP
.I "\-s, \-\-short"
Display the short host name. This is the host name cut at the first dot.
.TP
diff -up net-tools-1.60/man/en_US/ifconfig.8.man net-tools-1.60/man/en_US/ifconfig.8
--- net-tools-1.60/man/en_US/ifconfig.8.man 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/man/en_US/ifconfig.8 2011-07-21 17:52:05.800565755 +0200
--- net-tools-1.60/man/en_US/ifconfig.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/ifconfig.8 2011-12-06 13:39:00.576125653 +0100
@@ -5,6 +5,13 @@ ifconfig \- configure a network interfac
.B "ifconfig [interface]"
.B "ifconfig [-v] [-a] [-s] [interface]"
.br
.B "ifconfig interface [aftype] options | address ..."
.B "ifconfig [-v] interface [aftype] options | address ..."
+
+.SH NOTE
+.P
@ -248,18 +159,9 @@ diff -up net-tools-1.60/man/en_US/ifconfig.8.man net-tools-1.60/man/en_US/ifconf
+is not RFC-compliant and therefore its use is discouraged and may go away.
.SH OPTIONS
.TP
.B interface
@@ -173,23 +185,30 @@ alias interfaces anymore. The statistics
are shared with all alias addresses on the same device. If you want per-address
statistics you should add explicit accounting
rules for the address using the
-.BR ipchains(8)
+.BR iptables(8)
command.
.LP
Interrupt problems with Ethernet device drivers fail with EAGAIN. See
-.I http://cesdis.gsfc.nasa.gov/linux/misc/irq-conflict.html
+.I http://www.scyld.com/expert/irq-conflict.html
.B -a
@@ -205,8 +217,6 @@ it is most likely a interrupt conflict.
.I http://www.scyld.com/expert/irq\-conflict.html
for more information.
.SH FILES
-.I /proc/net/socket
@ -267,28 +169,20 @@ diff -up net-tools-1.60/man/en_US/ifconfig.8.man net-tools-1.60/man/en_US/ifconf
.I /proc/net/dev
.br
.I /proc/net/if_inet6
.SH BUGS
+Ifconfig uses obsolete kernel interface.
+It uses the ioctl access method to get the full address information,
+which limits hardware addresses to 8 bytes.
+Since an Infiniband address is 20 bytes,
+only the first 8 bytes of Infiniband address are displayed.
+.LP
@@ -214,7 +224,8 @@ for more information.
While appletalk DDP and IPX addresses will be displayed they cannot be
altered by this command.
+
.SH SEE ALSO
-route(8), netstat(8), arp(8), rarp(8), ipchains(8)
-route(8), netstat(8), arp(8), rarp(8), ipchains(8), iptables(8), ifup(8), interfaces(5).
+.BR ip(8),
+.BR iptables(8)
+
.SH AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br
http://physics.nist.gov/cuu/Units/binary.html - Prefixes for binary multiples
.SH AUTHORS
diff -up net-tools-1.60/man/en_US/mii-tool.8.man net-tools-1.60/man/en_US/mii-tool.8
--- net-tools-1.60/man/en_US/mii-tool.8.man 2000-05-21 16:21:38.000000000 +0200
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-07-21 17:52:05.800565755 +0200
@@ -18,6 +18,12 @@ mii-tool \- view, manipulate media-indep
--- net-tools-1.60/man/en_US/mii-tool.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-12-06 13:38:28.400527901 +0100
@@ -18,6 +18,12 @@ mii\-tool \- view, manipulate media-inde
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
.RI [ "interface\ ..." ]
@ -301,9 +195,9 @@ diff -up net-tools-1.60/man/en_US/mii-tool.8.man net-tools-1.60/man/en_US/mii-to
.SH DESCRIPTION
This utility checks or sets the status of a network interface's Media
Independent Interface (MII) unit. Most fast ethernet adapters use an
@@ -72,6 +78,9 @@ media technologies. Multiple technologi
commas. Valid media are \fB100baseT4\fR, \fB100baseTx-FD\fR,
\fB100baseTx-HD\fR, \fB10baseT-FD\fR, and \fB10baseT-HD\fR.
@@ -87,6 +93,9 @@ SIOCGMIIPHY on 'eth?' failed: Operation
The interface in question does not support MII queries. Most likely, it does not have
MII transceivers, at all.
+.SH SEE ALSO
+ethtool(8)
@ -312,12 +206,12 @@ diff -up net-tools-1.60/man/en_US/mii-tool.8.man net-tools-1.60/man/en_US/mii-to
David Hinds \- dhinds@pcmcia.sourceforge.org
.br
diff -up net-tools-1.60/man/en_US/nameif.8.man net-tools-1.60/man/en_US/nameif.8
--- net-tools-1.60/man/en_US/nameif.8.man 2000-10-18 19:26:29.000000000 +0200
+++ net-tools-1.60/man/en_US/nameif.8 2011-07-21 17:52:05.801565742 +0200
--- net-tools-1.60/man/en_US/nameif.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/nameif.8 2011-12-06 13:38:28.451527263 +0100
@@ -5,6 +5,12 @@ nameif \- name network interfaces based
.B "nameif [-c configfile] [-s]"
.B "nameif [\-c configfile] [\-s]"
.br
.B "nameif [-c configfile] [-s] {interface macaddress}"
.B "nameif [\-c configfile] [\-s] {interface macaddress}"
+
+.SH NOTE
+.P
@ -339,11 +233,11 @@ diff -up net-tools-1.60/man/en_US/nameif.8.man net-tools-1.60/man/en_US/nameif.8
.SH BUGS
Only works for Ethernet currently.
diff -up net-tools-1.60/man/en_US/netstat.8.man net-tools-1.60/man/en_US/netstat.8
--- net-tools-1.60/man/en_US/netstat.8.man 2011-07-21 17:52:05.772566121 +0200
+++ net-tools-1.60/man/en_US/netstat.8 2011-07-21 17:52:05.801565742 +0200
@@ -92,6 +92,14 @@ netstat \- Print network connections, ro
.RB [ \-\-netrom ]
.RB [ \-\-ddp ]
--- net-tools-1.60/man/en_US/netstat.8.man 2011-12-06 13:38:27.771535767 +0100
+++ net-tools-1.60/man/en_US/netstat.8 2011-12-06 13:38:28.509526538 +0100
@@ -101,6 +101,14 @@ netstat \- Print network connections, ro
.RB [ \-\-ddp | \-\-appletalk ]
.RB [ \-\-econet | \-\-ec ]
+.SH NOTE
+.P
@ -356,17 +250,17 @@ diff -up net-tools-1.60/man/en_US/netstat.8.man net-tools-1.60/man/en_US/netstat
.SH DESCRIPTION
.B Netstat
prints information about the Linux networking subsystem. The type of
@@ -169,7 +177,8 @@ Show the PID and name of the program to
@@ -187,7 +195,8 @@ Show the PID and name of the program to
.SS "\-l, \-\-listening"
Show only listening sockets. (These are omitted by default.)
.SS "\-a, \-\-all"
-Show both listening and non-listening sockets. With the
+Show both listening and non-listening (for TCP this means established
+connections) sockets. With the
.B --interfaces
option, show interfaces that are not marked
.B \-\-interfaces
option, show interfaces that are not up
.SS "\-F"
@@ -436,11 +445,9 @@ status information via the following fil
@@ -458,11 +467,9 @@ status information via the following fil
.fi
.P
.SH SEE ALSO
@ -382,12 +276,12 @@ diff -up net-tools-1.60/man/en_US/netstat.8.man net-tools-1.60/man/en_US/netstat
.SH BUGS
Occasionally strange information may appear if a socket changes
diff -up net-tools-1.60/man/en_US/route.8.man net-tools-1.60/man/en_US/route.8
--- net-tools-1.60/man/en_US/route.8.man 2000-05-21 20:59:03.000000000 +0200
+++ net-tools-1.60/man/en_US/route.8 2011-07-21 17:53:29.577465534 +0200
--- net-tools-1.60/man/en_US/route.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/route.8 2011-12-06 13:38:28.559525913 +0100
@@ -52,6 +52,11 @@ If]
.RB [ \-\-version ]
.RB [ \-h ]
.RB [ \--help ]
.RB [ \-\-help ]
+
+.SH NOTE
+.P
@ -403,7 +297,7 @@ diff -up net-tools-1.60/man/en_US/route.8.man net-tools-1.60/man/en_US/route.8
-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
-discovery occurred. 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.
@ -412,25 +306,7 @@ diff -up net-tools-1.60/man/en_US/route.8.man net-tools-1.60/man/en_US/route.8
.TP
.B window W
set the TCP window size for connections over this route to W
@@ -182,7 +184,7 @@ modifiers (metric - netmask - gw - dev)
.B route add -net 127.0.0.0
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
+"lo" device (assuming this device was previously set up correctly with
.BR ifconfig (8)).
.TP
@@ -289,7 +291,7 @@ be either route cache misses (-F) or hit
Interface to which packets for this route will be sent.
.TP
.B MSS
-Default maximum segement size for TCP connections over this route.
+Default maximum segment size for TCP connections over this route.
.TP
.B Window
Default window size for TCP connections over this route.
@@ -314,7 +316,7 @@ Whether or not the hardware address for
@@ -317,7 +319,7 @@ Whether or not the hardware address for
.I /proc/net/rt_cache
.LP
.SH SEE ALSO
@ -439,48 +315,9 @@ diff -up net-tools-1.60/man/en_US/route.8.man net-tools-1.60/man/en_US/route.8
.LP
.SH HISTORY
.B Route
diff -up net-tools-1.60/man/fr_FR/hostname.1.man net-tools-1.60/man/fr_FR/hostname.1
--- net-tools-1.60/man/fr_FR/hostname.1.man 1999-04-18 21:23:46.000000000 +0200
+++ net-tools-1.60/man/fr_FR/hostname.1 2011-07-21 17:52:05.802565729 +0200
@@ -9,8 +9,6 @@ dnsdomainname \- affiche le nom de domai
nisdomainname \- affiche ou définit le nom de domaine NIS/YP du système
.br
ypdomainname \- affiche ou définit le nom de domaine NIS/YP du système
-.br
-nodename \- affiche ou définit le nom de domaine DECnet du système
.SH SYNOPSIS
.B hostname
@@ -87,14 +85,6 @@ fournit le nom du système tel qu'il est
.BR getdomainname (2)
. Ceci est connu comme nom de domaine YP/NIS du système.
-
-.LP
-.B nodename
-fournit le nom de noeud DECnet du système tel qu'il est retourné par la
-fonction
-.BR getnodename (2)
-.
-
.LP
.B dnsdomainname
fournit la partie domaine du nom complètement qualifié - FQDN (Fully
@@ -180,11 +170,6 @@ Affiche un message d'aide et se termine.
.I "\-i, \-\-ip-address"
Affiche la (les) adresse(s) IP de l'hôte.
.TP
-.I "\-n, \-\-node"
-Affiche le nom de noeud DECnet. Si un paramètre est fourni (ou
-.B \-\-file nom_fichier
-) le super-utilisateur peut également définir un nouveau nom de neud.
-.TP
.I "\-s, \-\-short"
Affiche le nom d'hôte en format court. Il s'agit du nom d'hôte coupé au
premier point.
diff -up net-tools-1.60/man/fr_FR/ifconfig.8.man net-tools-1.60/man/fr_FR/ifconfig.8
--- net-tools-1.60/man/fr_FR/ifconfig.8.man 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/man/fr_FR/ifconfig.8 2011-07-21 17:52:05.803565716 +0200
--- net-tools-1.60/man/fr_FR/ifconfig.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/fr_FR/ifconfig.8 2011-12-06 13:38:28.609525290 +0100
@@ -183,20 +183,21 @@ pour les interfaces en alias. Les statis
adresse sont partagées avec toutes les adresses alias du même périphérique.
Si vous voulez des adresses par interface, vous devez ajouter des règles de
@ -508,9 +345,9 @@ diff -up net-tools-1.60/man/fr_FR/ifconfig.8.man net-tools-1.60/man/fr_FR/ifconf
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br
diff -up net-tools-1.60/man/fr_FR/netstat.8.man net-tools-1.60/man/fr_FR/netstat.8
--- net-tools-1.60/man/fr_FR/netstat.8.man 1999-04-18 21:24:01.000000000 +0200
+++ net-tools-1.60/man/fr_FR/netstat.8 2011-07-21 17:52:05.804565703 +0200
@@ -469,12 +469,9 @@ devez définir des règles spécifiques à l
--- net-tools-1.60/man/fr_FR/netstat.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/fr_FR/netstat.8 2011-12-06 13:38:28.651524763 +0100
@@ -468,12 +468,9 @@ devez définir des règles spécifiques à l
.PP
.SH VOIR AUSSI
@ -527,8 +364,8 @@ diff -up net-tools-1.60/man/fr_FR/netstat.8.man net-tools-1.60/man/fr_FR/netstat
.PP
.SH BUGS
diff -up net-tools-1.60/man/fr_FR/route.8.man net-tools-1.60/man/fr_FR/route.8
--- net-tools-1.60/man/fr_FR/route.8.man 2000-01-02 23:53:44.000000000 +0100
+++ net-tools-1.60/man/fr_FR/route.8 2011-07-21 17:52:05.805565690 +0200
--- net-tools-1.60/man/fr_FR/route.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/fr_FR/route.8 2011-12-06 13:38:28.701524138 +0100
@@ -320,7 +320,7 @@ Indique si oui ou non l'adresse matériel
.I /proc/net/rt_cache
.LP
@ -539,8 +376,8 @@ diff -up net-tools-1.60/man/fr_FR/route.8.man net-tools-1.60/man/fr_FR/route.8
.SH HISTORIQUE
.B Route
diff -up net-tools-1.60/man/pt_BR/ifconfig.8.man net-tools-1.60/man/pt_BR/ifconfig.8
--- net-tools-1.60/man/pt_BR/ifconfig.8.man 1999-01-09 16:55:59.000000000 +0100
+++ net-tools-1.60/man/pt_BR/ifconfig.8 2011-07-21 17:52:05.806565677 +0200
--- net-tools-1.60/man/pt_BR/ifconfig.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/pt_BR/ifconfig.8 2011-12-06 13:38:28.759523414 +0100
@@ -144,32 +144,26 @@ O nome ou endereço IP da máquina (um nom
um endereço IP) da interface. Este parâmetro é necessário, apesar
da sintaxe atualmente não requisitá-lo.
@ -582,8 +419,8 @@ diff -up net-tools-1.60/man/pt_BR/ifconfig.8.man net-tools-1.60/man/pt_BR/ifconf
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
Alan Cox, <Alan.Cox@linux.org>
diff -up net-tools-1.60/man/pt_BR/netstat.8.man net-tools-1.60/man/pt_BR/netstat.8
--- net-tools-1.60/man/pt_BR/netstat.8.man 1999-01-09 16:56:03.000000000 +0100
+++ net-tools-1.60/man/pt_BR/netstat.8 2011-07-21 17:52:05.807565664 +0200
--- net-tools-1.60/man/pt_BR/netstat.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/pt_BR/netstat.8 2011-12-06 13:38:28.800522902 +0100
@@ -434,12 +434,9 @@ configurar regras explícitas usando o co
.PP
@ -601,8 +438,8 @@ diff -up net-tools-1.60/man/pt_BR/netstat.8.man net-tools-1.60/man/pt_BR/netstat
.PP
.SH BUGS
diff -up net-tools-1.60/man/pt_BR/route.8.man net-tools-1.60/man/pt_BR/route.8
--- net-tools-1.60/man/pt_BR/route.8.man 2000-01-02 23:53:44.000000000 +0100
+++ net-tools-1.60/man/pt_BR/route.8 2011-07-21 17:52:05.808565651 +0200
--- net-tools-1.60/man/pt_BR/route.8.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/pt_BR/route.8 2011-12-06 13:38:28.842522378 +0100
@@ -312,7 +312,7 @@ parâmetros do protocolo TCP sem esperar
.I /etc/init.d/network
.LP

View File

@ -1,20 +1,21 @@
diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
--- net-tools-1.60/mii-tool.c.mii-refactor 2009-10-30 16:25:23.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2009-10-30 16:45:01.000000000 +0100
@@ -50,9 +50,11 @@ static char version[] =
--- net-tools-1.60/mii-tool.c.mii-refactor 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2011-12-06 16:31:04.114063667 +0100
@@ -51,10 +51,12 @@ static char Version[] = "$Id: mii-tool.c
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#endif
-#include "mii.h"
+#include <linux/mii.h>
+#include <linux/sockios.h>
#include "version.h"
#define MAX_ETH 8 /* Maximum # of interfaces */
+#define LPA_ABILITY_MASK 0x07e0
/* Table of known MII's */
static struct {
@@ -112,7 +114,7 @@ static struct ifreq ifr;
static const struct {
@@ -117,7 +119,7 @@ static struct ifreq ifr;
static int mdio_read(int skfd, int location)
{
@ -23,7 +24,7 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
mii->reg_num = location;
if (ioctl(skfd, SIOCGMIIREG, &ifr) < 0) {
fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
@@ -124,7 +126,7 @@ static int mdio_read(int skfd, int locat
@@ -129,7 +131,7 @@ static int mdio_read(int skfd, int locat
static void mdio_write(int skfd, int location, int value)
{
@ -32,50 +33,76 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
mii->reg_num = location;
mii->val_in = value;
if (ioctl(skfd, SIOCSMIIREG, &ifr) < 0) {
@@ -140,13 +142,13 @@ const struct {
u_short value;
@@ -145,17 +147,17 @@ const struct {
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", LPA_10HALF },
+ { "10baseT-FD", LPA_10FULL },
+ { "100baseTx-HD", LPA_100HALF },
+ { "100baseTx-FD", LPA_100FULL },
+ { "100baseT4", LPA_100BASE4 },
+ { "100baseTx", LPA_100FULL | LPA_100HALF },
+ { "10baseT", LPA_10FULL | LPA_10HALF },
- { "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} },
+ { "10baseT-HD", {LPA_10HALF} },
+ { "10baseT-FD", {LPA_10FULL} },
+ { "100baseTx-HD", {LPA_100HALF} },
+ { "100baseTx-FD", {LPA_100FULL} },
+ { "100baseT4", {LPA_100BASE4} },
+ { "100baseTx", {LPA_100FULL | LPA_100HALF} },
+ { "10baseT", {LPA_10FULL | LPA_10HALF} },
+
+ { "1000baseT-HD", {0, ADVERTISE_1000HALF} },
+ { "1000baseT-FD", {0, ADVERTISE_1000FULL} },
+ { "1000baseT", {0, ADVERTISE_1000HALF|ADVERTISE_1000FULL} },
};
#define NMEDIA (sizeof(media)/sizeof(media[0]))
@@ -157,8 +159,8 @@ static int parse_media(char *arg)
@@ -166,8 +168,8 @@ static int parse_media(char *arg, unsign
char *s;
mask = strtoul(arg, &s, 16);
if ((*arg != '\0') && (*s == '\0')) {
- if ((mask & MII_AN_ABILITY_MASK) &&
- !(mask & ~MII_AN_ABILITY_MASK))
- !(mask & ~MII_AN_ABILITY_MASK)) {
+ if ((mask & LPA_ABILITY_MASK) &&
+ !(mask & ~LPA_ABILITY_MASK))
+ !(mask & ~LPA_ABILITY_MASK)) {
*bmcr2 = 0;
return mask;
goto failed;
} else {
@@ -202,13 +204,22 @@ int show_basic_mii(int sock, int phy_id)
char buf[100];
int i, mii_val[32];
int bmcr, bmsr, advert, lkpar;
-
}
@@ -198,18 +200,19 @@ static const char *media_list(unsigned m
int i;
*buf = '\0';
- if (mask & MII_BMCR_SPEED1000) {
- if (mask2 & MII_BMCR2_1000HALF) {
+ if (mask & BMCR_SPEED1000) {
+ if (mask2 & ADVERTISE_1000HALF) {
strcat(buf, " ");
strcat(buf, "1000baseT-HD");
if (best) goto out;
}
- if (mask2 & MII_BMCR2_1000FULL) {
+ if (mask2 & ADVERTISE_1000FULL) {
strcat(buf, " ");
strcat(buf, "1000baseT-FD");
if (best) goto out;
}
}
+
mask >>= 5;
for (i = 4; i >= 0; i--) {
if (mask & (1<<i)) {
@@ -233,8 +236,19 @@ int show_basic_mii(int sock, int phy_id)
/* 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);
-
+ for (i = 0; i < ((verbose > 1) ? 32 : 8); i++) {
+ for (i = 0; i < ((verbose > 1) ? 32 : (MII_STAT1000+1)); i++) {
+ if ((i == MII_BMCR) || (i == MII_BMSR) || (i == MII_PHYSID1) ||
+ (i == MII_PHYSID2) || (i == MII_ADVERTISE) || (i == MII_LPA) ||
+ (i == MII_EXPANSION) || (i == MII_CTRL1000) || (i == MII_STAT1000) ||
@ -88,15 +115,16 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
+ else
+ mii_val[i] = 0;
+ }
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;
@@ -216,28 +227,28 @@ int show_basic_mii(int sock, int phy_id)
@@ -243,31 +257,31 @@ int show_basic_mii(int sock, int phy_id)
/* Descriptive rename. */
bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
- advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR];
+ advert = mii_val[MII_ADVERTISE]; lkpar = mii_val[MII_LPA];
bmcr2 = mii_val[MII_CTRL1000]; lpa2 = mii_val[MII_STAT1000];
sprintf(buf, "%s: ", ifr.ifr_name);
- if (bmcr & MII_BMCR_AN_ENA) {
@ -107,7 +135,7 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
- strcat(buf, (lkpar & MII_AN_ACK) ?
+ strcat(buf, (lkpar & LPA_LPACK) ?
"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, ");
@ -118,9 +146,12 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
}
} else {
sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ",
- (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
- ((bmcr2 & (MII_BMCR2_1000HALF | MII_BMCR2_1000FULL)) & lpa2 >> 2)
+ ((bmcr2 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL)) & lpa2 >> 2)
? "1000"
- : (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
+ (bmcr & BMCR_SPEED100) ? "100" : "10",
+ : (bmcr & BMCR_SPEED100) ? "100" : "10",
+ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
}
- strcat(buf, (bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
@ -128,7 +159,7 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
if (opt_watch) {
if (opt_log) {
@@ -273,32 +284,32 @@ int show_basic_mii(int sock, int phy_id)
@@ -303,32 +317,32 @@ int show_basic_mii(int sock, int phy_id)
((mii_val[2]<<6)|(mii_val[3]>>10))&0xff,
(mii_val[3]>>4)&0x3f, mii_val[3]&0x0f);
printf(" basic mode: ");
@ -166,14 +197,14 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
printf("remote fault, ");
- printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
+ printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
printf("\n capabilities:%s", media_list(bmsr >> 6, 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)
+ if (lkpar & LPA_ABILITY_MASK)
printf("\n link partner:%s", media_list(lkpar, 0));
printf("\n link partner:%s", media_list(lkpar, bmcr2, 0));
printf("\n");
}
@@ -310,7 +321,7 @@ int show_basic_mii(int sock, int phy_id)
@@ -340,7 +354,7 @@ int show_basic_mii(int sock, int phy_id)
static int do_one_xcvr(int skfd, char *ifname, int maybe)
{
@ -182,14 +213,14 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
/* Get the vitals from the interface. */
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
@@ -328,23 +339,23 @@ static int do_one_xcvr(int skfd, char *i
@@ -358,23 +372,23 @@ static int do_one_xcvr(int skfd, char *i
if (opt_reset) {
printf("resetting the transceiver...\n");
- mdio_write(skfd, MII_BMCR, MII_BMCR_RESET);
+ mdio_write(skfd, MII_BMCR, BMCR_RESET);
}
if (nway_advertise) {
if (nway_advertise > 0) {
- mdio_write(skfd, MII_ANAR, nway_advertise | 1);
+ mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1);
opt_restart = 1;
@ -213,7 +244,7 @@ diff -up net-tools-1.60/mii-tool.c.mii-refactor net-tools-1.60/mii-tool.c
mdio_write(skfd, MII_BMCR, bmcr);
}
@@ -358,7 +369,7 @@ static int do_one_xcvr(int skfd, char *i
@@ -388,7 +402,7 @@ static int do_one_xcvr(int skfd, char *i
static void watch_one_xcvr(int skfd, char *ifname, int index)
{

View File

@ -1,13 +1,14 @@
--- net-tools-1.60/nameif.c.ncpy 2006-10-03 14:24:21.000000000 +0200
+++ net-tools-1.60/nameif.c 2006-10-03 14:22:43.000000000 +0200
@@ -100,8 +100,8 @@
diff -up net-tools-1.60/nameif.c.strncpy net-tools-1.60/nameif.c
--- net-tools-1.60/nameif.c.strncpy 2011-12-06 12:35:36.123687853 +0100
+++ net-tools-1.60/nameif.c 2011-12-06 12:35:36.270686015 +0100
@@ -100,8 +100,8 @@ int setname(char *oldname, char *newnam
struct ifreq ifr;
opensock();
memset(&ifr,0,sizeof(struct ifreq));
- strcpy(ifr.ifr_name, oldname);
- strcpy(ifr.ifr_newname, newname);
+ strncpy(ifr.ifr_name, oldname, IF_NAMESIZE);
+ strncpy(ifr.ifr_newname, newname, IF_NAMESIZE);
+ strncpy(ifr.ifr_name, oldname, IFNAMSIZ);
+ strncpy(ifr.ifr_newname, newname, IFNAMSIZ);
return ioctl(ctl_sk, SIOCSIFNAME, &ifr);
}

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/netstat.c.p-basename net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.p-basename 2011-06-09 12:01:59.907721330 +0200
+++ net-tools-1.60/netstat.c 2011-06-09 12:02:28.437352480 +0200
@@ -413,7 +413,7 @@ static void prg_cache_load(void)
--- net-tools-1.60/netstat.c.p-basename 2011-12-06 14:54:17.023662287 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 14:56:27.852026709 +0100
@@ -395,7 +395,7 @@ static void prg_cache_load(void)
{
char line[LINE_MAX],eacces=0;
int procfdlen,fd,cmdllen,lnamelen;
@ -10,12 +10,7 @@ diff -up net-tools-1.60/netstat.c.p-basename net-tools-1.60/netstat.c
unsigned long inode;
const char *cs,*cmdlp;
DIR *dirproc=NULL,*dirfd=NULL;
@@ -484,10 +484,12 @@ static void prg_cache_load(void)
continue;
if (cmdllen < sizeof(cmdlbuf) - 1)
cmdlbuf[cmdllen]='\0';
- if ((cmdlp = strrchr(cmdlbuf, '/')))
+ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/')))
@@ -459,6 +459,8 @@ static void prg_cache_load(void)
cmdlp++;
else
cmdlp = cmdlbuf;

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/netstat.c.probe net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.probe 2008-10-15 12:47:41.000000000 +0200
+++ net-tools-1.60/netstat.c 2008-10-15 12:49:48.000000000 +0200
@@ -1061,6 +1061,11 @@ static void tcp_do_one(int lnr, const ch
--- net-tools-1.60/netstat.c.probe 2011-12-06 13:06:40.626378359 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 13:06:40.650378062 +0100
@@ -1150,6 +1150,11 @@ static void tcp_do_one(int lnr, const ch
(double) time_len / HZ, retr, timeout);
break;

View File

@ -1,28 +0,0 @@
--- net-tools-1.60/nameif.c.return 2004-08-03 18:01:37.000000000 +0900
+++ net-tools-1.60/nameif.c 2004-08-03 18:03:37.000000000 +0900
@@ -27,6 +27,7 @@
const char *fname = default_conf;
int use_syslog;
int ctl_sk = -1;
+int frag = 0;
void err(char *msg)
{
@@ -288,13 +289,15 @@
while (clist) {
struct change *ch = clist;
clist = clist->next;
- if (!ch->found)
+ if (!ch->found){
warning(_("interface '%s' not found"), ch->ifname);
+ frag = 1;
+ }
free(ch);
}
if (use_syslog)
closelog();
- return 0;
+ return frag;
}

View File

@ -1,20 +1,8 @@
diff -up net-tools-1.60/arp.c.scanf-format net-tools-1.60/arp.c
--- net-tools-1.60/arp.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/arp.c 2011-02-04 14:37:11.000000000 +0100
@@ -557,7 +557,7 @@ static int arp_show(char *name)
/* Read the ARP cache entries. */
for (num = 0; num < entries; num++) {
fgets(line, sizeof(line), fp);
- if (sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n",
+ if (sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
ip, &type, &flags, hwa, mask, dev) < 4)
break;
diff -up net-tools-1.60/lib/inet6_gr.c.scanf-format net-tools-1.60/lib/inet6_gr.c
--- net-tools-1.60/lib/inet6_gr.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-02-04 14:39:54.000000000 +0100
@@ -78,7 +78,7 @@ int rprint_fib6(int ext, int numeric)
"Flags Metric Ref Use Iface\n"));
--- net-tools-1.60/lib/inet6_gr.c.scanf-format 2011-12-06 13:14:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-12-06 13:21:01.417616990 +0100
@@ -82,7 +82,7 @@ int rprint_fib6(int ext, int numeric)
"Flag Met Ref Use If\n"));
while (fgets(buff, 1023, fp)) {
- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n",
@ -23,120 +11,59 @@ diff -up net-tools-1.60/lib/inet6_gr.c.scanf-format net-tools-1.60/lib/inet6_gr.
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&prefix_len,
diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c
--- net-tools-1.60/lib/inet_gr.c.scanf-format 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/lib/inet_gr.c 2011-02-04 14:55:41.000000000 +0100
@@ -68,19 +68,19 @@ int rprint_fib(int ext, int numeric)
--- net-tools-1.60/lib/inet_gr.c.scanf-format 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet_gr.c 2011-12-06 13:23:25.408816852 +0100
@@ -68,7 +68,7 @@ int rprint_fib(int ext, int numeric)
mss = 0;
fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp,
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Destination", "%127s",
"Gateway", "%127s",
"Flags", "%X",
"RefCnt", "%d",
"Use", "%d",
"Metric", "%d",
- "Mask", "%128s",
+ "Mask", "%127s",
"MTU", "%d",
@@ -80,7 +80,7 @@ int rprint_fib(int ext, int numeric)
"Window", "%d",
"IRTT", "%d",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d\n" */
- /* "%16s %127s %127s %X %d %d %d %127s %d %d %d\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */
if (!fmt)
return 1;
@@ -268,21 +268,21 @@ int rprint_cache(int ext, int numeric)
@@ -268,7 +268,7 @@ int rprint_cache(int ext, int numeric)
"MSS Window irtt HH Arp\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Destination", "%127s",
"Gateway", "%127s",
"Flags", "%X",
"RefCnt", "%d",
"Use", "%d",
"Metric", "%d",
- "Source", "%128s",
+ "Source", "%127s",
"MTU", "%d",
"Window", "%d",
"IRTT", "%d",
@@ -282,7 +282,7 @@ int rprint_cache(int ext, int numeric)
"HH", "%d",
"ARP", "%d",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */
- /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
}
if (format == 2) {
@@ -291,23 +291,23 @@ int rprint_cache(int ext, int numeric)
@@ -291,7 +291,7 @@ int rprint_cache(int ext, int numeric)
"Flags Metric Ref Use Iface "
"MSS Window irtt TOS HHRef HHUptod SpecDst\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Destination", "%127s",
"Gateway", "%127s",
"Flags", "%X",
"RefCnt", "%d",
"Use", "%d",
"Metric", "%d",
- "Source", "%128s",
+ "Source", "%127s",
"MTU", "%d",
"Window", "%d",
"IRTT", "%d",
"TOS", "%d",
"HHRef", "%d",
@@ -307,7 +307,7 @@ int rprint_cache(int ext, int numeric)
"HHUptod", "%d",
- "SpecDst", "%128s",
+ "SpecDst", "%127s",
"SpecDst", "%127s",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d %128s\n" */
- /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */
}
diff -up net-tools-1.60/lib/interface.c.scanf-format net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2011-02-04 14:37:11.000000000 +0100
@@ -713,7 +713,7 @@ void ife_print_long(struct interface *pt
#endif
#if HAVE_AFINET6
FILE *f;
- char addr6[40], devname[20];
+ char addr6[40], devname[21];
struct sockaddr_in6 sap;
int plen, scope, dad_status, if_idx;
extern struct aftype inet6_aftype;
diff -up net-tools-1.60/netstat.c.scanf-format net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-02-04 14:37:11.000000000 +0100
@@ -1103,7 +1103,7 @@ static void udp_do_one(int lnr, const ch
more[0] = '\0';
num = sscanf(line,
- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n",
+ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n",
&d, local_addr, &local_port,
rem_addr, &rem_port, &state,
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
@@ -1536,7 +1536,7 @@ static void raw_do_one(int lnr, const ch
more[0] = '\0';
num = sscanf(line,
- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %512s\n",
+ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %511s\n",
&d, local_addr, &local_port, rem_addr, &rem_port, &state,
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);

View File

@ -1,617 +0,0 @@
--- net-tools-1.60/statistics.c.sctp 2006-04-13 10:06:45.000000000 -0400
+++ net-tools-1.60/statistics.c 2006-04-13 10:06:45.000000000 -0400
@@ -20,7 +20,7 @@
#define UFWARN(x)
#endif
-int print_static,f_raw,f_tcp,f_udp,f_unknown = 1;
+int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1;
enum State {
number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg,
@@ -225,6 +225,27 @@
{ "TCPLoss", N_("%u TCP data loss events") },
};
+struct entry Sctptab[] =
+{
+ {"SctpCurrEstab", N_("%u Current Associations"), number},
+ {"SctpActiveEstabs", N_("%u Active Associations"), number},
+ {"SctpPassiveEstabs", N_("%u Passive Associations"), number},
+ {"SctpAborteds", N_("%u Number of Aborteds "), number},
+ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number},
+ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number},
+ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number},
+ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number},
+ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number},
+ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number},
+ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number},
+ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number},
+ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number},
+ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number},
+ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number},
+ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number},
+ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number},
+};
+
struct tabtab {
char *title;
struct entry *tab;
@@ -238,6 +259,7 @@
{"Icmp", Icmptab, sizeof(Icmptab), &f_raw},
{"Tcp", Tcptab, sizeof(Tcptab), &f_tcp},
{"Udp", Udptab, sizeof(Udptab), &f_udp},
+ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp},
{"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp},
{NULL}
};
@@ -385,12 +407,39 @@
return;
}
+/* Process a file with name-value lines (like /proc/net/sctp/snmp) */
+void process_fd2(FILE *f, const char *filename)
+{
+ char buf1[1024];
+ char *sp;
+ struct tabtab *tab;
+
+ tab = newtable(snmptabs, "Sctp");
+
+ while (fgets(buf1, sizeof buf1, f)) {
+ sp = buf1 + strcspn(buf1, " \t\n");
+ if (!sp)
+ goto formaterr;
+ *sp = '\0';
+ sp++;
+
+ sp += strspn(sp, " \t\n");
-int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
+ if (*sp != '\0' && *(tab->flag))
+ printval(tab, buf1, strtoul(sp, 0, 10));
+ }
+ return;
+
+formaterr:
+ fprintf(stderr,_("error parsing %s\n"), filename);
+ return;
+}
+
+int parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp)
{
FILE *f;
- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
+ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp;
f = fopen("/proc/net/snmp", "r");
if (!f) {
@@ -418,6 +467,16 @@
fclose(f);
}
+
+ f = fopen("/proc/net/sctp/snmp", "r");
+ if (f) {
+ process_fd2(f,"/proc/net/sctp/snmp");
+ if (ferror(f))
+ perror("/proc/net/sctp/snmp");
+
+ fclose(f);
+ }
+
return(0);
}
--- net-tools-1.60/netstat.c.sctp 2006-04-13 10:06:45.000000000 -0400
+++ net-tools-1.60/netstat.c 2006-04-13 10:10:23.000000000 -0400
@@ -58,6 +58,7 @@
*
*990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one()
*20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale
+ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
@@ -108,7 +109,7 @@
#endif
/* prototypes for statistics.c */
-int parsesnmp(int, int, int);
+int parsesnmp(int, int, int, int);
void inittab(void);
typedef enum {
@@ -119,6 +120,29 @@
SS_DISCONNECTING /* in process of disconnecting */
} socket_state;
+
+#define SCTP_NSTATES 9 /* The number of states in array*/
+
+static const char *sctp_state[] = {
+ N_("EMPTY"),
+ N_("CLOSED"),
+ N_("COOKIE_WAIT"),
+ N_("COOKIE_ECHOED"),
+ N_("ESTABLISHED"),
+ N_("SHUTDOWN_PENDING"),
+ N_("SHUTDOWN_SENT"),
+ N_("SHUTDOWN_RECEIVED"),
+ N_("SHUTDOWN_ACK_SENT")
+};
+
+#define SCTP_NTYPES 3 /* The number of types in array */
+
+static const char *sctp_type[] = {
+ N_("udp"),
+ N_("udp-high-bw"),
+ N_("tcp")
+};
+
#define SO_ACCEPTCON (1<<16) /* performed a listen */
#define SO_WAITDATA (1<<17) /* wait data to read */
#define SO_NOSPACE (1<<18) /* no space to write */
@@ -150,6 +174,7 @@
int flag_raw = 0;
int flag_tcp = 0;
int flag_udp = 0;
+int flag_sctp= 0;
int flag_igmp= 0;
int flag_rom = 0;
int flag_exp = 1;
@@ -1189,6 +1214,365 @@
udp_do_one);
}
+static const char *sctp_socket_type_str(int type) {
+ if(type>=0 && type<SCTP_NTYPES)
+ return sctp_type[type];
+ else {
+ static char type_str_buf[64];
+ sprintf(type_str_buf,"UNKNOWN(%d)",type);
+ return type_str_buf;
+ }
+}
+
+static const char *sctp_state_str(int state)
+{
+ if(state>=0 && state<SCTP_NSTATES)
+ return sctp_state[state];
+ else {
+ static char state_str_buf[64];
+ sprintf(state_str_buf,"UNKNOWN(%d)",state);
+ return state_str_buf;
+ }
+}
+
+static const char *sctp_socket_state_str(int state)
+{
+ if(state>=0 && state<=10)
+ return tcp_state[state];
+ else {
+ static char state_str_buf[64];
+ sprintf(state_str_buf,"UNKNOWN(%d)",state);
+ return state_str_buf;
+ }
+}
+
+static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa)
+{
+ if (strchr(addr_str,':')) {
+#if HAVE_AFINET6
+ extern struct aftype inet6_aftype;
+ /* Demangle what the kernel gives us */
+ struct in6_addr in6;
+ char addr6_str[INET6_ADDRSTRLEN];
+ unsigned u0,u1,u2,u3,u4,u5,u6,u7;
+ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",
+ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7);
+ in6.s6_addr16[0] = htons(u0);
+ in6.s6_addr16[1] = htons(u1);
+ in6.s6_addr16[2] = htons(u2);
+ in6.s6_addr16[3] = htons(u3);
+ in6.s6_addr16[4] = htons(u4);
+ in6.s6_addr16[5] = htons(u5);
+ in6.s6_addr16[6] = htons(u6);
+ in6.s6_addr16[7] = htons(u7);
+
+ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str));
+ inet6_aftype.input(1, addr6_str, sa);
+ sa->sa_family = AF_INET6;
+#endif
+ } else {
+ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str);
+ sa->sa_family = AF_INET;
+ }
+ return get_afntype(sa->sa_family);
+}
+
+static void sctp_eps_do_one(int lnr, char *line)
+{
+ char buffer[1024];
+ int type, state, port;
+ int uid;
+ unsigned long inode;
+
+ struct aftype *ap;
+#if HAVE_AFINET6
+ struct sockaddr_in6 localaddr;
+#else
+ struct sockaddr_in localaddr;
+#endif
+ const char *sty_str;
+ const char *sst_str;
+ const char *lport_str;
+ const char *uid_str;
+ const char *inode_str;
+ const char *pladdr_str;
+ char *laddrs_str;
+
+ if(lnr == 0) {
+ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
+ return;
+ }
+
+ strtok(line," \t\n"); /*skip ptr*/
+ strtok(0," \t\n"); /*skip ptr*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
+ lport_str=strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+ pladdr_str = strtok(0," \t\n");
+ laddrs_str=strtok(0,"\t\n");
+
+ type = atoi(sty_str);
+ state = atoi(sst_str);
+ port = atoi(lport_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+
+ if(flag_sctp<=1) {
+ /* only print the primary address */
+ char local_addr[64];
+ char local_port[16];
+
+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+ if(ap)
+ safe_strncpy(local_addr,
+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
+ sizeof(local_addr));
+ else
+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+
+ snprintf(local_port, sizeof(local_port), "%s",
+ get_sname(htons(port), "sctp",
+ flag_not & FLAG_NUM_PORT));
+
+ printf("sctp ");
+ sprintf(buffer,"%s:%s", local_addr, local_port);
+ printf("%-47s", buffer);
+ printf(" %-12s", sctp_socket_state_str(state));
+ } else {
+ /*print all addresses*/
+ const char *this_local_addr;
+ int first=1;
+ char local_port[16];
+ snprintf(local_port, sizeof(local_port), "%s",
+ get_sname(htons(port), "sctp",
+ flag_not & FLAG_NUM_PORT));
+ for(this_local_addr=strtok(laddrs_str," \t\n");
+ this_local_addr;
+ this_local_addr=strtok(0," \t\n"))
+ {
+ char local_addr[64];
+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+ if(ap)
+ safe_strncpy(local_addr,
+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
+ sizeof(local_addr));
+ else
+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+
+ if(!first) printf("\n");
+ if(first)
+ printf("sctp ");
+ else
+ printf(" ");
+ sprintf(buffer,"%s:%s", local_addr, local_port);
+ printf("%-47s", buffer);
+ printf(" %-12s", first?sctp_socket_state_str(state):"");
+ first = 0;
+ }
+ }
+
+ finish_this_one(uid,inode,"");
+}
+
+static void sctp_assoc_do_one(int lnr, char *line)
+{
+ char buffer[1024];
+ int type, state, state2, lport,rport;
+ int uid;
+ unsigned rxqueue,txqueue;
+ unsigned long inode;
+
+ struct aftype *ap;
+#if HAVE_AFINET6
+ struct sockaddr_in6 localaddr,remoteaddr;
+#else
+ struct sockaddr_in localaddr,remoteaddr;
+#endif
+ const char *sty_str;
+ const char *sst_str;
+ const char *st_str;
+ const char *txqueue_str;
+ const char *rxqueue_str;
+ const char *lport_str,*rport_str;
+ const char *uid_str;
+ const char *inode_str;
+ const char *pladdr_str;
+ char *laddrs_str;
+ const char *praddr_str;
+ char *raddrs_str;
+
+ if(lnr == 0) {
+ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
+ return;
+ }
+
+ strtok(line," \t\n"); /*skip ptr*/
+ strtok(0," \t\n"); /*skip ptr*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ st_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
+ txqueue_str = strtok(0," \t\n");
+ rxqueue_str = strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+ lport_str=strtok(0," \t\n");
+ rport_str=strtok(0," \t\n");
+ pladdr_str = strtok(0," \t\n");
+ praddr_str = strtok(0," \t\n");
+ laddrs_str=strtok(0,"<->\t\n");
+ raddrs_str=strtok(0,"<->\t\n");
+
+ type = atoi(sty_str);
+ state = atoi(sst_str);
+ state2 = atoi(st_str);
+ txqueue = atoi(txqueue_str);
+ rxqueue = atoi(rxqueue_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+ lport = atoi(lport_str);
+ rport = atoi(rport_str);
+
+ if(flag_sctp<=1) {
+ /* only print the primary addresses */
+ char local_addr[64];
+ char local_port[16];
+ char remote_addr[64];
+ char remote_port[16];
+
+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+ if(ap)
+ safe_strncpy(local_addr,
+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
+ sizeof(local_addr));
+ else
+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+
+ snprintf(local_port, sizeof(local_port), "%s",
+ get_sname(htons(lport), "sctp",
+ flag_not & FLAG_NUM_PORT));
+
+ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
+ if(ap)
+ safe_strncpy(remote_addr,
+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+ sizeof(remote_addr));
+ else
+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+
+ snprintf(remote_port, sizeof(remote_port), "%s",
+ get_sname(htons(rport), "sctp",
+ flag_not & FLAG_NUM_PORT));
+
+ printf("sctp");
+ printf(" %6u %6u ", rxqueue, txqueue);
+ sprintf(buffer,"%s:%s", local_addr, local_port);
+ printf("%-23s", buffer);
+ printf(" ");
+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
+ printf("%-23s", buffer);
+ printf(" %-12s", sctp_socket_state_str(state));
+ } else {
+ /*print all addresses*/
+ const char *this_local_addr;
+ const char *this_remote_addr;
+ char *ss1,*ss2;
+ int first=1;
+ char local_port[16];
+ char remote_port[16];
+ snprintf(local_port, sizeof(local_port), "%s",
+ get_sname(htons(lport), "sctp",
+ flag_not & FLAG_NUM_PORT));
+ snprintf(remote_port, sizeof(remote_port), "%s",
+ get_sname(htons(rport), "sctp",
+ flag_not & FLAG_NUM_PORT));
+
+ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
+ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
+ while(this_local_addr || this_remote_addr) {
+ char local_addr[64];
+ char remote_addr[64];
+ if(this_local_addr) {
+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+ if(ap)
+ safe_strncpy(local_addr,
+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
+ sizeof(local_addr));
+ else
+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+ }
+ if(this_remote_addr) {
+ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
+ if(ap)
+ safe_strncpy(remote_addr,
+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+ sizeof(remote_addr));
+ else
+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+ }
+
+ if(!first) printf("\n");
+ if(first)
+ printf("sctp %6u %6u ", rxqueue, txqueue);
+ else
+ printf(" ");
+ if(this_local_addr) {
+ if(first)
+ sprintf(buffer,"%s:%s", local_addr, local_port);
+ else
+ sprintf(buffer,"%s", local_addr);
+ printf("%-23s", buffer);
+ } else
+ printf("%-23s", "");
+ printf(" ");
+ if(this_remote_addr) {
+ if(first)
+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
+ else
+ sprintf(buffer,"%s", remote_addr);
+ printf("%-23s", buffer);
+ } else
+ printf("%-23s", "");
+
+ printf(" %-12s", first?sctp_socket_state_str(state):"");
+
+ first = 0;
+ this_local_addr=strtok_r(0," \t\n",&ss1);
+ this_remote_addr=strtok_r(0," \t\n",&ss2);
+ }
+ }
+
+ finish_this_one(uid,inode,"");
+}
+
+static int sctp_info_eps(void)
+{
+#if !defined(_PATH_PROCNET_SCTP_EPS)
+#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps"
+#endif
+ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)",
+ sctp_eps_do_one);
+}
+
+static int sctp_info_assocs(void)
+{
+#if !defined(_PATH_PROCNET_SCTP_ASSOCS)
+#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs"
+#endif
+ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)",
+ sctp_assoc_do_one);
+}
+
+static int sctp_info(void)
+{
+ if(flag_all)
+ sctp_info_eps();
+ return sctp_info_assocs();
+}
+
static void raw_do_one(int lnr, const char *line)
{
char buffer[8192], local_addr[64], rem_addr[64];
@@ -1742,7 +2126,7 @@
fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\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, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-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"));
print_aflist(1); /* 1 = routeable */
@@ -1769,6 +2153,7 @@
{"protocol", 1, 0, 'A'},
{"tcp", 0, 0, 't'},
{"udp", 0, 0, 'u'},
+ {"sctp", 0, 0, 'S' },
{"raw", 0, 0, 'w'},
{"unix", 0, 0, 'x'},
{"listening", 0, 0, 'l'},
@@ -1801,7 +2186,7 @@
afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZT", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuSVv?wxlZT", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
@@ -1887,10 +2272,12 @@
case 't':
flag_tcp++;
break;
-
case 'u':
flag_udp++;
break;
+ case 'S':
+ flag_sctp++;
+ break;
case 'w':
flag_raw++;
break;
@@ -1932,13 +2319,13 @@
if (flag_int + flag_rou + flag_mas + flag_sta > 1)
usage();
- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw))
- flag_tcp = flag_udp = flag_raw = 1;
+ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
+ flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
+ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
flag_inet = flag_inet6 = 1;
- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
+ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx
+ flag_ax25 + flag_netrom + flag_igmp + flag_x25;
if (flag_mas) {
@@ -1964,7 +2351,7 @@
if (flag_sta) {
for(;;) {
inittab();
- i = parsesnmp(flag_raw, flag_tcp, flag_udp);
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
if(i || !flag_cnt)
break;
@@ -2006,7 +2393,7 @@
return (i);
}
for (;;) {
- if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
+ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) {
#if HAVE_AFINET
prg_cache_load();
printf(_("Active Internet connections ")); /* xxx */
@@ -2044,6 +2431,11 @@
if (i)
return (i);
}
+ if (!flag_arg || flag_sctp) {
+ i = sctp_info();
+ if (i)
+ return (i);
+ }
if (!flag_arg || flag_raw) {
i = raw_info();
if (i)

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/Makefile~ 2005-12-24 06:56:57.000000000 -0500
+++ net-tools-1.60/Makefile 2005-12-29 16:54:06.000000000 -0500
@@ -113,6 +113,12 @@
diff -up net-tools-1.60/Makefile.selinux net-tools-1.60/Makefile
--- net-tools-1.60/Makefile.selinux 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/Makefile 2011-12-05 15:31:48.825659529 +0100
@@ -114,6 +114,12 @@ endif
NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
@ -10,12 +11,13 @@
+else
+endif
+
CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH)
CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH)
LDFLAGS += -L$(NET_LIB_PATH)
--- net-tools-1.60/netstat.c~ 2005-12-24 06:56:57.000000000 -0500
+++ net-tools-1.60/netstat.c 2005-12-29 16:54:07.000000000 -0500
@@ -86,6 +86,11 @@
diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.selinux 2011-12-05 15:28:23.187230365 +0100
+++ net-tools-1.60/netstat.c 2011-12-05 15:37:31.376377055 +0100
@@ -89,6 +89,11 @@
#include <net/if.h>
#include <dirent.h>
@ -27,15 +29,15 @@
#include "net-support.h"
#include "pathnames.h"
#include "version.h"
@@ -96,6 +101,7 @@
#include "util.h"
@@ -100,6 +105,7 @@
#include "proc.h"
#define PROGNAME_WIDTH 20
+#define SELINUX_WIDTH 50
#if !defined(s6_addr32) && defined(in6a_words)
#define s6_addr32 in6a_words /* libinet6 */
@@ -150,6 +156,7 @@
@@ -159,6 +165,7 @@ int flag_wide= 0;
int flag_prg = 0;
int flag_arg = 0;
int flag_ver = 0;
@ -43,7 +45,7 @@
FILE *procinfo;
@@ -213,12 +220,17 @@
@@ -222,12 +229,17 @@ FILE *procinfo;
#define PROGNAME_WIDTH1(s) PROGNAME_WIDTH2(s)
#define PROGNAME_WIDTH2(s) #s
@ -55,35 +57,35 @@
static struct prg_node {
struct prg_node *next;
int inode;
unsigned long inode;
char name[PROGNAME_WIDTH];
+ char scon[SELINUX_WIDTH];
} *prg_hash[PRG_HASH_SIZE];
static char prg_cache_loaded = 0;
@@ -226,9 +238,12 @@
@@ -235,9 +247,12 @@ static char prg_cache_loaded = 0;
#define PRG_HASHIT(x) ((x) % PRG_HASH_SIZE)
#define PROGNAME_BANNER "PID/Program name"
+#define SELINUX_BANNER "Security Context"
#define print_progname_banner() do { if (flag_prg) printf("%-" PROGNAME_WIDTHs "s"," " PROGNAME_BANNER); } while (0)
#define print_progname_banner() do { if (flag_prg) printf(" %-" PROGNAME_WIDTHs "s",PROGNAME_BANNER); } while (0)
+#define print_selinux_banner() do { if (flag_selinux) printf("%-" SELINUX_WIDTHs "s"," " SELINUX_BANNER); } while (0)
+
#define PRG_LOCAL_ADDRESS "local_address"
#define PRG_INODE "inode"
#define PRG_SOCKET_PFX "socket:["
@@ -250,7 +265,7 @@
/* NOT working as of glibc-2.0.7: */
#undef DIRENT_HAVE_D_TYPE_WORKS
@@ -257,7 +272,7 @@ static char prg_cache_loaded = 0;
#define PATH_CMDLINE "cmdline"
#define PATH_CMDLINEl strlen(PATH_CMDLINE)
-static void prg_cache_add(int inode, char *name)
+static void prg_cache_add(int inode, char *name, char *scon)
-static void prg_cache_add(unsigned long inode, char *name)
+static void prg_cache_add(unsigned long inode, char *name, char *scon)
{
unsigned hi = PRG_HASHIT(inode);
struct prg_node **pnp,*pn;
@@ -271,6 +286,14 @@
@@ -278,6 +293,14 @@ static void prg_cache_add(unsigned long
if (strlen(name)>sizeof(pn->name)-1)
name[sizeof(pn->name)-1]='\0';
strcpy(pn->name,name);
@ -98,7 +100,7 @@
}
static const char *prg_cache_get(unsigned long inode)
@@ -283,6 +306,16 @@
@@ -290,6 +313,16 @@ static const char *prg_cache_get(unsigne
return("-");
}
@ -115,7 +117,7 @@
static void prg_cache_clear(void)
{
struct prg_node **pnp,*pn;
@@ -348,6 +381,7 @@
@@ -367,6 +400,7 @@ static void prg_cache_load(void)
const char *cs,*cmdlp;
DIR *dirproc=NULL,*dirfd=NULL;
struct dirent *direproc,*direfd;
@ -123,7 +125,7 @@
if (prg_cache_loaded || !flag_prg) return;
prg_cache_loaded=1;
@@ -415,7 +449,15 @@
@@ -428,7 +462,15 @@ static void prg_cache_load(void)
}
snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp);
@ -140,32 +142,44 @@
}
closedir(dirfd);
dirfd = NULL;
@@ -1385,6 +1428,8 @@
@@ -662,6 +704,9 @@ static void finish_this_one(int uid, uns
}
if (flag_prg)
printf(" %-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
+ if (flag_selinux)
+ printf(" %-" SELINUX_WIDTHs "s",prg_cache_get_con(inode));
+
if (flag_opt)
printf(" %s", timers);
putchar('\n');
@@ -1484,7 +1529,9 @@ static void unix_do_one(int nr, const ch
printf("- ");
if (flag_prg)
printf("%-" PROGNAME_WIDTHs "s",(has & HAS_INODE?prg_cache_get(inode):"-"));
printf(" %-" PROGNAME_WIDTHs "s",(has & HAS_INODE?prg_cache_get(inode):"-"));
-
+ if (flag_selinux)
+ printf("%-" SELINUX_WIDTHs "s",(has & HAS_INODE?prg_cache_get_con(inode):"-"));
puts(path);
+ printf(" %-" SELINUX_WIDTHs "s",(has & HAS_INODE?prg_cache_get_con(inode):"-"));
+
printf(" %s\n", path);
}
@@ -1403,6 +1448,7 @@
@@ -1503,6 +1550,7 @@ static int unix_info(void)
printf(_("\nProto RefCnt Flags Type State I-Node"));
printf(_("\nProto RefCnt Flags Type State I-Node "));
print_progname_banner();
+ print_selinux_banner();
printf(_(" Path\n")); /* xxx */
{
@@ -1682,6 +1728,7 @@
@@ -1802,6 +1850,7 @@ static void usage(void)
fprintf(stderr, _(" -o, --timers display timers\n"));
fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
+ fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\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"));
@@ -1729,6 +1776,7 @@
fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
@@ -1850,6 +1899,7 @@ int main
{"cache", 0, 0, 'C'},
{"fib", 0, 0, 'F'},
{"groups", 0, 0, 'g'},
@ -173,16 +187,16 @@
{NULL, 0, 0, 0}
};
@@ -1741,7 +1789,7 @@
@@ -1861,7 +1911,7 @@ int main
getroute_init(); /* Set up AF routing support */
afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxl", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZ", longopts, &lop)) != EOF)
- while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?Z", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
@@ -1838,6 +1886,20 @@
@@ -1973,6 +2023,20 @@ int main
if (aftrans_opt("unix"))
exit(1);
break;
@ -203,19 +217,7 @@
case '?':
case 'h':
usage();
--- net-tools-1.60/netstat.c.sel 2007-05-21 14:02:08.000000000 -0400
+++ net-tools-1.60/netstat.c 2007-05-21 14:03:23.000000000 -0400
@@ -769,6 +769,9 @@ static void finish_this_one(int uid, uns
}
if (flag_prg)
printf("%-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
+ if (flag_selinux)
+ printf("%-" SELINUX_WIDTHs "s",prg_cache_get_con(inode));
+
if (flag_opt)
printf("%s", timers);
putchar('\n');
@@ -2420,6 +2423,7 @@ int main
@@ -2099,6 +2163,7 @@ int main
if (flag_exp > 1)
printf(_(" User Inode "));
print_progname_banner();

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/lib/interface.c.statalias 2005-01-07 12:49:14.084104032 +0100
+++ net-tools-1.60/lib/interface.c 2005-01-07 12:49:38.527388088 +0100
@@ -395,9 +395,11 @@
diff -up net-tools-1.60/lib/interface.c.statalias net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.statalias 2011-12-02 16:37:32.258671807 +0100
+++ net-tools-1.60/lib/interface.c 2011-12-02 16:37:33.193660117 +0100
@@ -403,9 +403,11 @@ static int if_readlist_rep(char *target,
char *s, name[IFNAMSIZ];
s = get_name(name, buf);
get_dev_fields(s, ife);

View File

@ -1,28 +1,28 @@
diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
--- net-tools-1.60/statistics.c.doubleword 2010-08-10 15:20:11.000000000 +0200
+++ net-tools-1.60/statistics.c 2010-08-10 15:21:24.000000000 +0200
@@ -63,54 +63,54 @@ static enum State state;
--- net-tools-1.60/statistics.c.doubleword 2011-12-02 15:41:03.000000000 +0100
+++ net-tools-1.60/statistics.c 2011-12-02 15:55:22.202301865 +0100
@@ -64,115 +64,115 @@ static enum State state;
struct entry Iptab[] =
{
{"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC},
- {"DefaultTTL", N_("Default TTL is %lu"), number | I_STATIC},
- {"InReceives", N_("%lu total packets received"), number},
- {"InHdrErrors", N_("%lu with invalid headers"), opt_number},
- {"InAddrErrors", N_("%lu with invalid addresses"), opt_number},
- {"ForwDatagrams", N_("%lu forwarded"), number},
- {"InUnknownProtos", N_("%lu with unknown protocol"), opt_number},
- {"InDiscards", N_("%lu incoming packets discarded"), number},
- {"InDelivers", N_("%lu incoming packets delivered"), number},
- {"OutRequests", N_("%lu requests sent out"), number}, /*? */
- {"OutDiscards", N_("%lu outgoing packets dropped"), opt_number},
- {"OutNoRoutes", N_("%lu dropped because of missing route"), opt_number},
- {"ReasmTimeout", N_("%lu fragments dropped after timeout"), opt_number},
- {"ReasmReqds", N_("%lu reassemblies required"), opt_number}, /* ? */
- {"ReasmOKs", N_("%lu packets reassembled ok"), opt_number},
- {"ReasmFails", N_("%lu packet reassembles failed"), opt_number},
- {"FragOKs", N_("%lu fragments received ok"), opt_number},
- {"FragFails", N_("%lu fragments failed"), opt_number},
- {"FragCreates", N_("%lu fragments created"), opt_number}
- {"DefaultTTL", N_("Default TTL is %u"), number | I_STATIC},
- {"InReceives", N_("%u total packets received"), number},
- {"InHdrErrors", N_("%u with invalid headers"), opt_number},
- {"InAddrErrors", N_("%u with invalid addresses"), opt_number},
- {"ForwDatagrams", N_("%u forwarded"), number},
- {"InUnknownProtos", N_("%u with unknown protocol"), opt_number},
- {"InDiscards", N_("%u incoming packets discarded"), number},
- {"InDelivers", N_("%u incoming packets delivered"), number},
- {"OutRequests", N_("%u requests sent out"), number}, /*? */
- {"OutDiscards", N_("%u outgoing packets dropped"), opt_number},
- {"OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
- {"ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
- {"ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
- {"ReasmOKs", N_("%u packets reassembled ok"), opt_number},
- {"ReasmFails", N_("%u packet reassembles failed"), opt_number},
- {"FragOKs", N_("%u fragments received ok"), opt_number},
- {"FragFails", N_("%u fragments failed"), opt_number},
- {"FragCreates", N_("%u fragments created"), opt_number}
+ {"DefaultTTL", N_("Default TTL is %llu"), number | I_STATIC},
+ {"InReceives", N_("%llu total packets received"), number},
+ {"InHdrErrors", N_("%llu with invalid headers"), opt_number},
@ -43,34 +43,82 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
+ {"FragCreates", N_("%llu fragments created"), opt_number}
};
struct entry Ip6tab[] =
{
- {"Ip6InReceives", N_("%u total packets received"), number},
- {"Ip6InHdrErrors", N_("%u with invalid headers"), opt_number},
- {"Ip6InTooBigErrors", N_("%u with packets too big"), opt_number},
- {"Ip6InNoRoutes", N_("%u incoming packets with no route"), opt_number},
- {"Ip6InAddrErrors", N_("%u with invalid addresses"), opt_number},
- {"Ip6InUnknownProtos", N_("%u with unknown protocol"), opt_number},
- {"Ip6InTruncatedPkts", N_("%u with truncated packets"), opt_number},
- {"Ip6InDiscards", N_("%u incoming packets discarded"), number},
- {"Ip6InDelivers", N_("%u incoming packets delivered"), number},
- {"Ip6OutForwDatagrams", N_("%u forwarded"), number},
- {"Ip6OutRequests", N_("%u requests sent out"), number}, /*? */
- {"Ip6OutDiscards", N_("%u outgoing packets dropped"), opt_number},
- {"Ip6OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
- {"Ip6ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
- {"Ip6ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
- {"Ip6ReasmOKs", N_("%u packets reassembled ok"), opt_number},
- {"Ip6ReasmFails", N_("%u packet reassembles failed"), opt_number},
- {"Ip6FragOKs", N_("%u fragments received ok"), opt_number},
- {"Ip6FragFails", N_("%u fragments failed"), opt_number},
- {"Ip6FragCreates", N_("%u fragments created"), opt_number},
- {"Ip6InMcastPkts", N_("%u incoming multicast packets"), opt_number},
- {"Ip6OutMcastPkts", N_("%u outgoing multicast packets"), opt_number}
+ {"Ip6InReceives", N_("%llu total packets received"), number},
+ {"Ip6InHdrErrors", N_("%llu with invalid headers"), opt_number},
+ {"Ip6InTooBigErrors", N_("%llu with packets too big"), opt_number},
+ {"Ip6InNoRoutes", N_("%llu incoming packets with no route"), opt_number},
+ {"Ip6InAddrErrors", N_("%llu with invalid addresses"), opt_number},
+ {"Ip6InUnknownProtos", N_("%llu with unknown protocol"), opt_number},
+ {"Ip6InTruncatedPkts", N_("%llu with truncated packets"), opt_number},
+ {"Ip6InDiscards", N_("%llu incoming packets discarded"), number},
+ {"Ip6InDelivers", N_("%llu incoming packets delivered"), number},
+ {"Ip6OutForwDatagrams", N_("%llu forwarded"), number},
+ {"Ip6OutRequests", N_("%llu requests sent out"), number}, /*? */
+ {"Ip6OutDiscards", N_("%llu outgoing packets dropped"), opt_number},
+ {"Ip6OutNoRoutes", N_("%llu dropped because of missing route"), opt_number},
+ {"Ip6ReasmTimeout", N_("%llu fragments dropped after timeout"), opt_number},
+ {"Ip6ReasmReqds", N_("%llu reassemblies required"), opt_number}, /* ? */
+ {"Ip6ReasmOKs", N_("%llu packets reassembled ok"), opt_number},
+ {"Ip6ReasmFails", N_("%llu packet reassembles failed"), opt_number},
+ {"Ip6FragOKs", N_("%llu fragments received ok"), opt_number},
+ {"Ip6FragFails", N_("%llu fragments failed"), opt_number},
+ {"Ip6FragCreates", N_("%llu fragments created"), opt_number},
+ {"Ip6InMcastPkts", N_("%llu incoming multicast packets"), opt_number},
+ {"Ip6OutMcastPkts", N_("%llu outgoing multicast packets"), opt_number}
};
struct entry Icmptab[] =
{
- {"InMsgs", N_("%lu ICMP messages received"), number},
- {"InErrors", N_("%lu input ICMP message failed."), number},
- {"InDestUnreachs", N_("destination unreachable: %lu"), i_inp_icmp | I_TITLE},
- {"InTimeExcds", N_("timeout in transit: %lu"), i_inp_icmp | I_TITLE},
- {"InParmProbs", N_("wrong parameters: %lu"), i_inp_icmp | I_TITLE}, /*? */
- {"InSrcQuenchs", N_("source quenches: %lu"), i_inp_icmp | I_TITLE},
- {"InRedirects", N_("redirects: %lu"), i_inp_icmp | I_TITLE},
- {"InEchos", N_("echo requests: %lu"), i_inp_icmp | I_TITLE},
- {"InEchoReps", N_("echo replies: %lu"), i_inp_icmp | I_TITLE},
- {"InTimestamps", N_("timestamp request: %lu"), i_inp_icmp | I_TITLE},
- {"InTimestampReps", N_("timestamp reply: %lu"), i_inp_icmp | I_TITLE},
- {"InAddrMasks", N_("address mask request: %lu"), i_inp_icmp | I_TITLE}, /*? */
- {"InAddrMaskReps", N_("address mask replies: %lu"), i_inp_icmp | I_TITLE}, /*? */
- {"OutMsgs", N_("%lu ICMP messages sent"), number},
- {"OutErrors", N_("%lu ICMP messages failed"), number},
- {"OutDestUnreachs", N_("destination unreachable: %lu"), i_outp_icmp | I_TITLE},
- {"OutTimeExcds", N_("time exceeded: %lu"), i_outp_icmp | I_TITLE},
- {"OutParmProbs", N_("wrong parameters: %lu"), i_outp_icmp | I_TITLE}, /*? */
- {"OutSrcQuenchs", N_("source quench: %lu"), i_outp_icmp | I_TITLE},
- {"OutRedirects", N_("redirect: %lu"), i_outp_icmp | I_TITLE},
- {"OutEchos", N_("echo request: %lu"), i_outp_icmp | I_TITLE},
- {"OutEchoReps", N_("echo replies: %lu"), i_outp_icmp | I_TITLE},
- {"OutTimestamps", N_("timestamp requests: %lu"), i_outp_icmp | I_TITLE},
- {"OutTimestampReps", N_("timestamp replies: %lu"), i_outp_icmp | I_TITLE},
- {"OutAddrMasks", N_("address mask requests: %lu"), i_outp_icmp | I_TITLE},
- {"OutAddrMaskReps", N_("address mask replies: %lu"), i_outp_icmp | I_TITLE},
- {"InMsgs", N_("%u ICMP messages received"), number},
- {"InErrors", N_("%u input ICMP message failed."), number},
- {"InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
- {"InTimeExcds", N_("timeout in transit: %u"), i_inp_icmp | I_TITLE},
- {"InParmProbs", N_("wrong parameters: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InSrcQuenchs", N_("source quenches: %u"), i_inp_icmp | I_TITLE},
- {"InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
- {"InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
- {"InEchoReps", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
- {"InTimestamps", N_("timestamp request: %u"), i_inp_icmp | I_TITLE},
- {"InTimestampReps", N_("timestamp reply: %u"), i_inp_icmp | I_TITLE},
- {"InAddrMasks", N_("address mask request: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InAddrMaskReps", N_("address mask replies: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"OutMsgs", N_("%u ICMP messages sent"), number},
- {"OutErrors", N_("%u ICMP messages failed"), number},
- {"OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
- {"OutTimeExcds", N_("time exceeded: %u"), i_outp_icmp | I_TITLE},
- {"OutParmProbs", N_("wrong parameters: %u"), i_outp_icmp | I_TITLE}, /*? */
- {"OutSrcQuenchs", N_("source quench: %u"), i_outp_icmp | I_TITLE},
- {"OutRedirects", N_("redirect: %u"), i_outp_icmp | I_TITLE},
- {"OutEchos", N_("echo request: %u"), i_outp_icmp | I_TITLE},
- {"OutEchoReps", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestamps", N_("timestamp requests: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestampReps", N_("timestamp replies: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMasks", N_("address mask requests: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMaskReps", N_("address mask replies: %u"), i_outp_icmp | I_TITLE},
+ {"InMsgs", N_("%llu ICMP messages received"), number},
+ {"InErrors", N_("%llu input ICMP message failed."), number},
+ {"InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
@ -99,21 +147,87 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
+ {"OutAddrMaskReps", N_("address mask replies: %llu"), i_outp_icmp | I_TITLE},
};
struct entry Icmp6tab[] =
{
- {"Icmp6InMsgs", N_("%u ICMP messages received"), number},
- {"Icmp6InErrors", N_("%u input ICMP message failed."), number},
- {"Icmp6InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InPktTooBigs", N_("packets too big: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InTimeExcds", N_("received ICMPv6 time exceeded: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InParmProblems", N_("parameter problem: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InEchoReplies", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembQueries", N_("group member queries: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembResponses", N_("group member responses: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembReductions", N_("group member reductions: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRouterSolicits", N_("router solicits: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRouterAdvertisements", N_("router advertisement: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InNeighborSolicits", N_("neighbour solicits: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InNeighborAdvertisements", N_("neighbour advertisement: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6OutMsgs", N_("%u ICMP messages sent"), number},
- {"Icmp6OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutPktTooBigs", N_("packets too big: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutTimeExcds", N_("sent ICMPv6 time exceeded: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutParmProblems", N_("parameter problem: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutEchos", N_("echo requests: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutEchoReplies", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembQueries", N_("group member queries: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembResponses", N_("group member responses: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembReductions", N_("group member reductions: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRouterSolicits", N_("router solicits: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRouterAdvertisements ", N_("router advertisement: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutNeighborSolicits", N_("neighbor solicits: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutNeighborAdvertisements", N_("neighbor advertisements: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRedirects", N_("redirects: %u"), i_outp_icmp | I_TITLE},
+ {"Icmp6InMsgs", N_("%llu ICMP messages received"), number},
+ {"Icmp6InErrors", N_("%llu input ICMP message failed."), number},
+ {"Icmp6InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InPktTooBigs", N_("packets too big: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InTimeExcds", N_("received ICMPv6 time exceeded: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InParmProblems", N_("parameter problem: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InEchos", N_("echo requests: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InEchoReplies", N_("echo replies: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembQueries", N_("group member queries: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembResponses", N_("group member responses: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembReductions", N_("group member reductions: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRouterSolicits", N_("router solicits: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRouterAdvertisements", N_("router advertisement: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InNeighborSolicits", N_("neighbour solicits: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InNeighborAdvertisements", N_("neighbour advertisement: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRedirects", N_("redirects: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6OutMsgs", N_("%llu ICMP messages sent"), number},
+ {"Icmp6OutDestUnreachs", N_("destination unreachable: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutPktTooBigs", N_("packets too big: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutTimeExcds", N_("sent ICMPv6 time exceeded: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutParmProblems", N_("parameter problem: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutEchos", N_("echo requests: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutEchoReplies", N_("echo replies: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembQueries", N_("group member queries: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembResponses", N_("group member responses: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembReductions", N_("group member reductions: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRouterSolicits", N_("router solicits: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRouterAdvertisements ", N_("router advertisement: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutNeighborSolicits", N_("neighbor solicits: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutNeighborAdvertisements", N_("neighbor advertisements: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRedirects", N_("redirects: %llu"), i_outp_icmp | I_TITLE},
};
struct entry Tcptab[] =
@@ -119,131 +119,133 @@ struct entry Tcptab[] =
@@ -181,122 +181,122 @@ struct entry Tcptab[] =
{"RtoMin", "", number},
{"RtoMax", "", number},
{"MaxConn", "", number},
- {"ActiveOpens", N_("%lu active connections openings"), number},
- {"PassiveOpens", N_("%lu passive connection openings"), number},
- {"AttemptFails", N_("%lu failed connection attempts"), number},
- {"EstabResets", N_("%lu connection resets received"), number},
- {"CurrEstab", N_("%lu connections established"), number},
- {"InSegs", N_("%lu segments received"), number},
- {"OutSegs", N_("%lu segments send out"), number},
- {"RetransSegs", N_("%lu segments retransmited"), number},
- {"InErrs", N_("%lu bad segments received."), number},
- {"OutRsts", N_("%lu resets sent"), number},
- {"ActiveOpens", N_("%u active connections openings"), number},
- {"PassiveOpens", N_("%u passive connection openings"), number},
- {"AttemptFails", N_("%u failed connection attempts"), number},
- {"EstabResets", N_("%u connection resets received"), number},
- {"CurrEstab", N_("%u connections established"), number},
- {"InSegs", N_("%u segments received"), number},
- {"OutSegs", N_("%u segments send out"), number},
- {"RetransSegs", N_("%u segments retransmited"), number},
- {"InErrs", N_("%u bad segments received."), number},
- {"OutRsts", N_("%u resets sent"), number},
+ {"ActiveOpens", N_("%llu active connections openings"), number},
+ {"PassiveOpens", N_("%llu passive connection openings"), number},
+ {"AttemptFails", N_("%llu failed connection attempts"), number},
@ -128,10 +242,12 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
struct entry Udptab[] =
{
- {"InDatagrams", N_("%lu packets received"), number},
- {"NoPorts", N_("%lu packets to unknown port received."), number},
- {"InErrors", N_("%lu packet receive errors"), number},
- {"OutDatagrams", N_("%lu packets sent"), number},
- {"InDatagrams", N_("%u packets received"), number},
- {"NoPorts", N_("%u packets to unknown port received."), number},
- {"InErrors", N_("%u packet receive errors"), number},
- {"OutDatagrams", N_("%u packets sent"), number},
- {"RcvbufErrors", N_("%u receive buffer errors"), number},
- {"SndbufErrors", N_("%u send buffer errors"), number},
+ {"InDatagrams", N_("%llu packets received"), number},
+ {"NoPorts", N_("%llu packets to unknown port received."), number},
+ {"InErrors", N_("%llu packet receive errors"), number},
@ -140,92 +256,103 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
+ {"SndbufErrors", N_("%llu send buffer errors"), number},
};
struct entry Udp6tab[] =
{
- {"Udp6InDatagrams", N_("%u packets received"), number},
- {"Udp6NoPorts", N_("%u packets to unknown port received."), number},
- {"Udp6InErrors", N_("%u packet receive errors"), number},
- {"Udp6OutDatagrams", N_("%u packets sent"), number},
+ {"Udp6InDatagrams", N_("%llu packets received"), number},
+ {"Udp6NoPorts", N_("%llu packets to unknown port received."), number},
+ {"Udp6InErrors", N_("%llu packet receive errors"), number},
+ {"Udp6OutDatagrams", N_("%llu packets sent"), number},
};
struct entry Tcpexttab[] =
{
- {"SyncookiesSent", N_("%lu SYN cookies sent"), opt_number},
- {"SyncookiesRecv", N_("%lu SYN cookies received"), opt_number},
- {"SyncookiesFailed", N_("%lu invalid SYN cookies received"), opt_number},
- {"SyncookiesSent", N_("%u SYN cookies sent"), opt_number},
- {"SyncookiesRecv", N_("%u SYN cookies received"), opt_number},
- {"SyncookiesFailed", N_("%u invalid SYN cookies received"), opt_number},
+ {"SyncookiesSent", N_("%llu SYN cookies sent"), opt_number},
+ {"SyncookiesRecv", N_("%llu SYN cookies received"), opt_number},
+ {"SyncookiesFailed", N_("%llu invalid SYN cookies received"), opt_number},
- { "EmbryonicRsts", N_("%lu resets received for embryonic SYN_RECV sockets"),
- { "EmbryonicRsts", N_("%u resets received for embryonic SYN_RECV sockets"),
+ { "EmbryonicRsts", N_("%llu resets received for embryonic SYN_RECV sockets"),
opt_number },
- { "PruneCalled", N_("%lu packets pruned from receive queue because of socket"
- { "PruneCalled", N_("%u packets pruned from receive queue because of socket"
+ { "PruneCalled", N_("%llu packets pruned from receive queue because of socket"
" buffer overrun"), opt_number },
/* obsolete: 2.2.0 doesn't do that anymore */
- { "RcvPruned", N_("%lu packets pruned from receive queue"), opt_number },
- { "OfoPruned", N_("%lu packets dropped from out-of-order queue because of"
- { "RcvPruned", N_("%u packets pruned from receive queue"), opt_number },
- { "OfoPruned", N_("%u packets dropped from out-of-order queue because of"
+ { "RcvPruned", N_("%llu packets pruned from receive queue"), opt_number },
+ { "OfoPruned", N_("%llu packets dropped from out-of-order queue because of"
" socket buffer overrun"), opt_number },
- { "OutOfWindowIcmps", N_("%lu ICMP packets dropped because they were "
- { "OutOfWindowIcmps", N_("%u ICMP packets dropped because they were "
+ { "OutOfWindowIcmps", N_("%llu ICMP packets dropped because they were "
"out-of-window"), opt_number },
- { "LockDroppedIcmps", N_("%lu ICMP packets dropped because"
- { "LockDroppedIcmps", N_("%u ICMP packets dropped because"
+ { "LockDroppedIcmps", N_("%llu ICMP packets dropped because"
" socket was locked"), opt_number },
- { "TW", N_("%lu TCP sockets finished time wait in fast timer"), opt_number },
- { "TWRecycled", N_("%lu time wait sockets recycled by time stamp"), opt_number },
- { "TWKilled", N_("%lu TCP sockets finished time wait in slow timer"), opt_number },
- { "PAWSPassive", N_("%lu passive connections rejected because of"
- { "TW", N_("%u TCP sockets finished time wait in fast timer"), opt_number },
- { "TWRecycled", N_("%u time wait sockets recycled by time stamp"), opt_number },
- { "TWKilled", N_("%u TCP sockets finished time wait in slow timer"), opt_number },
- { "PAWSPassive", N_("%u passive connections rejected because of"
+ { "TW", N_("%llu TCP sockets finished time wait in fast timer"), opt_number },
+ { "TWRecycled", N_("%llu time wait sockets recycled by time stamp"), opt_number },
+ { "TWKilled", N_("%llu TCP sockets finished time wait in slow timer"), opt_number },
+ { "PAWSPassive", N_("%llu passive connections rejected because of"
" time stamp"), opt_number },
- { "PAWSActive", N_("%lu active connections rejected because of "
- { "PAWSActive", N_("%u active connections rejected because of "
+ { "PAWSActive", N_("%llu active connections rejected because of "
"time stamp"), opt_number },
- { "PAWSEstab", N_("%lu packets rejects in established connections because of"
- { "PAWSEstab", N_("%u packets rejects in established connections because of"
+ { "PAWSEstab", N_("%llu packets rejects in established connections because of"
" timestamp"), opt_number },
- { "DelayedACKs", N_("%lu delayed acks sent"), opt_number },
- { "DelayedACKLocked", N_("%lu delayed acks further delayed because of"
- { "DelayedACKs", N_("%u delayed acks sent"), opt_number },
- { "DelayedACKLocked", N_("%u delayed acks further delayed because of"
+ { "DelayedACKs", N_("%llu delayed acks sent"), opt_number },
+ { "DelayedACKLocked", N_("%llu delayed acks further delayed because of"
" locked socket"), opt_number },
- { "DelayedACKLost", N_("Quick ack mode was activated %lu times"), opt_number },
- { "ListenOverflows", N_("%lu times the listen queue of a socket overflowed"),
- { "DelayedACKLost", N_("Quick ack mode was activated %u times"), opt_number },
- { "ListenOverflows", N_("%u times the listen queue of a socket overflowed"),
+ { "DelayedACKLost", N_("Quick ack mode was activated %llu times"), opt_number },
+ { "ListenOverflows", N_("%llu times the listen queue of a socket overflowed"),
opt_number },
- { "ListenDrops", N_("%lu SYNs to LISTEN sockets ignored"), opt_number },
- { "TCPPrequeued", N_("%lu packets directly queued to recvmsg prequeue."),
+ { "ListenDrops", N_("%llu SYNs to LISTEN sockets ignored"), opt_number },
- { "ListenDrops", N_("%u SYNs to LISTEN sockets dropped"), opt_number },
- { "TCPPrequeued", N_("%u packets directly queued to recvmsg prequeue."),
+ { "ListenDrops", N_("%llu SYNs to LISTEN sockets dropped"), opt_number },
+ { "TCPPrequeued", N_("%llu packets directly queued to recvmsg prequeue."),
opt_number },
- { "TCPDirectCopyFromBacklog", N_("%lu packets directly received"
+ { "TCPDirectCopyFromBacklog", N_("%llu packets directly received"
" from backlog"), opt_number },
- { "TCPDirectCopyFromPrequeue", N_("%lu packets directly received"
+ { "TCPDirectCopyFromPrequeue", N_("%llu packets directly received"
" from prequeue"), opt_number },
- { "TCPPrequeueDropped", N_("%lu packets dropped from prequeue"), opt_number },
- { "TCPHPHits", N_("%lu packets header predicted"), number },
- { "TCPHPHitsToUser", N_("%lu packets header predicted and "
- { "TCPDirectCopyFromBacklog", N_("%u bytes directly in process context from backlog"), opt_number },
- { "TCPDirectCopyFromPrequeue", N_("%u bytes directly received in process context from prequeue"),
+ { "TCPDirectCopyFromBacklog", N_("%llu bytes directly in process context from backlog"), opt_number },
+ { "TCPDirectCopyFromPrequeue", N_("%llu bytes directly received in process context from prequeue"),
opt_number },
- { "TCPPrequeueDropped", N_("%u packets dropped from prequeue"), opt_number },
- { "TCPHPHits", N_("%u packet headers predicted"), number },
- { "TCPHPHitsToUser", N_("%u packets header predicted and "
+ { "TCPPrequeueDropped", N_("%llu packets dropped from prequeue"), opt_number },
+ { "TCPHPHits", N_("%llu packets header predicted"), number },
+ { "TCPHPHits", N_("%llu packet headers predicted"), number },
+ { "TCPHPHitsToUser", N_("%llu packets header predicted and "
"directly queued to user"), opt_number },
- { "SockMallocOOM", N_("Ran %lu times out of system memory during "
- { "SockMallocOOM", N_("Ran %u times out of system memory during "
+ { "SockMallocOOM", N_("Ran %llu times out of system memory during "
"packet sending"), opt_number },
- { "TCPPureAcks", N_("%u acknowledgments not containing data received"), opt_number },
- { "TCPPureAcks", N_("%u acknowledgments not containing data payload received"), opt_number },
- { "TCPHPAcks", N_("%u predicted acknowledgments"), opt_number },
- { "TCPRenoRecovery", N_("%u times recovered from packet loss due to fast retransmit"), opt_number },
- { "TCPSackRecovery", N_("%u times recovered from packet loss due to SACK data"), opt_number },
- { "TCPSACKReneging", N_("%u bad SACKs received"), opt_number },
- { "TCPSackRecovery", N_("%u times recovered from packet loss by selective acknowledgements"), opt_number },
- { "TCPSACKReneging", N_("%u bad SACK blocks received"), opt_number },
- { "TCPFACKReorder", N_("Detected reordering %u times using FACK"), opt_number },
- { "TCPSACKReorder", N_("Detected reordering %u times using SACK"), opt_number },
- { "TCPTSReorder", N_("Detected reordering %u times using time stamp"), opt_number },
- { "TCPRenoReorder", N_("Detected reordering %u times using reno fast retransmit"), opt_number },
- { "TCPFullUndo", N_("%u congestion windows fully recovered"), opt_number },
- { "TCPFullUndo", N_("%u congestion windows fully recovered without slow start"), opt_number },
- { "TCPPartialUndo", N_("%u congestion windows partially recovered using Hoe heuristic"), opt_number },
- { "TCPDSackUndo", N_("%u congestion window recovered using DSACK"), opt_number },
- { "TCPLossUndo", N_("%u congestion windows recovered after partial ack"), opt_number },
- { "TCPDSackUndo", N_("%u congestion window recovered without slow start using DSACK"), opt_number },
- { "TCPLossUndo", N_("%u congestion windows recovered without slow start after partial ack"), opt_number },
- { "TCPLostRetransmits", N_("%u retransmits lost"), opt_number },
- { "TCPRenoFailures", N_("%u timeouts after reno fast retransmit"), opt_number },
- { "TCPSackFailures", N_("%u timeouts after SACK recovery"), opt_number },
@ -235,7 +362,7 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
- { "TCPSlowStartRetrans", N_("%u retransmits in slow start"), opt_number },
- { "TCPTimeouts", N_("%u other TCP timeouts"), opt_number },
- { "TCPRenoRecoveryFailed", N_("%u reno fast retransmits failed"), opt_number },
- { "TCPSackRecoveryFail", N_("%u sack retransmits failed"), opt_number },
- { "TCPSackRecoveryFail", N_("%u SACK retransmits failed"), opt_number },
- { "TCPSchedulerFailed", N_("%u times receiver scheduled too late for direct processing"), opt_number },
- { "TCPRcvCollapsed", N_("%u packets collapsed in receive queue due to low socket buffer"), opt_number },
- { "TCPDSACKOldSent", N_("%u DSACKs sent for old packets"), opt_number },
@ -248,22 +375,23 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
- { "TCPAbortOnMemory", N_("%u connections aborted due to memory pressure"), opt_number },
- { "TCPAbortOnTimeout", N_("%u connections aborted due to timeout"), opt_number },
- { "TCPAbortOnLinger", N_("%u connections aborted after user close in linger timeout"), opt_number },
- { "TCPAbortFailed", N_("%u times unable to send RST due to no memory"), opt_number },
- { "TCPAbortFailed", N_("%u times unabled to send RST due to no memory"), opt_number },
- { "TCPMemoryPressures", N_("TCP ran low on memory %u times"), opt_number },
- { "TCPLoss", N_("%u TCP data loss events") },
+ { "TCPPureAcks", N_("%llu acknowledgments not containing data received"), opt_number },
- { "TCPLoss", N_("%u TCP data loss events"), opt_number },
- { "TCPDSACKUndo", N_("%u congestion windows recovered without slow start by DSACK"),
+ { "TCPPureAcks", N_("%llu acknowledgments not containing data payload received"), opt_number },
+ { "TCPHPAcks", N_("%llu predicted acknowledgments"), opt_number },
+ { "TCPRenoRecovery", N_("%llu times recovered from packet loss due to fast retransmit"), opt_number },
+ { "TCPSackRecovery", N_("%llu times recovered from packet loss due to SACK data"), opt_number },
+ { "TCPSACKReneging", N_("%llu bad SACKs received"), opt_number },
+ { "TCPSackRecovery", N_("%llu times recovered from packet loss by selective acknowledgements"), opt_number },
+ { "TCPSACKReneging", N_("%llu bad SACK blocks received"), opt_number },
+ { "TCPFACKReorder", N_("Detected reordering %llu times using FACK"), opt_number },
+ { "TCPSACKReorder", N_("Detected reordering %llu times using SACK"), opt_number },
+ { "TCPTSReorder", N_("Detected reordering %llu times using time stamp"), opt_number },
+ { "TCPRenoReorder", N_("Detected reordering %llu times using reno fast retransmit"), opt_number },
+ { "TCPFullUndo", N_("%llu congestion windows fully recovered"), opt_number },
+ { "TCPFullUndo", N_("%llu congestion windows fully recovered without slow start"), opt_number },
+ { "TCPPartialUndo", N_("%llu congestion windows partially recovered using Hoe heuristic"), opt_number },
+ { "TCPDSackUndo", N_("%llu congestion window recovered using DSACK"), opt_number },
+ { "TCPLossUndo", N_("%llu congestion windows recovered after partial ack"), opt_number },
+ { "TCPDSackUndo", N_("%llu congestion window recovered without slow start using DSACK"), opt_number },
+ { "TCPLossUndo", N_("%llu congestion windows recovered without slow start after partial ack"), opt_number },
+ { "TCPLostRetransmits", N_("%llu retransmits lost"), opt_number },
+ { "TCPRenoFailures", N_("%llu timeouts after reno fast retransmit"), opt_number },
+ { "TCPSackFailures", N_("%llu timeouts after SACK recovery"), opt_number },
@ -273,7 +401,7 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
+ { "TCPSlowStartRetrans", N_("%llu retransmits in slow start"), opt_number },
+ { "TCPTimeouts", N_("%llu other TCP timeouts"), opt_number },
+ { "TCPRenoRecoveryFailed", N_("%llu reno fast retransmits failed"), opt_number },
+ { "TCPSackRecoveryFail", N_("%llu sack retransmits failed"), opt_number },
+ { "TCPSackRecoveryFail", N_("%llu SACK retransmits failed"), opt_number },
+ { "TCPSchedulerFailed", N_("%llu times receiver scheduled too late for direct processing"), opt_number },
+ { "TCPRcvCollapsed", N_("%llu packets collapsed in receive queue due to low socket buffer"), opt_number },
+ { "TCPDSACKOldSent", N_("%llu DSACKs sent for old packets"), opt_number },
@ -286,51 +414,17 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
+ { "TCPAbortOnMemory", N_("%llu connections aborted due to memory pressure"), opt_number },
+ { "TCPAbortOnTimeout", N_("%llu connections aborted due to timeout"), opt_number },
+ { "TCPAbortOnLinger", N_("%llu connections aborted after user close in linger timeout"), opt_number },
+ { "TCPAbortFailed", N_("%llu times unable to send RST due to no memory"), opt_number },
+ { "TCPAbortFailed", N_("%llu times unabled to send RST due to no memory"), opt_number },
+ { "TCPMemoryPressures", N_("TCP ran low on memory %llu times"), opt_number },
+ { "TCPLoss", N_("%llu TCP data loss events") },
};
struct entry Sctptab[] =
{
- {"SctpCurrEstab", N_("%u Current Associations"), number},
- {"SctpActiveEstabs", N_("%u Active Associations"), number},
- {"SctpPassiveEstabs", N_("%u Passive Associations"), number},
- {"SctpAborteds", N_("%u Number of Aborteds "), number},
- {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number},
- {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number},
- {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number},
- {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number},
- {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number},
- {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number},
- {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number},
- {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number},
- {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number},
- {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number},
- {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number},
- {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number},
- {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number},
+ {"SctpCurrEstab", N_("%llu Current Associations"), number},
+ {"SctpActiveEstabs", N_("%llu Active Associations"), number},
+ {"SctpPassiveEstabs", N_("%llu Passive Associations"), number},
+ {"SctpAborteds", N_("%llu Number of Aborteds "), number},
+ {"SctpShutdowns", N_("%llu Number of Graceful Terminations"), number},
+ {"SctpOutOfBlues", N_("%llu Number of Out of Blue packets"), number},
+ {"SctpChecksumErrors", N_("%llu Number of Packets with invalid Checksum"), number},
+ {"SctpOutCtrlChunks", N_("%llu Number of control chunks sent"), number},
+ {"SctpOutOrderChunks", N_("%llu Number of ordered chunks sent"), number},
+ {"SctpOutUnorderChunks", N_("%llu Number of Unordered chunks sent"), number},
+ {"SctpInCtrlChunks", N_("%llu Number of control chunks received"), number},
+ {"SctpInOrderChunks", N_("%llu Number of ordered chunks received"), number},
+ {"SctpInUnorderChunks", N_("%llu Number of Unordered chunks received"), number},
+ {"SctpFragUsrMsgs", N_("%llu Number of messages fragmented"), number},
+ {"SctpReasmUsrMsgs", N_("%llu Number of messages reassembled "), number},
+ {"SctpOutSCTPPacks", N_("%llu Number of SCTP packets sent"), number},
+ {"SctpInSCTPPacks", N_("%llu Number of SCTP packets received"), number},
+ { "TCPLoss", N_("%llu TCP data loss events"), opt_number },
+ { "TCPDSACKUndo", N_("%llu congestion windows recovered without slow start by DSACK"),
opt_number },
- { "TCPRenoRecoveryFail", N_("%u classic Reno fast retransmits failed"), opt_number },
+ { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
};
struct tabtab {
@@ -271,7 +271,7 @@ int cmpentries(const void *a, const void
@@ -332,7 +332,7 @@ int cmpentries(const void *a, const void
return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title);
}
@ -339,7 +433,7 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
{
struct entry *ent = NULL, key;
int type;
@@ -283,7 +283,7 @@ void printval(struct tabtab *tab, char *
@@ -344,7 +344,7 @@ void printval(struct tabtab *tab, char *
sizeof(struct entry), cmpentries);
if (!ent) { /* try our best */
if (val)
@ -348,7 +442,7 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
return;
}
type = ent->type;
@@ -390,7 +390,7 @@ void process_fd(FILE *f,int file_desc)
@@ -454,7 +454,7 @@ int process_fd(FILE *f, int all, char *f
*p = '\0';
if (*sp != '\0' && *(tab->flag))
@ -357,12 +451,18 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
sp = p + 1;
}
@@ -426,7 +426,7 @@ void process_fd2(FILE *f, const char *fi
sp += strspn(sp, " \t\n");
if (*sp != '\0' && *(tab->flag))
- printval(tab, buf1, strtoul(sp, 0, 10));
+ printval(tab, buf1, strtoull(sp, 0, 10));
}
return;
@@ -481,12 +481,12 @@ void cpytitle(char *original, char *new)
void process6_fd(FILE *f)
{
char buf1[1024],buf2[50],buf3[1024];
- unsigned long val;
+ unsigned long long val;
struct tabtab *tab = NULL;
int cpflg = 0;
while (fgets(buf1, sizeof buf1, f)) {
- sscanf(buf1, "%s %lu", buf2, &val);
+ sscanf(buf1, "%s %llu", buf2, &val);
if(!cpflg) {
cpytitle(buf2, buf3);
tab = newtable(snmp6tabs, buf3);

View File

@ -1,17 +1,7 @@
--- net-tools-1.60/ifconfig.c.old 2005-03-30 10:14:03.000000000 +0200
+++ net-tools-1.60/ifconfig.c 2005-03-30 10:40:50.000000000 +0200
@@ -177,7 +177,7 @@
static void usage(void)
{
- fprintf(stderr, _("Usage:\n ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]\n"));
+ fprintf(stderr, _("Usage:\n ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"));
#if HAVE_AFINET
fprintf(stderr, _(" [add <address>[/<prefixlen>]]\n"));
fprintf(stderr, _(" [del <address>[/<prefixlen>]]\n"));
--- net-tools-1.60/lib/interface.c.old 2005-03-30 10:14:03.000000000 +0200
+++ net-tools-1.60/lib/interface.c 2005-03-30 11:05:38.000000000 +0200
@@ -620,7 +620,7 @@
diff -up net-tools-1.60/lib/interface.c.trim-iface net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.trim-iface 2011-12-02 18:00:09.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2011-12-02 18:02:50.143689438 +0100
@@ -638,7 +638,7 @@ int do_if_print(struct interface *ife, v
void ife_print_short(struct interface *ptr)
{
@ -20,12 +10,3 @@
printf("%5d %3d ", ptr->mtu, ptr->metric);
/* If needed, display the interface statistics. */
if (ptr->statistics_valid) {
@@ -711,7 +711,7 @@
if (hw == NULL)
hw = get_hwntype(-1);
- printf(_("%-9.9s Link encap:%s "), ptr->name, hw->title);
+ printf(_("%-9s Link encap:%s "), ptr->name, hw->title);
/* For some hardware types (eg Ash, ATM) we don't print the
hardware address if it's null. */
if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&

View File

@ -1,20 +1,18 @@
--- 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 @@
diff -up net-tools-1.60/lib/interface.c.virtualname net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.virtualname 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2011-11-23 18:54:31.881194851 +0100
@@ -597,8 +597,8 @@ int do_if_print(struct interface *ife, v
void ife_print_short(struct interface *ptr)
{
- printf("%-5.5s ", ptr->name);
- printf("%5d %3d", ptr->mtu, ptr->metric);
- printf("%5d %-2d ", 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 ",
printf("%8llu %6lu %6lu %-6lu ",
@@ -608,7 +608,7 @@ void ife_print_short(struct interface *p
ptr->stats.tx_packets, ptr->stats.tx_errors,
ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors);
} else {
@ -23,9 +21,10 @@
}
/* 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 @@
diff -up net-tools-1.60/netstat.c.virtualname net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.virtualname 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-11-23 18:54:00.563586374 +0100
@@ -1619,7 +1619,7 @@ static int iface_info(void)
}
if (flag_exp < 2) {
ife_short = 1;

View File

@ -1,6 +1,7 @@
--- net-tools-1.60/lib/pathnames.h.orig 2006-04-12 22:14:07.943885000 -0400
+++ net-tools-1.60/lib/pathnames.h 2006-04-12 22:19:34.072430000 -0400
@@ -42,8 +42,8 @@
diff -up net-tools-1.60/lib/pathnames.h.x25 net-tools-1.60/lib/pathnames.h
--- net-tools-1.60/lib/pathnames.h.x25 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/pathnames.h 2011-12-05 17:00:49.917886688 +0100
@@ -49,8 +49,8 @@
#define _PATH_PROCNET_RARP "/proc/net/rarp"
#define _PATH_ETHERS "/etc/ethers"
#define _PATH_PROCNET_ROSE_ROUTE "/proc/net/rose_routes"
@ -9,5 +10,5 @@
+#define _PATH_PROCNET_X25 "/proc/net/x25"
+#define _PATH_PROCNET_X25_ROUTE "/proc/net/x25/route"
#define _PATH_PROCNET_DEV_MCAST "/proc/net/dev_mcast"
#define _PATH_PROCNET_ATALK_ROUTE "/proc/net/atalk_route"
/* pathname for the netlink device */

View File

@ -1,12 +1,15 @@
%global checkout 20111206git
Summary: Basic networking tools
Name: net-tools
Version: 1.60
Release: 128%{?dist}
Release: 129.%{checkout}%{?dist}
License: GPL+
Group: System Environment/Base
URL: http://net-tools.sourceforge.net
Source0: http://downloads.sourceforge.net/net-tools/net-tools-%{version}.tar.bz2
# git archive --format=tar --remote=git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools master | gzip > net-tools-%%{version}.%%{checkout}.tar.gz
Source0: net-tools-%{version}.%{checkout}.tar.gz
Source1: net-tools-%{version}-config.h
Source2: net-tools-%{version}-config.make
Source3: ether-wake.c
@ -17,119 +20,234 @@ Source7: iptunnel.8
Source8: ipmaddr.8
Source9: arp-ethers.service
Patch1: net-tools-1.57-bug22040.patch
Patch2: net-tools-1.60-miiioctl.patch
Patch3: net-tools-1.60-manydevs.patch
# Not needed
#Patch1: net-tools-1.57-bug22040.patch
# We don't use include/mii.h anyway (see mii-refactor.patch)
#Patch2: net-tools-1.60-miiioctl.patch
# Rewritten upstream, hopefully this won't be needed.
#Patch3: net-tools-1.60-manydevs.patch
# Fixes formating of 'netstat -i'
Patch4: net-tools-1.60-virtualname.patch
# adds <delay> option that allows netstat to cycle printing through statistics every delay seconds.
Patch5: net-tools-1.60-cycle.patch
Patch6: net-tools-1.60-nameif.patch
# Merged upstream
#Patch6: net-tools-1.60-nameif.patch
# Fixed incorrect address display for ipx (#46434)
Patch7: net-tools-1.60-ipx.patch
# hostname lookup problems with route --inet6 (#84108)
Patch8: net-tools-1.60-inet6-lookup.patch
# various man page fixes merged into one patch
Patch9: net-tools-1.60-man.patch
Patch10: net-tools-1.60-gcc33.patch
Patch11: net-tools-1.60-trailingblank.patch
# Fixed upstream
#Patch10: net-tools-1.60-gcc33.patch
# hostname patch
#Patch11: net-tools-1.60-trailingblank.patch
# netstat: interface option now works as described in the man page (#61113, #115987)
Patch12: net-tools-1.60-interface.patch
Patch14: net-tools-1.60-gcc34.patch
Patch15: net-tools-1.60-overflow.patch
Patch19: net-tools-1.60-siunits.patch
Patch20: net-tools-1.60-trunc.patch
Patch21: net-tools-1.60-return.patch
Patch22: net-tools-1.60-parse.patch
Patch23: net-tools-1.60-netmask.patch
Patch24: net-tools-1.60-ulong.patch
# Fixed upstream
#Patch14: net-tools-1.60-gcc34.patch
# Fixed upstream
#Patch15: net-tools-1.60-overflow.patch
# Fixed upstream
#Patch19: net-tools-1.60-siunits.patch
# (#128359) Fixed upstream
#Patch20: net-tools-1.60-trunc.patch
# The return value of nameif was wrong (#129032) - patch from Fujitsu QA
Patch21: net-tools-1.60-nameif-return.patch
# (#131539) Fixed upstream
#Patch22: net-tools-1.60-parse.patch
# Fixed upstream
#Patch23: net-tools-1.60-netmask.patch
# netstat -s (statistics.c) now uses unsigned long long handle 64 bit integers (Bug #579854, Debian #561161)
Patch24: net-tools-1.60-statistics-doubleword.patch
# calculate broadcast only when netmask provided (#60509)
Patch25: net-tools-1.60-bcast.patch
Patch27: net-tools-1.60-netstat_ulong.patch
Patch28: net-tools-1.60-note.patch
Patch29: net-tools-1.60-num-ports.patch
# Fixed upstream
#Patch27: net-tools-1.60-netstat_ulong.patch
# hostname man page fix
#Patch28: net-tools-1.60-note.patch
# fixed --num-ports option for netstat (#115100)
# fixed upstream
#Patch29: net-tools-1.60-num-ports.patch
# filter out duplicate tcp entries (#139407)
Patch30: net-tools-1.60-duplicate-tcp.patch
# don't report statistics for virtual devices (#143981)
Patch31: net-tools-1.60-statalias.patch
Patch32: net-tools-1.60-isofix.patch
Patch34: net-tools-1.60-ifconfig_ib.patch
Patch35: net-tools-1.60-de.patch
Patch37: net-tools-1.60-pie.patch
Patch38: net-tools-1.60-ifaceopt.patch
# translation headers - content type format
# is it good for anything ?
#Patch32: net-tools-1.60-isofix.patch
# Merged upstream
#Patch34: net-tools-1.60-ifconfig_ib.patch
# Fixed upstream
#Patch35: net-tools-1.60-de.patch
# not needed
#Patch37: net-tools-1.60-pie.patch
# merged into interface.patch
#Patch38: net-tools-1.60-ifaceopt.patch
# stop trimming interface names longer than 9 characters (#152457)
Patch39: net-tools-1.60-trim_iface.patch
Patch40: net-tools-1.60-stdo.patch
Patch41: net-tools-1.60-statistics.patch
Patch42: net-tools-1.60-ifconfig.patch
# flush output in mii-tool (#152568)
# Fixed upstream
#Patch40: net-tools-1.60-stdo.patch
# netstat has new statistcs (#133032)
# Fixed upstream
#Patch41: net-tools-1.60-statistics.patch
# Fixed upstream
#Patch42: net-tools-1.60-ifconfig.patch
# buffer overflow in arp (#164695)
Patch43: net-tools-1.60-arp_overflow.patch
Patch44: net-tools-1.60-hostname_man.patch
# hostname patch
#Patch44: net-tools-1.60-hostname_man.patch
# clear static buffers in interface.c by Ulrich Drepper (#176714)
Patch45: net-tools-1.60-interface_stack.patch
# new option for nestat, -Z shows selinux context
Patch46: net-tools-1.60-selinux.patch
Patch47: net-tools-1.60-netstat_stop_trim.patch
Patch48: net-tools-1.60-netstat_inode.patch
# new option for netstat - -T stops trimming remote and local addresses (#176465)
# Merged upstream as -W option
#Patch47: net-tools-1.60-netstat_stop_trim.patch
# show inodes in netstat (#180974)
# fixed upstream
#Patch48: net-tools-1.60-netstat_inode.patch
# remove duplicate arp entries (#185604)
Patch49: net-tools-1.60-fgets.patch
# wrong definition of _PATH_PROCNET_X25_ROUTE (#188786)
Patch51: net-tools-1.60-x25-proc.patch
Patch52: net-tools-1.60-sctp.patch
# statistics for SCTP
Patch52: net-tools-1.60-sctp-statistics.patch
# ifconfig crash when interface name is too long (#190703)
Patch54: net-tools-1.60-ifconfig-long-iface-crasher.patch
Patch55: net-tools-1.60-netdevice.patch
Patch56: net-tools-1.60-skip.patch
Patch57: net-tools-1.60-netstat-I-fix.patch
# Fixed upstream
#Patch55: net-tools-1.60-netdevice.patch
# Fixed upstream
#Patch56: net-tools-1.60-skip.patch
# Merged into interface.patch
#Patch57: net-tools-1.60-netstat-I-fix.patch
# nameif crash for 16char long interface names (#209120)
Patch58: net-tools-1.60-nameif_strncpy.patch
Patch59: net-tools-1.60-arp-unaligned-access.patch
Patch60: net-tools-1.60-sctp-quiet.patch
Patch61: net-tools-1.60-remove_node.patch
Patch62: net-tools-1.60-netstat-interfaces-crash.patch
Patch64: net-tools-1.60-ec_hw_null.patch
Patch65: net-tools-1.60-statistics_buffer.patch
Patch66: net-tools-1.60-sctp-addrs.patch
Patch67: net-tools-1.60-i-option.patch
# fix arp unaligned access (#220438)
# Fixed upstream
#Patch59: net-tools-1.60-arp-unaligned-access.patch
# Fixed upstream
#Patch60: net-tools-1.60-sctp-quiet.patch
# hostname patch
#Patch61: net-tools-1.60-remove_node.patch
# merged into interface.patch
#Patch62: net-tools-1.60-netstat-interfaces-crash.patch
# Fixed upstream
#Patch64: net-tools-1.60-ec_hw_null.patch
# Fixed upstream
#Patch65: net-tools-1.60-statistics_buffer.patch
# Rewritten upstream
#Patch66: net-tools-1.60-sctp-addrs.patch
# merged into interface.patch
#Patch67: net-tools-1.60-i-option.patch
# fixed clearing flags in ifconfig (#450252)
Patch69: net-tools-1.60-clear-flag.patch
# fixed tcp timers info in netstat (#466845)
Patch71: net-tools-1.60-netstat-probe.patch
# scanf format length fix (non-exploitable)
# prevent 'netstat -nr -A inet6' from smashing stack (#668047)
Patch72: net-tools-1.60-scanf-format.patch
# netstat - avoid name resolution for listening or established sockets (-l) by return fast
Patch73: net-tools-1.60-avoid-name-resolution.patch
# upstream
#Patch73: net-tools-1.60-avoid-name-resolution.patch
# netstat - --continuous should flush stdout
Patch74: net-tools-1.60-continous-flush-stdout.patch
# upstream
#Patch74: net-tools-1.60-continous-flush-stdout.patch
# fix some errors so net-tools can be build with DEBUG defined
Patch75: net-tools-1.60-debug-fix.patch
# upstream
#Patch75: net-tools-1.60-debug-fix.patch
# let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address
Patch76: net-tools-1.60-ib-warning.patch
# handle raw "IP" masqinfo
Patch79: net-tools-1.60-masqinfo-raw-ip.patch
# upstream
#Patch79: net-tools-1.60-masqinfo-raw-ip.patch
# touch up build system to respect normal toolchain env vars rather than requiring people to set random custom ones
# add missing dependency on version.h to libdir target to fix parallel build failures
# convert -idirafter to -I
Patch80: net-tools-1.60-makefile-berlios.patch
# upstream
#Patch80: net-tools-1.60-makefile-berlios.patch
# slattach: use fchown() rather than chown() to avoid race between creation and permission changing
Patch81: net-tools-1.60-slattach-fchown.patch
#Patch81: net-tools-1.60-slattach-fchown.patch
# Bug 531702: make "hostname -s" display host name cut at the first dot (no matter if the host name resolves or not)
Patch82: net-tools-1.60-hostname-short.patch
# hostname patch
#Patch82: net-tools-1.60-hostname-short.patch
# use <linux/mii.h> instead of "mii.h" and fix Bug #491358
Patch83: net-tools-1.60-mii-refactor.patch
# Bug 473211: ifconfig interface:0 del <IP> will remove the Aliased IP on IA64
# interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways
# ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 (#473211)
Patch84: net-tools-1.60-IA64.patch
# interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543)
Patch85: net-tools-1.60-large-indexes.patch
# upstream
#Patch85: net-tools-1.60-large-indexes.patch
# netstat -s (statistics.c) now uses unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161)
Patch86: net-tools-1.60-statistics-doubleword.patch
# update mii-tool to support gigabit links (#539575)
Patch87: net-tools-1.60-mii-gigabit.patch
# Fixed upstream
#Patch87: net-tools-1.60-mii-gigabit.patch
# fix memory leak in netstat when run with -c option
Patch88: net-tools-1.60-netstat-leak.patch
# HFI support
Patch89: net-tools-1.60-hfi.patch
# Fix the handling of some of the HAVE_* flags ifdef vs if. (BerliOS #17812)
Patch90: net-tools-1.60-ifdef-vs-if.patch
# upstream
#Patch90: net-tools-1.60-ifdef-vs-if.patch
# Don't rely on eth0 being default network device name.
# Since Fedora 15 network devices can have arbitrary names (#682367)
@ -138,14 +256,13 @@ Patch91: net-tools-1.60-arbitrary-device-names.patch
# plipconfig man page and usage output fixes. (#694766)
Patch92: net-tools-1.60-plipconfig.patch
# patch netstat to separate basename of -p only if it is absolute
# path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0).
# netstat: remove part starting with colon in 'PID/Program name' column (#707427)
Patch93: net-tools-1.60-netstat-p-basename.patch
# Possible problems found by static analysis of code.
Patch94: net-tools-1.60-coverity.patch
# Update for 2 digit Linux version numbers
# Update for 2 digit Linux version numbers (#718610)
Patch95: net-tools-1.60-2digit.patch
BuildRequires: gettext, libselinux
@ -160,84 +277,83 @@ including ifconfig, netstat, route, and others.
Most of them are obsolete. For replacement check iproute package.
%prep
%setup -q
%patch1 -p1 -b .bug22040
%patch2 -p1 -b .miiioctl
%patch3 -p0 -b .manydevs
%setup -q -c
#%%patch1 -p1 -b .bug22040
#%%patch2 -p1 -b .miiioctl
#%%patch3 -p0 -b .manydevs
%patch4 -p1 -b .virtualname
%patch5 -p1 -b .cycle
%patch6 -p1 -b .nameif
#%%patch6 -p1 -b .nameif
%patch7 -p1 -b .ipx
%patch8 -p1 -b .inet6-lookup
%patch9 -p1 -b .man
%patch10 -p1 -b .gcc33
%patch11 -p1 -b .trailingblank
#%%patch10 -p1 -b .gcc33
#%%patch11 -p1 -b .trailingblank
%patch12 -p1 -b .interface
%patch14 -p1 -b .gcc34
%patch15 -p1 -b .overflow
%patch19 -p1 -b .siunits
%patch20 -p1 -b .trunc
#%%patch14 -p1 -b .gcc34
#%%patch15 -p1 -b .overflow
#%%patch19 -p1 -b .siunits
#%%patch20 -p1 -b .trunc
%patch21 -p1 -b .return
%patch22 -p1 -b .parse
%patch23 -p1 -b .netmask
%patch24 -p1 -b .ulong
#%%patch22 -p1 -b .parse
#%%patch23 -p1 -b .netmask
%patch24 -p1 -b .doubleword
%patch25 -p1 -b .bcast
%patch27 -p1 -b .netstat_ulong
%patch28 -p1 -b .note
%patch29 -p1 -b .num-ports
#%%patch27 -p1 -b .netstat_ulong
#%%patch28 -p1 -b .note
#%%patch29 -p1 -b .num-ports
%patch30 -p1 -b .dup-tcp
%patch31 -p1 -b .statalias
%patch32 -p1 -b .isofix
%patch34 -p1 -b .ifconfig_ib
%patch35 -p1
%patch37 -p1 -b .pie
%patch38 -p1 -b .ifaceopt
#%%patch32 -p1 -b .isofix
#%%patch34 -p1 -b .ifconfig_ib
#%%patch35 -p1
#%%patch37 -p1 -b .pie
#%%patch38 -p1 -b .ifaceopt
%patch39 -p1 -b .trim-iface
%patch40 -p1 -b .stdo
%patch41 -p1 -b .statistics
%patch42 -p1 -b .iface_drop
#%%patch40 -p1 -b .stdo
#%%patch41 -p1 -b .statistics
#%%patch42 -p1 -b .iface_drop
%patch43 -p1 -b .overflow
%patch44 -p1 -b .hostname_man
%patch45 -p0 -b .stack
#%%patch44 -p1 -b .hostname_man
%patch45 -p1 -b .stack
%patch46 -p1 -b .selinux
%patch47 -p1 -b .trim
%patch48 -p1 -b .inode
#%%patch47 -p1 -b .trim
#%%patch48 -p1 -b .inode
%patch49 -p1 -b .fgets
%patch51 -p1 -b .x25
%patch52 -p1 -b .sctp
%patch54 -p1 -b .long_iface
%patch55 -p1 -b .netdevice
%patch56 -p1 -b .skip
%patch57 -p1
#%%patch55 -p1 -b .netdevice
#%%patch56 -p1 -b .skip
#%%patch57 -p1
%patch58 -p1 -b .strncpy
%patch59 -p1 -b .arp-un-access
%patch60 -p1 -b .quiet
%patch61 -p1
%patch62 -p1 -b .iface-crash
%patch64 -p1
%patch65 -p1 -b .buffer
%patch66 -p1 -b .sctp-addrs
%patch67 -p1 -b .i-option
#%%patch59 -p1 -b .arp-un-access
#%%patch60 -p1 -b .quiet
#%%patch61 -p1
#%%patch62 -p1 -b .iface-crash
#%%patch64 -p1
#%%patch65 -p1 -b .buffer
#%%patch66 -p1 -b .sctp-addrs
#%%patch67 -p1 -b .i-option
%patch69 -p1 -b .clear-flag
%patch71 -p1 -b .probe
%patch72 -p1 -b .scanf-format
%patch73 -p1 -b .avoid-name-resolution
%patch74 -p1 -b .continous-flush-stdout
%patch75 -p1 -b .debug-fix
#%%patch73 -p1 -b .avoid-name-resolution
#%%patch74 -p1 -b .continous-flush-stdout
#%%patch75 -p1 -b .debug-fix
%patch76 -p1 -b .ib-warning
%patch79 -p1 -b .masqinfo-raw-ip
%patch80 -p1 -b .makefile-berlios
%patch81 -p1 -b .slattach-fchown
%patch82 -p1 -b .hostname-short
#%%patch79 -p1 -b .masqinfo-raw-ip
#%%patch80 -p1 -b .makefile-berlios
#%%patch81 -p1 -b .slattach-fchown
#%%patch82 -p1 -b .hostname-short
%patch83 -p1 -b .mii-refactor
%patch84 -p1 -b .IA64
%patch85 -p1 -b .large-indexes
%patch86 -p1 -b .doubleword
%patch87 -p1 -b .mii-gigabit
#%%patch85 -p1 -b .large-indexes
#%%patch87 -p1 -b .mii-gigabit
%patch88 -p1 -b .netstat-leak
%patch89 -p1 -b .hfi
%patch90 -p1 -b .ifdef-vs-if
#%%patch90 -p1 -b .ifdef-vs-if
%patch91 -p1 -b .arbitrary-device-names
%patch92 -p1 -b .plipconfig
%patch93 -p1 -b .p-basename
@ -294,7 +410,6 @@ gcc $RPM_OPT_FLAGS -o ether-wake ether-wake.c
gcc $RPM_OPT_FLAGS -o mii-diag mii-diag.c
%install
rm -rf %{buildroot}
mv man/de_DE man/de
mv man/fr_FR man/fr
mv man/pt_BR man/pt
@ -335,7 +450,6 @@ fi
%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING
/bin/netstat
/sbin/*
@ -346,6 +460,10 @@ fi
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
%changelog
* Wed Nov 23 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-129.20111206git
- upstream git snapshot
- reduced number of patches from 95 to 32
* Tue Oct 25 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-128
- Removed HFI support.
- Improved num-ports.patch