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 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.IA64 2011-12-06 14:36:57.158662389 +0100
+++ net-tools-1.60/ifconfig.c 2010-01-02 11:35:39.000000000 +0100 +++ net-tools-1.60/ifconfig.c 2011-12-06 14:36:57.247661276 +0100
@@ -894,7 +894,8 @@ int main(int argc, char **argv) @@ -914,7 +914,8 @@ int main(int argc, char **argv)
continue; 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) { if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
fprintf(stderr, _("Interface %s not initialized\n"), 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 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.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-03-07 16:41:22.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-indep @@ -16,7 +16,7 @@ mii\-tool \- view, manipulate media-inde
[\fB\-l\fR, \fB\-\-log\fR] [\fB\-l\fR, \fB\-\-log\fR]
[\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR] [\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR]
[\fB\-F\fR, \fB\-\-force=\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 .PP
The default short output reports the negotiated link speed and link The default short output reports the negotiated link speed and link
-status for each interface. If an interface or interfaces are not -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. -available interfaces from \fBeth0\fR through \fBeth7\fR.
+status for each interface. +status for each interface.
.SH OPTIONS .SH OPTIONS
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \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 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.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2011-03-07 16:44:52.000000000 +0100 +++ net-tools-1.60/mii-tool.c 2011-12-06 14:53:39.823127359 +0100
@@ -419,7 +419,7 @@ static void watch_one_xcvr(int skfd, cha @@ -424,7 +424,7 @@ static void watch_one_xcvr(int skfd, cha
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
const char *usage = "\ const char *usage =
-usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\ -"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
+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, --version display version information\n"
-v, --verbose more verbose output\n\ " -v, --verbose more verbose output\n"
-R, --reset reset MII to poweron state\n\ " -R, --reset reset MII to poweron state\n"
@@ -474,13 +474,10 @@ int main(int argc, char **argv) @@ -491,13 +491,10 @@ int main(int argc, char **argv)
/* No remaining args means show all interfaces. */ /* No remaining args means show all interfaces. */
if (optind == argc) { 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 { } else {
ret = 0; ret = 0;
for (i = optind; i < argc; i++) { 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)) { if (opt_watch && (ret == 0)) {
while (1) { while (1) {
sleep(1); sleep(1);

View File

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

View File

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

View File

@ -1,20 +1,19 @@
diff -up net-tools-1.60/ipmaddr.c.coverity net-tools-1.60/ipmaddr.c 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/ipmaddr.c 2011-04-28 16:35:24.000000000 +0200 +++ net-tools-1.60/ipmaddr.c 2011-12-06 15:16:27.210032670 +0100
@@ -160,7 +160,11 @@ void read_dev_mcast(struct ma_info **res @@ -160,6 +160,11 @@ void read_dev_mcast(struct ma_info **res
len = parse_hex(hexa, (unsigned char*)&m.addr.data); len = parse_hex(hexa, (unsigned char*)&m.addr.data);
if (len >= 0) { if (len >= 0) {
struct ma_info *ma = malloc(sizeof(m)); struct ma_info *ma = malloc(sizeof(m));
-
+ if (!ma) { + if (!ma) {
+ fprintf(stderr, "couldn't allocate memory\n"); + fprintf(stderr, "couldn't allocate memory\n");
+ fclose(fp); + fclose(fp);
+ return; + return;
+ } + }
memcpy(ma, &m, sizeof(m)); memcpy(ma, &m, sizeof(m));
ma->addr.bytelen = len; ma->addr.bytelen = len;
ma->addr.bitlen = len<<3; @@ -174,7 +179,7 @@ void read_dev_mcast(struct ma_info **res
@@ -174,7 +178,7 @@ void read_dev_mcast(struct ma_info **res
void read_igmp(struct ma_info **result_p) 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]; char buf[256];
FILE *fp = fopen(_PATH_PROCNET_IGMP, "r"); 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; m.addr.bytelen = 4;
while (fgets(buf, sizeof(buf), fp)) { 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') { if (buf[0] != '\t') {
sscanf(buf, "%d%s", &m.index, m.name); sscanf(buf, "%d%s", &m.index, m.name);
continue; 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); sscanf(buf, "%08x%d", (__u32*)&m.addr.data, &m.users);
ma = malloc(sizeof(m)); 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)); memcpy(ma, &m, sizeof(m));
maddr_ins(result_p, ma); 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); len = parse_hex(hexa, (unsigned char*)&m.addr.data);
if (len >= 0) { if (len >= 0) {
struct ma_info *ma = malloc(sizeof(m)); 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)); memcpy(ma, &m, sizeof(m));
diff -up net-tools-1.60/iptunnel.c.coverity net-tools-1.60/iptunnel.c 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/iptunnel.c 2011-04-28 15:26:06.000000000 +0200 +++ 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 @@ -485,6 +485,7 @@ static int do_tunnels_list(struct ip_tun
if ((ptr = strchr(buf, ':')) == NULL || if ((ptr = strchr(buf, ':')) == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { (*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 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet.c 2011-04-28 14:39:06.000000000 +0200 +++ 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 @@ -211,10 +211,18 @@ static int INET_rresolve(char *name, siz
if ((ent == NULL) && (np == NULL)) if ((ent == NULL) && (np == NULL))
safe_strncpy(name, inet_ntoa(sin->sin_addr), len); 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->name = strdup(pe->p_name);
item->number = htons(pe->p_proto); item->number = htons(pe->p_proto);
add2list(&raw_name, item); 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 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/masq_info.c 2011-04-28 15:34:06.000000000 +0200 +++ 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 @@ -208,10 +208,9 @@ int ip_masq_info(int numeric_host, int n
} }
for (i = 0; i < ntotal; i++) 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 #endif
diff -up net-tools-1.60/lib/netrom_gr.c.coverity net-tools-1.60/lib/netrom_gr.c 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/netrom_gr.c 2011-04-28 14:15:38.000000000 +0200 +++ 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) @@ -39,9 +39,7 @@ int NETROM_rprint(int options)
/*int ext = options & FLAG_EXT; /*int ext = options & FLAG_EXT;
int numeric = options & FLAG_NUM_HOST; */ 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) { if (f1 == NULL || f2 == NULL) {
diff -up net-tools-1.60/lib/x25.c.coverity net-tools-1.60/lib/x25.c 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.coverity 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/x25.c 2011-04-28 15:01:47.000000000 +0200 +++ net-tools-1.60/lib/x25.c 2011-12-06 15:24:37.189907079 +0100
@@ -106,7 +106,8 @@ X25_input(int type, char *bufp, struct s @@ -105,7 +105,8 @@ X25_input(int type, char *bufp, struct s
} }
if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) { 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 = '/'; + *p = '/';
strcpy(X25_errmsg, _("Invalid address")); strcpy(X25_errmsg, _("Invalid address"));
#ifdef DEBUG #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 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.coverity 2011-12-06 15:12:17.000000000 +0100
+++ net-tools-1.60/nameif.c 2011-04-28 15:55:20.000000000 +0200 +++ net-tools-1.60/nameif.c 2011-12-06 15:28:06.417291375 +0100
@@ -154,6 +154,7 @@ void readconf(void) @@ -154,6 +154,7 @@ void readconf(void)
FILE *ifh; FILE *ifh;
char *p; 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"); ifh = fopen(fname, "r");
if (!ifh) if (!ifh)
@@ -163,7 +164,7 @@ void readconf(void) @@ -163,7 +164,6 @@ void readconf(void)
linel = 0; linel = 0;
linenum = 1; linenum = 1;
while (getdelim(&line, &linel, '\n', ifh) > 0) { while (getdelim(&line, &linel, '\n', ifh) > 0) {
- struct change *ch = xmalloc(sizeof(struct change)); - struct change *ch = xmalloc(sizeof(struct change));
+
char pos[20]; char pos[20];
sprintf(pos, _("line %d"), linenum); sprintf(pos, _("line %d"), linenum);
@@ -178,6 +179,11 @@ void readconf(void) @@ -178,6 +178,11 @@ void readconf(void)
n = strcspn(p, " \t"); n = strcspn(p, " \t");
if (n > IFNAMSIZ) if (n > IFNAMSIZ-1)
complain(_("interface name too long at line %d"), line); complain(_("interface name too long at line %d"), line);
+ ch = xmalloc(sizeof(struct change)); + ch = xmalloc(sizeof(struct change));
+ if (!ch) { + 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; ch->ifname[n] = 0;
p += n; p += n;
diff -up net-tools-1.60/netstat.c.coverity net-tools-1.60/netstat.c 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.coverity 2011-12-06 15:12:17.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-04-28 15:58:44.000000000 +0200 +++ net-tools-1.60/netstat.c 2011-12-06 15:32:36.060920366 +0100
@@ -461,6 +461,8 @@ static void prg_cache_load(void) @@ -434,6 +434,8 @@ static void prg_cache_load(void)
PATH_FD_SUFFl+1); PATH_FD_SUFFl+1);
strcpy(line + procfdlen + 1, direfd->d_name); strcpy(line + procfdlen + 1, direfd->d_name);
lnamelen=readlink(line,lname,sizeof(lname)-1); 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; + continue;
lname[lnamelen] = '\0'; /*make it a null-terminated string*/ lname[lnamelen] = '\0'; /*make it a null-terminated string*/
extract_type_1_socket_inode(lname, &inode, &status); if (extract_type_1_socket_inode(lname, &inode) < 0)
@@ -902,7 +904,7 @@ static int x25_info(void) @@ -833,7 +835,7 @@ static int x25_info(void)
"ESTABLISHED", "ESTABLISHED",
"RECOVERY" "RECOVERY"
}; };
- if(!(f=fopen(_PATH_PROCNET_X25, "r"))) - if(!(f=proc_fopen(_PATH_PROCNET_X25)))
+ if(!f) + if(!f)
{ {
if (errno != ENOENT) { if (errno != ENOENT) {
perror(_PATH_PROCNET_X25); perror(_PATH_PROCNET_X25);
@@ -1931,6 +1933,7 @@ static int ipx_info(void) @@ -1716,6 +1718,7 @@ static int ipx_info(void)
printf("\n"); printf("\n");
if ((ap = get_afntype(AF_IPX)) == NULL) { if ((ap = get_afntype(AF_IPX)) == NULL) {
EINTERN("netstat.c", "AF_IPX missing"); 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); return (-1);
} }
fgets(buf, 255, f); 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); sport = ntohs(sport);
} else { } else {
EINTERN("netstat.c", _PATH_PROCNET_IPX " sport format error"); EINTERN("netstat.c", "ipx socket format error in source port");
+ fclose(f); + fclose(f);
return (-1); return (-1);
} }
nc = 0; nc = 0;
@@ -1954,6 +1958,7 @@ static int ipx_info(void) @@ -1739,6 +1743,7 @@ static int ipx_info(void)
dport = ntohs(dport); dport = ntohs(dport);
} else { } else {
EINTERN("netstat.c", _PATH_PROCNET_IPX " dport format error"); EINTERN("netstat.c", "ipx soket format error in destination port");
+ fclose(f); + fclose(f);
return (-1); return (-1);
} }

View File

@ -1,32 +1,34 @@
--- net-tools-1.60/lib/interface.c.cycle 2003-02-11 14:29:29.000000000 +0100 diff -up net-tools-1.60/lib/interface.c.cycle net-tools-1.60/lib/interface.c
+++ net-tools-1.60/lib/interface.c 2003-02-11 14:29:29.000000000 +0100 --- net-tools-1.60/lib/interface.c.cycle 2011-12-06 16:23:45.051552704 +0100
@@ -90,6 +90,7 @@ +++ 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 struct interface *int_list, *int_last;
static int if_readlist_proc(char *); static int if_readlist_proc(char *);
+static int if_readlist_rep(char *, struct interface *); +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) int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
{ {
struct interface *ife; struct interface *ife;
+ int err; + int err;
if (!int_list && (if_readlist() < 0)) if (!if_list_all && (if_readlist() < 0))
return -1; return -1;
for (ife = int_list; ife; ife = ife->next) { for (ife = int_list; ife; ife = ife->next) {
- int err = doit(ife, cookie); - int err = doit(ife, cookie);
+ if_readlist_rep(ife->name, ife); + if_readlist_rep(ife->name, ife);
+ err = doit(ife, cookie); + err = doit(ife, cookie);
+
if (err) if (err)
return err; return err;
} }
@@ -369,6 +372,42 @@ @@ -376,6 +380,41 @@ static int if_readlist_proc(char *target
fclose(fh);
return err; return err;
} }
+ +
+static int if_readlist_rep(char *target, struct interface *ife) +static int if_readlist_rep(char *target, struct interface *ife)
+{ +{
@ -62,59 +64,60 @@
+ fclose(fh); + fclose(fh);
+ return err; + return err;
+} +}
+
int if_readlist(void) int if_readlist(void)
{ {
int err = if_readlist_proc(NULL); 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 2001-01-07 13:43:57.000000000 +0100 --- 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 2003-02-11 14:29:29.000000000 +0100 +++ net-tools-1.60/man/en_US/netstat.8 2011-12-06 16:23:45.115551904 +0100
@@ -30,6 +30,7 @@ @@ -33,6 +33,7 @@ netstat \- Print network connections, ro
.RB [ \-\-program | \-p ]
.RB [ \-\-verbose | \-v ] .RB [ \-\-verbose | \-v ]
.RB [ \-\-continuous | \-c] .RB [ \-\-continuous | \-c]
.RB [ \-\-wide | \-W]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-route | \-r } .RB { \-\-route | \-r }
@@ -39,6 +40,7 @@ @@ -42,6 +43,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ] .RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ] .RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c] .RB [ \-\-continuous | \-c]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-interfaces | \-i } .RB { \-\-interfaces | \-i }
@@ -50,12 +52,14 @@ @@ -52,12 +54,14 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ] .RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ] .RB [ \-\-numeric-hosts "] [" \-\-numeric-ports "] [" \-\-numeric-users ]
.RB [ \-\-continuous | \-c] .RB [ \-\-continuous | \-c]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-groups | \-g } .RB { \-\-groups | \-g }
.RB [ \-\-numeric | \-n ] .RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ] .RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c] .RB [ \-\-continuous | \-c]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-masquerade | \-M } .RB { \-\-masquerade | \-M }
@@ -63,12 +67,14 @@ @@ -65,6 +69,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ] .RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ] .RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c] .RB [ \-\-continuous | \-c]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-statistics | -s } .RB { \-\-statistics | -s }
.RB [ \-\-tcp | \-t ] @@ -72,6 +77,7 @@ netstat \- Print network connections, ro
.RB [ \-\-udp | \-u ] .RB [ \-\-udp | \-u ]
.RB [ \-\-udplite | \-U ]
.RB [ \-\-raw | \-w ] .RB [ \-\-raw | \-w ]
+.RB [delay] +.RB [delay]
.P .P
.B netstat .B netstat
.RB { \-\-version | \-V } .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.) Print routing information from the FIB. (This is the default.)
.SS "\-C" .SS "\-C"
Print routing information from the route cache. Print routing information from the route cache.
@ -122,21 +125,38 @@
+Netstat will cycle printing through statistics every +Netstat will cycle printing through statistics every
+.B delay +.B delay
+seconds. +seconds.
.IR UP .
.P .P
.SH OUTPUT .SH OUTPUT
--- net-tools-1.60/netstat.c.cycle 2003-02-11 14:29:29.000000000 +0100 .P
+++ net-tools-1.60/netstat.c 2003-02-11 15:07:26.000000000 +0100 diff -up net-tools-1.60/netstat.c.cycle net-tools-1.60/netstat.c
@@ -102,7 +102,7 @@ --- 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 #endif
/* prototypes for statistics.c */ /* prototypes for statistics.c */
-void parsesnmp(int, int, int); -void parsesnmp(int, int, int);
+int parsesnmp(int, int, int); +int parsesnmp(int, int, int);
void inittab(void); void inittab(void);
-void parsesnmp6(int, int, int);
+int parsesnmp6(int, int, int);
void inittab6(void);
typedef enum { 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) static int iface_info(void)
{ {
@ -145,7 +165,7 @@
if (skfd < 0) { if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) { if ((skfd = sockets_open(0)) < 0) {
perror("socket"); perror("socket");
@@ -1449,20 +1451,21 @@ @@ -1619,20 +1621,21 @@ static int iface_info(void)
} }
if (flag_exp < 2) { if (flag_exp < 2) {
ife_short = 1; ife_short = 1;
@ -160,7 +180,7 @@
} }
- if (flag_cnt) - if (flag_cnt)
+ if (!flag_cnt) { + if (!flag_cnt) {
free_interface_list(); if_cache_free();
- else { - else {
close(skfd); close(skfd);
skfd = -1; skfd = -1;
@ -170,24 +190,24 @@
return 0; 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, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n")); fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
- fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n\n")); - fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
+ fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n")); + fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
fprintf(stderr, _(" -r, --route display routing table\n")); fprintf(stderr, _(" -r, --route display routing table\n"));
fprintf(stderr, _(" -i, --interfaces display interface 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 argc, char *argv[]) {
int i; int i;
int lop; int lop;
+ int reptimer = 1; + int reptimer = 1;
struct option longopts[] = static struct option longopts[] =
{ {
AFTRANS_OPTS, AFTRANS_OPTS,
@@ -1655,6 +1659,12 @@ @@ -1844,6 +1848,12 @@ int main
flag_sta++; flag_sta++;
} }
@ -200,88 +220,99 @@
if (flag_int + flag_rou + flag_mas + flag_sta > 1) if (flag_int + flag_rou + flag_mas + flag_sta > 1)
usage(); usage();
@@ -1666,7 +1676,7 @@ @@ -1869,7 +1879,7 @@ int main
flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
+ flag_ax25 + flag_netrom + flag_igmp + flag_x25;
-
+
if (flag_mas) {
#if HAVE_FW_MASQUERADE && HAVE_AFINET
#if MORE_THAN_ONE_MASQ_AF
@@ -1678,7 +1688,7 @@
flag_not & FLAG_NUM_PORT, flag_exp); flag_not & FLAG_NUM_PORT, flag_exp);
if (i || !flag_cnt) if (i || !flag_cnt)
break; break;
- sleep(1); - wait_continous();
+ sleep(reptimer); + wait_continous(reptimer);
} }
#else #else
ENOSUPP("netstat.c", "FW_MASQUERADE"); ENOSUPP("netstat", "FW_MASQUERADE");
@@ -1688,9 +1698,15 @@ @@ -1881,18 +1891,18 @@ int main
}
if (flag_sta) { if (flag_sta) {
+ for(;;) { if (!afname[0])
strcpy(afname, DFLT_AF);
-
+ for (;;) {
if (!strcmp(afname, "inet")) {
#if HAVE_AFINET
inittab(); inittab();
- parsesnmp(flag_raw, flag_tcp, flag_udp); - parsesnmp(flag_raw, flag_tcp, flag_udp);
- exit(0);
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp); + 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) + if(i || !flag_cnt)
+ break; + break;
+ sleep(reptimer); + sleep(reptimer);
+ } + }
+ return(i); + return (i);
} }
if (flag_rou) { if (flag_rou) {
@@ -1712,7 +1728,7 @@ @@ -1922,7 +1936,7 @@ int main
i = route_info(afname, options); i = route_info(afname, options);
if (i || !flag_cnt) if (i || !flag_cnt)
break; break;
- sleep(1); - wait_continous();
+ sleep(reptimer); + wait_continous(reptimer);
} }
return (i); return (i);
} }
@@ -1721,7 +1737,7 @@ @@ -1931,7 +1945,7 @@ int main
i = iface_info(); i = iface_info();
if (!flag_cnt || i) if (!flag_cnt || i)
break; break;
- sleep(1); - wait_continous();
+ sleep(reptimer); + wait_continous(reptimer);
} }
return (i); return (i);
} }
@@ -1847,7 +1863,7 @@ @@ -2084,7 +2098,7 @@ int main
}
if (!flag_cnt || i) if (!flag_cnt || i)
break; break;
- sleep(1); - wait_continous();
+ sleep(reptimer); + wait_continous(reptimer);
prg_cache_clear(); prg_cache_clear();
} }
return (i); return (i);
--- net-tools-1.60/statistics.c.cycle 2001-02-02 19:01:23.000000000 +0100 diff -up net-tools-1.60/statistics.c.cycle net-tools-1.60/statistics.c
+++ net-tools-1.60/statistics.c 2003-02-11 14:29:29.000000000 +0100 --- net-tools-1.60/statistics.c.cycle 2011-11-21 02:31:57.000000000 +0100
@@ -338,7 +338,7 @@ +++ 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) -void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
+int parsesnmp(int flag_raw, int flag_tcp, int flag_udp) +int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
{ {
FILE *f; FILE *f;
@@ -347,12 +347,15 @@ @@ -511,14 +511,17 @@ void parsesnmp(int flag_raw, int flag_tc
f = fopen("/proc/net/snmp", "r"); f = proc_fopen("/proc/net/snmp");
if (!f) { if (!f) {
perror(_("cannot open /proc/net/snmp")); perror(_("cannot open /proc/net/snmp"));
- return; - return;
+ return(1); + 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))
+ if (ferror(f)) { + if (ferror(f)) {
@ -292,9 +323,9 @@
fclose(f); fclose(f);
@@ -361,12 +363,15 @@ @@ -528,15 +531,18 @@ void parsesnmp(int flag_raw, int flag_tc
if (f) { if (process_fd(f, 1, NULL) <0)
process_fd(f); fprintf(stderr, _("Problem while parsing /proc/net/netstat\n"));
- if (ferror(f)) - if (ferror(f))
- perror("/proc/net/netstat"); - perror("/proc/net/netstat");
@ -310,4 +341,36 @@
+ return(0); + 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 diff -up net-tools-1.60/netstat.c.dup-tcp net-tools-1.60/netstat.c
+++ net-tools-1.60/netstat.c Mon Apr 22 14:25:22 2002 --- net-tools-1.60/netstat.c.dup-tcp 2011-12-02 16:24:08.479720425 +0100
@@ -435,6 +435,162 @@ +++ 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")); " will not be shown, you would have to be root to see it all.)\n"));
} }
@ -117,76 +118,26 @@
+ +
+ return 0; + 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 #if HAVE_AFNETROM
static const char *netrom_state[] = static const char *netrom_state[] =
{ {
@@ -752,11 +908,20 @@ @@ -960,6 +1074,12 @@ static void tcp_do_one(int lnr, const ch
fprintf(stderr, _("warning, got bogus tcp line.\n"));
return; 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 */ + /* make sure that we haven't seen this socket pair before */
+ if (tcp_node_hash_check_and_append(local_addr, local_port, + if (tcp_node_hash_check_and_append(local_addr, local_port, rem_addr, rem_port) < 0) {
+ rem_addr, rem_port) < 0) {
+ /* fprintf(stderr, _("warning, got duplicate tcp line.\n")); */ + /* fprintf(stderr, _("warning, got duplicate tcp line.\n")); */
+ return; + return;
+ } + }
+ +
if (state == TCP_LISTEN) { addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "tcp");
time_len = 0; addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "tcp");
retr = 0L;
@@ -1880,6 +2045,7 @@ @@ -2112,6 +2232,7 @@ int main
break; break;
sleep(reptimer); wait_continous(reptimer);
prg_cache_clear(); prg_cache_clear();
+ tcp_node_hash_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 diff -up net-tools-1.60/arp.c.fgets net-tools-1.60/arp.c
entry is added to /proc/net/arp after fopen(), resulting in a duplicate entry. --- 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
--- net-tools-1.60/arp.c.fgets 2005-12-10 14:52:04.000000000 -0500 @@ -558,18 +558,21 @@ static int arp_show(char *name)
+++ 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)
perror(_PATH_PROCNET_ARP); perror(_PATH_PROCNET_ARP);
return (-1); return (-1);
} }
@ -26,12 +15,12 @@ entry is added to /proc/net/arp after fopen(), resulting in a duplicate entry.
strcpy(dev, "-"); strcpy(dev, "-");
/* Read the ARP cache entries. */ /* Read the ARP cache entries. */
- for (; fgets(line, sizeof(line), fp);) { - 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); - ip, &type, &flags, hwa, mask, dev);
- if (num < 4) - if (num < 4)
+ for (num = 0; num < entries; num++) { + for (num = 0; num < entries; num++) {
+ fgets(line, sizeof(line), fp); + 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) + ip, &type, &flags, hwa, mask, dev) < 4)
break; 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 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.ib-warning 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/ib.c 2009-09-01 13:47:43.000000000 +0200 +++ net-tools-1.60/lib/ib.c 2011-12-06 13:40:32.463976896 +0100
@@ -48,7 +48,10 @@ static char *pr_ib(unsigned char *ptr) @@ -47,7 +47,10 @@ static const char *pr_ib(const char *ptr
pos += sprintf(pos, "%02X:", (*ptr++ & 0377)); pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
} }
buff[strlen(buff) - 1] = '\0'; 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", /* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
(ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 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 diff -up net-tools-1.60/lib/interface.c.long_iface net-tools-1.60/lib/interface.c
--- net-tools-1.60-ifconfig-new/lib/interface.c 2006-03-23 07:02:48.000000000 +0100 --- net-tools-1.60/lib/interface.c.long_iface 2011-12-05 18:16:38.000000000 +0100
+++ net-tools-1.60-ifconfig/lib/interface.c 2006-03-23 09:58:45.000000000 +0100 +++ net-tools-1.60/lib/interface.c 2011-12-05 19:13:17.343530194 +0100
@@ -203,6 +203,7 @@ out: @@ -216,6 +216,7 @@ out:
static char *get_name(char **namep, char *p) char *get_name(char **namep, char *p)
{ {
+ int count = 0; + int count = 0;
while (isspace(*p)) while (isspace(*p))
p++; p++;
char *name = *namep = 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 */ if (*p == ':') { /* could be an alias */
char *dot = p, *dotname = name; char *dot = p++;
*name++ = *p++; - while (*p && isdigit(*p)) p++;
- while (isdigit(*p))
+ count++; + count++;
+ while (isdigit(*p)){ + while (*p && isdigit(*p)) {
*name++ = *p++; + p++;
+ count++; + count++;
+ if (count == (IFNAMSIZ-1)) + if (count == (IFNAMSIZ-1))
+ break; + break;
+ } + }
if (*p != ':') { /* it wasn't, backup */ if (*p == ':') {
/* Yes it is, backup and copy it. */
p = dot; p = dot;
name = dotname; @@ -240,6 +247,9 @@ char *get_name(char **namep, char *p)
@@ -223,6 +229,9 @@ static char *get_name(char **namep, char
break; break;
} }
*name++ = *p++; *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 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 2003-05-21 15:28:50.000000000 +0200 --- net-tools-1.60/lib/inet6.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
@@ -133,28 +133,9 @@ +++ 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) -static int INET6_getsock(char *bufp, struct sockaddr *sap)
-{ -{
- struct sockaddr_in6 *sin6; - struct sockaddr_in6 *sin6;
- char *p;
- -
- sin6 = (struct sockaddr_in6 *) sap; - sin6 = (struct sockaddr_in6 *) sap;
- sin6->sin6_family = AF_INET6; - sin6->sin6_family = AF_INET6;
- sin6->sin6_port = 0; - 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) - if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
- return (-1); - return (-1);
- - p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
- return 16; /* ?;) */ - return 16; /* ?;) */
-} -}
- -
@ -30,9 +36,10 @@
} }
--- net-tools-1.60/lib/inet6_gr.c.inet6-lookup 2001-04-01 16:48:06.000000000 +0200 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 2003-05-21 15:28:50.000000000 +0200 --- net-tools-1.60/lib/inet6_gr.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
@@ -100,7 +100,7 @@ +++ 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]); addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6); inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6);
snprintf(addr6, sizeof(addr6), "%s/%d", snprintf(addr6, sizeof(addr6), "%s/%d",
@ -41,7 +48,7 @@
prefix_len); prefix_len);
/* Fetch and resolve the nexthop address. */ /* 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]); naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7]);
inet6_aftype.input(1, naddr6, (struct sockaddr *) &snaddr6); inet6_aftype.input(1, naddr6, (struct sockaddr *) &snaddr6);
snprintf(naddr6, sizeof(naddr6), "%s", snprintf(naddr6, sizeof(naddr6), "%s",
@ -49,9 +56,10 @@
+ inet6_aftype.sprint((struct sockaddr *) &snaddr6, numeric)); + inet6_aftype.sprint((struct sockaddr *) &snaddr6, numeric));
/* Decode the flags. */ /* Decode the flags. */
strcpy(flags, "U");
--- net-tools-1.60/lib/inet6_sr.c.inet6-lookup 2000-05-22 23:18:37.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 2003-05-21 15:28:50.000000000 +0200 --- 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 @@ @@ -32,6 +32,7 @@
#include "net-support.h" #include "net-support.h"
#include "pathnames.h" #include "pathnames.h"
@ -60,8 +68,7 @@
#include "net-features.h" #include "net-features.h"
@@ -63,7 +64,7 @@ static int INET6_setroute(int action, in
@@ -63,7 +63,7 @@
if (*args == NULL) if (*args == NULL)
return (usage()); return (usage());
@ -70,7 +77,7 @@
if (!strcmp(target, "default")) { if (!strcmp(target, "default")) {
prefix_len = 0; prefix_len = 0;
memset(&sa6, 0, sizeof(sa6)); memset(&sa6, 0, sizeof(sa6));
@@ -112,7 +112,7 @@ @@ -112,7 +113,7 @@ static int INET6_setroute(int action, in
return (usage()); return (usage());
if (rt.rtmsg_flags & RTF_GATEWAY) if (rt.rtmsg_flags & RTF_GATEWAY)
return (usage()); return (usage());
@ -79,7 +86,7 @@
if (inet6_aftype.input(1, gateway, if (inet6_aftype.input(1, gateway,
(struct sockaddr *) &sa6) < 0) { (struct sockaddr *) &sa6) < 0) {
inet6_aftype.herror(gateway); inet6_aftype.herror(gateway);
@@ -152,7 +152,7 @@ @@ -152,7 +153,7 @@ static int INET6_setroute(int action, in
} }
if (devname) { if (devname) {
memset(&ifr, 0, sizeof(ifr)); 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 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/netstat.c 2003-08-25 17:08:41.000000000 +0200 --- net-tools-1.60/man/en_US/netstat.8.interface 2011-12-06 12:30:47.028302044 +0100
@@ -129,6 +129,7 @@ +++ 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 #define E_IOCTL -3
int flag_int = 0; int flag_int = 0;
@ -8,7 +35,7 @@
int flag_rou = 0; int flag_rou = 0;
int flag_mas = 0; int flag_mas = 0;
int flag_sta = 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 iface_info(void)
{ {
static int count=0; static int count=0;
@ -16,7 +43,7 @@
if (skfd < 0) { if (skfd < 0) {
if ((skfd = sockets_open(0)) < 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")); 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")); perror(_("missing interface information"));
exit(1); 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, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n")); fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
- fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n")); - fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
+ fprintf(stderr, _(" netstat { [-veenNac] -i[<Iface>] | [-cnNe] -M | -s } [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, _(" -r, --route display routing table\n"));
- fprintf(stderr, _(" -i, --interfaces display interface table\n")); + fprintf(stderr, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
- fprintf(stderr, _(" -g, --groups display multicast group memberships\n")); fprintf(stderr, _(" -i, --interfaces display interface table\n"));
- fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n")); fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
+ fprintf(stderr, _(" -r, --route display routing table\n")); fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
+ fprintf(stderr, _(" -i, --interfaces=[<Iface>] display interface table\n")); @@ -1693,7 +1700,7 @@ int main
+ 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 @@
{ {
AFTRANS_OPTS, AFTRANS_OPTS,
{"version", 0, 0, 'V'}, {"version", 0, 0, 'V'},
- {"interfaces", 0, 0, 'i'}, - {"interfaces", 0, 0, 'i'},
+ {"interfaces", 2, 0, 'i'}, + {"interfaces", 2, 0, 'I'},
{"help", 0, 0, 'h'}, {"help", 0, 0, 'h'},
{"route", 0, 0, 'r'}, {"route", 0, 0, 'r'},
#if HAVE_FW_MASQUERADE #if HAVE_FW_MASQUERADE
@@ -1560,7 +1567,7 @@ @@ -1734,7 +1741,7 @@ int main
getroute_init(); /* Set up AF routing support */ getroute_init(); /* Set up AF routing support */
afname[0] = '\0'; afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl", longopts, &lop)) != EOF) - while ((i = getopt_long(argc, argv, "A:CFMacdeghilnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphi::nNorstuVv?wxl", longopts, &lop)) != EOF) + while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
switch (i) { switch (i) {
case -1: case -1:
break; break;
@@ -1602,6 +1609,8 @@ @@ -1775,6 +1782,13 @@ int main
case 'p':
flag_prg++; flag_prg++;
break; break;
case 'i': + case 'I':
+ if (optarg && strcmp(optarg, "(null)"))
+ if (optarg[0] == '=') optarg++;
+ if (optarg && strcmp(optarg, "(null)")) + if (optarg && strcmp(optarg, "(null)"))
+ flag_int_name = strdup(optarg); + flag_int_name = strdup(optarg);
+ flag_int++;
+ break;
case 'i':
flag_int++; flag_int++;
break; 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 extern int procnetdev_version(char *buf);
+++ lib/interface.c 2005-12-30 11:17:02.000000000 -0800 extern int get_dev_fields(char *bp, struct interface *ife);
@@ -201,10 +201,11 @@ -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; return err;
} }
-static char *get_name(char *name, char *p) -char *get_name(char *name, char *p)
+static char *get_name(char **namep, char *p) +char *get_name(char **namep, char *p)
{ {
while (isspace(*p)) while (isspace(*p))
p++; p++;
@ -15,9 +26,9 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
while (*p) { while (*p) {
if (isspace(*p)) if (isspace(*p))
break; 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; FILE *fh;
- char buf[512]; - char buf[512];
struct interface *ife; struct interface *ife;
@ -25,11 +36,11 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
+ char *line = NULL; + char *line = NULL;
+ size_t linelen = 0; + size_t linelen = 0;
if (proc_read) fh = fopen(_PATH_PROCNET_DEV, "r");
return 0; if (!fh) {
@@ -320,8 +322,11 @@ @@ -330,8 +332,11 @@ static int if_readlist_proc(char *target
_PATH_PROCNET_DEV, strerror(errno)); _PATH_PROCNET_DEV, strerror(errno));
return if_readconf(); return -2;
} }
- fgets(buf, sizeof buf, fh); /* eat line */ - fgets(buf, sizeof buf, fh); /* eat line */
- fgets(buf, sizeof buf, fh); - 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 */ #if 0 /* pretty, but can't cope with missing fields */
fmt = proc_gen_fmt(_PATH_PROCNET_DEV, 1, fh, 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) if (!fmt)
return -1; return -1;
#else #else
@ -56,10 +67,10 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
+ while (getline(&line, &linelen, fh) != -1) { + while (getline(&line, &linelen, fh) != -1) {
+ char *s, *name; + char *s, *name;
+ s = get_name(&name, line); + s = get_name(&name, line);
ife = add_interface(name); ife = if_cache_add(name);
get_dev_fields(s, ife); get_dev_fields(s, ife);
ife->statistics_valid = 1; ife->statistics_valid = 1;
@@ -368,6 +373,8 @@ @@ -377,6 +382,8 @@ static int if_readlist_proc(char *target
#if 0 #if 0
free(fmt); free(fmt);
#endif #endif
@ -68,7 +79,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
fclose(fh); fclose(fh);
return err; 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) static int if_readlist_rep(char *target, struct interface *ife)
{ {
FILE *fh; FILE *fh;
@ -79,7 +90,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
fh = fopen(_PATH_PROCNET_DEV, "r"); fh = fopen(_PATH_PROCNET_DEV, "r");
if (!fh) { if (!fh) {
@@ -385,15 +393,18 @@ @@ -393,15 +401,18 @@ static int if_readlist_rep(char *target,
_PATH_PROCNET_DEV, strerror(errno)); _PATH_PROCNET_DEV, strerror(errno));
return if_readconf(); return if_readconf();
} }
@ -104,7 +115,7 @@ Bugzilla Bug 176714 *** stack smashing detected ***: /sbin/ifconfig terminat
get_dev_fields(s, ife); get_dev_fields(s, ife);
if (target && !strcmp(target,name)) if (target && !strcmp(target,name))
{ {
@@ -406,6 +417,8 @@ @@ -414,6 +425,8 @@ static int if_readlist_rep(char *target,
err = -1; 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 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 2000-10-28 12:59:42.000000000 +0200 --- net-tools-1.60/lib/ipx_gr.c.ipx 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60.new/lib/ipx_gr.c 2003-05-20 10:54:37.000000000 +0200 +++ net-tools-1.60/lib/ipx_gr.c 2011-12-01 17:02:53.261805292 +0100
@@ -64,7 +64,7 @@ @@ -70,7 +70,7 @@ int IPX_rprint(int options)
continue; continue;
/* Fetch and resolve the Destination */ /* 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)); strcpy(net, ap->sprint(&sa, numeric));
/* Fetch and resolve the Router Net */ /* Fetch and resolve the Router Net */
diff -urN net-tools-1.60/netstat.c net-tools-1.60.new/netstat.c diff -up net-tools-1.60/netstat.c.ipx net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c 2003-05-20 11:00:57.000000000 +0200 --- net-tools-1.60/netstat.c.ipx 2011-12-01 17:02:53.000000000 +0100
+++ net-tools-1.60.new/netstat.c 2003-05-20 10:58:25.000000000 +0200 +++ net-tools-1.60/netstat.c 2011-12-01 17:06:26.071144809 +0100
@@ -1412,13 +1412,13 @@ @@ -1582,13 +1582,13 @@ static int ipx_info(void)
} }
/* Fetch and resolve the Source */ /* Fetch and resolve the Source */
- (void) ap->input(4, sad, &sa); - (void) ap->input(4, sad, &sa);
+ (void) ap->input(0, 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); snprintf(sad, sizeof(sad), "%s:%04X", buf, sport);
if (!nc) { if (!nc) {
/* Fetch and resolve the Destination */ /* Fetch and resolve the Destination */
- (void) ap->input(4, dad, &sa); - (void) ap->input(4, dad, &sa);
+ (void) ap->input(0, 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); snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
} else } else
diff -urN net-tools-1.60/version.h net-tools-1.60.new/version.h diff -up net-tools-1.60/version.h.ipx net-tools-1.60/version.h
--- net-tools-1.60/version.h 1970-01-01 01:00:00.000000000 +0100 --- net-tools-1.60/version.h.ipx 2011-12-01 17:02:53.265805240 +0100
+++ net-tools-1.60.new/version.h 2003-05-19 16:07:49.000000000 +0200 +++ net-tools-1.60/version.h 2011-12-01 17:02:53.265805240 +0100
@@ -0,0 +1 @@ @@ -0,0 +1 @@
+#define RELEASE "net-tools 1.60" +#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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:38:28.094531727 +0100
@@ -120,11 +120,9 @@ Flagge) kann @@ -120,11 +120,9 @@ Flagge) kann
.B Netmaske .B Netmaske
f\(:ur ARP-Eintr\(:age f\(:ur ganze Subnetze angegeben werde. Von dieser 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 .SH AUTOREN
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> mit vielen Verbesserungen vom Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> mit vielen Verbesserungen vom
Verwalter der Net-Tools Bernd Eckenfels <net-tools@lina.inka.de>. 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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:38:28.094531727 +0100
@@ -180,20 +180,21 @@ Seit Kernel Version 2.2 gibt es keine ex @@ -180,20 +180,21 @@ Seit Kernel Version 2.2 gibt es keine ex
Schnittstellenaliase mehr. Die Statistiken f\(:ur die Originaladresse werden Schnittstellenaliase mehr. Die Statistiken f\(:ur die Originaladresse werden
mit allen Aliasen auf das gleiche Ger\(:at geteilt. Um Statistiken per 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> Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br .br
diff -up net-tools-1.60/man/de_DE/netstat.8.man net-tools-1.60/man/de_DE/netstat.8 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.142531127 +0100
@@ -475,12 +475,9 @@ Befehl explizite Regeln zugef\(:ugt werd @@ -475,12 +475,9 @@ Befehl explizite Regeln zugef\(:ugt werd
.PP .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 .PP
.SH PROBLEME .SH PROBLEME
diff -up net-tools-1.60/man/de_DE/route.8.man net-tools-1.60/man/de_DE/route.8 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.201530389 +0100
@@ -334,7 +334,7 @@ Nur wenn die Hardwareadresse f\(:ur die @@ -334,7 +334,7 @@ Nur wenn die Hardwareadresse f\(:ur die
.I /proc/net/rt_cache .I /proc/net/rt_cache
.LP .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 .SH GESCHICHTE
.B Route .B Route
diff -up net-tools-1.60/man/en_US/arp.8.man net-tools-1.60/man/en_US/arp.8 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.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/arp.8 2011-07-21 17:52:05.798565781 +0200 +++ net-tools-1.60/man/en_US/arp.8 2011-12-06 13:38:28.251529764 +0100
@@ -44,6 +44,10 @@ arp \- manipulate the system ARP cache @@ -63,6 +63,10 @@ arp \- manipulate the system ARP cache
.RB [ "-i if" ] .B \-f
.B -f [filename] .RI [ filename ]
+.SH NOTE +.SH NOTE
+.P +.P
+This program is obsolete. For replacement check \fBip neighbor\fR. +This program is obsolete. For replacement check \fBip neigh\fR.
+ +
.SH DESCRIPTION .SH DESCRIPTION
.B Arp .B Arp
manipulates the kernel's ARP cache in various ways. The primary options manipulates or displays the kernel's IPv4 network neighbour cache. It can add
@@ -150,8 +154,8 @@ but this is not official. If no filename @@ -178,8 +182,8 @@ but this is not official. If no filename
is used as default. is used as default.
.sp 1 .sp 1
The format of the file is simple; it 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" .BR "pub" , " temp" " and" " netmask"
flags can be used. flags can be used.
.LP .LP
@@ -179,8 +183,10 @@ flag. @@ -218,6 +222,6 @@ published proxy ARP entries and permanen
.I /etc/hosts
.br .br
.I /etc/ethers .I /etc/ethers
+
.SH SEE ALSO .SH SEE ALSO
-rarp(8), route(8), ifconfig(8), netstat(8) -rarp(8), route(8), ifconfig(8), netstat(8)
+.BR ip(8) +.BR ip(8)
+
.SH AUTHORS .SH AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> with a lot of improvements Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net\-tools@lina.inka.de>.
from net-tools Maintainer 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 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.301529135 +0100
@@ -26,6 +26,3 @@ can be resolved by DNS or a dot separate @@ -26,6 +26,3 @@ can be resolved by DNS or a dot separate
.SH FILES \"{{{ .SH FILES \"{{{
/etc/ethers /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" \"{{{ -.SH "SEE ALSO" \"{{{
-rarp(8) -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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:39:00.576125653 +0100
@@ -5,6 +5,13 @@ ifconfig \- configure a network interfac @@ -5,6 +5,13 @@ ifconfig \- configure a network interfac
.B "ifconfig [interface]" .B "ifconfig [-v] [-a] [-s] [interface]"
.br .br
.B "ifconfig interface [aftype] options | address ..." .B "ifconfig [-v] interface [aftype] options | address ..."
+ +
+.SH NOTE +.SH NOTE
+.P +.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. +is not RFC-compliant and therefore its use is discouraged and may go away.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B interface .B -a
@@ -173,23 +185,30 @@ alias interfaces anymore. The statistics @@ -205,8 +217,6 @@ it is most likely a interrupt conflict.
are shared with all alias addresses on the same device. If you want per-address .I http://www.scyld.com/expert/irq\-conflict.html
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
for more information. for more information.
.SH FILES .SH FILES
-.I /proc/net/socket -.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 .I /proc/net/dev
.br .br
.I /proc/net/if_inet6 .I /proc/net/if_inet6
.SH BUGS @@ -214,7 +224,8 @@ for more information.
+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 While appletalk DDP and IPX addresses will be displayed they cannot be
altered by this command. altered by this command.
+
.SH SEE ALSO .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 ip(8),
+.BR iptables(8) +.BR iptables(8)
+
.SH AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br .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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-07-21 17:52:05.800565755 +0200 +++ 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-indep @@ -18,6 +18,12 @@ mii\-tool \- view, manipulate media-inde
[\fB\-F\fR, \fB\-\-force=\fImedia\fR] [\fB\-F\fR, \fB\-\-force=\fImedia\fR]
.RI [ "interface\ ..." ] .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 .SH DESCRIPTION
This utility checks or sets the status of a network interface's Media This utility checks or sets the status of a network interface's Media
Independent Interface (MII) unit. Most fast ethernet adapters use an Independent Interface (MII) unit. Most fast ethernet adapters use an
@@ -72,6 +78,9 @@ media technologies. Multiple technologi @@ -87,6 +93,9 @@ SIOCGMIIPHY on 'eth?' failed: Operation
commas. Valid media are \fB100baseT4\fR, \fB100baseTx-FD\fR, The interface in question does not support MII queries. Most likely, it does not have
\fB100baseTx-HD\fR, \fB10baseT-FD\fR, and \fB10baseT-HD\fR. MII transceivers, at all.
+.SH SEE ALSO +.SH SEE ALSO
+ethtool(8) +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 David Hinds \- dhinds@pcmcia.sourceforge.org
.br .br
diff -up net-tools-1.60/man/en_US/nameif.8.man net-tools-1.60/man/en_US/nameif.8 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:38:28.451527263 +0100
@@ -5,6 +5,12 @@ nameif \- name network interfaces based @@ -5,6 +5,12 @@ nameif \- name network interfaces based
.B "nameif [-c configfile] [-s]" .B "nameif [\-c configfile] [\-s]"
.br .br
.B "nameif [-c configfile] [-s] {interface macaddress}" .B "nameif [\-c configfile] [\-s] {interface macaddress}"
+ +
+.SH NOTE +.SH NOTE
+.P +.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 .SH BUGS
Only works for Ethernet currently. 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 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.man 2011-12-06 13:38:27.771535767 +0100
+++ net-tools-1.60/man/en_US/netstat.8 2011-07-21 17:52:05.801565742 +0200 +++ net-tools-1.60/man/en_US/netstat.8 2011-12-06 13:38:28.509526538 +0100
@@ -92,6 +92,14 @@ netstat \- Print network connections, ro @@ -101,6 +101,14 @@ netstat \- Print network connections, ro
.RB [ \-\-netrom ] .RB [ \-\-ddp | \-\-appletalk ]
.RB [ \-\-ddp ] .RB [ \-\-econet | \-\-ec ]
+.SH NOTE +.SH NOTE
+.P +.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 .SH DESCRIPTION
.B Netstat .B Netstat
prints information about the Linux networking subsystem. The type of 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" .SS "\-l, \-\-listening"
Show only listening sockets. (These are omitted by default.) Show only listening sockets. (These are omitted by default.)
.SS "\-a, \-\-all" .SS "\-a, \-\-all"
-Show both listening and non-listening sockets. With the -Show both listening and non-listening sockets. With the
+Show both listening and non-listening (for TCP this means established +Show both listening and non-listening (for TCP this means established
+connections) sockets. With the +connections) sockets. With the
.B --interfaces .B \-\-interfaces
option, show interfaces that are not marked option, show interfaces that are not up
.SS "\-F" .SS "\-F"
@@ -436,11 +445,9 @@ status information via the following fil @@ -458,11 +467,9 @@ status information via the following fil
.fi .fi
.P .P
.SH SEE ALSO .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 .SH BUGS
Occasionally strange information may appear if a socket changes 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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:38:28.559525913 +0100
@@ -52,6 +52,11 @@ If] @@ -52,6 +52,11 @@ If]
.RB [ \-\-version ] .RB [ \-\-version ]
.RB [ \-h ] .RB [ \-h ]
.RB [ \--help ] .RB [ \-\-help ]
+ +
+.SH NOTE +.SH NOTE
+.P +.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 -set the TCP Maximum Segment Size (MSS) for connections over this route
-to M bytes. -to M bytes.
-The default is the device MTU minus headers, or a lower MTU when path mtu -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 -other end when path mtu discovery does not work (usually because of
-misconfigured firewalls that block ICMP Fragmentation Needed) -misconfigured firewalls that block ICMP Fragmentation Needed)
+sets MTU (Maximum Transmission Unit) of the route to M bytes. +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 .TP
.B window W .B window W
set the TCP window size for connections over this route to W set the TCP window size for connections over this route to W
@@ -182,7 +184,7 @@ modifiers (metric - netmask - gw - dev) @@ -317,7 +319,7 @@ Whether or not the hardware address for
.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
.I /proc/net/rt_cache .I /proc/net/rt_cache
.LP .LP
.SH SEE ALSO .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 .LP
.SH HISTORY .SH HISTORY
.B Route .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 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.man 2011-11-21 02:31:57.000000000 +0100
+++ 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 2011-12-06 13:38:28.609525290 +0100
@@ -183,20 +183,21 @@ pour les interfaces en alias. Les statis @@ -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. 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 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> Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br .br
diff -up net-tools-1.60/man/fr_FR/netstat.8.man net-tools-1.60/man/fr_FR/netstat.8 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.man 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/man/fr_FR/netstat.8 2011-07-21 17:52:05.804565703 +0200 +++ net-tools-1.60/man/fr_FR/netstat.8 2011-12-06 13:38:28.651524763 +0100
@@ -469,12 +469,9 @@ devez définir des règles spécifiques à l @@ -468,12 +468,9 @@ devez définir des règles spécifiques à l
.PP .PP
.SH VOIR AUSSI .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 .PP
.SH BUGS .SH BUGS
diff -up net-tools-1.60/man/fr_FR/route.8.man net-tools-1.60/man/fr_FR/route.8 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.701524138 +0100
@@ -320,7 +320,7 @@ Indique si oui ou non l'adresse matériel @@ -320,7 +320,7 @@ Indique si oui ou non l'adresse matériel
.I /proc/net/rt_cache .I /proc/net/rt_cache
.LP .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 .SH HISTORIQUE
.B Route .B Route
diff -up net-tools-1.60/man/pt_BR/ifconfig.8.man net-tools-1.60/man/pt_BR/ifconfig.8 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.759523414 +0100
@@ -144,32 +144,26 @@ O nome ou endereço IP da máquina (um nom @@ -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 um endereço IP) da interface. Este parâmetro é necessário, apesar
da sintaxe atualmente não requisitá-lo. 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> Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
Alan Cox, <Alan.Cox@linux.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 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.800522902 +0100
@@ -434,12 +434,9 @@ configurar regras explícitas usando o co @@ -434,12 +434,9 @@ configurar regras explícitas usando o co
.PP .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 .PP
.SH BUGS .SH BUGS
diff -up net-tools-1.60/man/pt_BR/route.8.man net-tools-1.60/man/pt_BR/route.8 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.man 2011-11-21 02:31:57.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 2011-12-06 13:38:28.842522378 +0100
@@ -312,7 +312,7 @@ parâmetros do protocolo TCP sem esperar @@ -312,7 +312,7 @@ parâmetros do protocolo TCP sem esperar
.I /etc/init.d/network .I /etc/init.d/network
.LP .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 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.mii-refactor 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/mii-tool.c 2009-10-30 16:45:01.000000000 +0100 +++ net-tools-1.60/mii-tool.c 2011-12-06 16:31:04.114063667 +0100
@@ -50,9 +50,11 @@ static char version[] = @@ -51,10 +51,12 @@ static char Version[] = "$Id: mii-tool.c
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#endif #endif
-#include "mii.h" -#include "mii.h"
+#include <linux/mii.h> +#include <linux/mii.h>
+#include <linux/sockios.h> +#include <linux/sockios.h>
#include "version.h"
#define MAX_ETH 8 /* Maximum # of interfaces */ #define MAX_ETH 8 /* Maximum # of interfaces */
+#define LPA_ABILITY_MASK 0x07e0 +#define LPA_ABILITY_MASK 0x07e0
/* Table of known MII's */ /* Table of known MII's */
static struct { static const struct {
@@ -112,7 +114,7 @@ static struct ifreq ifr; @@ -117,7 +119,7 @@ static struct ifreq ifr;
static int mdio_read(int skfd, int location) 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; mii->reg_num = location;
if (ioctl(skfd, SIOCGMIIREG, &ifr) < 0) { if (ioctl(skfd, SIOCGMIIREG, &ifr) < 0) {
fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, 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) 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->reg_num = location;
mii->val_in = value; mii->val_in = value;
if (ioctl(skfd, SIOCSMIIREG, &ifr) < 0) { if (ioctl(skfd, SIOCSMIIREG, &ifr) < 0) {
@@ -140,13 +142,13 @@ const struct { @@ -145,17 +147,17 @@ const struct {
u_short value; u_short value[2];
} media[] = { } media[] = {
/* The order through 100baseT4 matches bits in the BMSR */ /* The order through 100baseT4 matches bits in the BMSR */
- { "10baseT-HD", MII_AN_10BASET_HD }, - { "10baseT-HD", {MII_AN_10BASET_HD} },
- { "10baseT-FD", MII_AN_10BASET_FD }, - { "10baseT-FD", {MII_AN_10BASET_FD} },
- { "100baseTx-HD", MII_AN_100BASETX_HD }, - { "100baseTx-HD", {MII_AN_100BASETX_HD} },
- { "100baseTx-FD", MII_AN_100BASETX_FD }, - { "100baseTx-FD", {MII_AN_100BASETX_FD} },
- { "100baseT4", MII_AN_100BASET4 }, - { "100baseT4", {MII_AN_100BASET4} },
- { "100baseTx", MII_AN_100BASETX_FD | MII_AN_100BASETX_HD }, - { "100baseTx", {MII_AN_100BASETX_FD | MII_AN_100BASETX_HD} },
- { "10baseT", MII_AN_10BASET_FD | MII_AN_10BASET_HD }, - { "10baseT", {MII_AN_10BASET_FD | MII_AN_10BASET_HD} },
+ { "10baseT-HD", LPA_10HALF }, -
+ { "10baseT-FD", LPA_10FULL }, - { "1000baseT-HD", {0, MII_BMCR2_1000HALF} },
+ { "100baseTx-HD", LPA_100HALF }, - { "1000baseT-FD", {0, MII_BMCR2_1000FULL} },
+ { "100baseTx-FD", LPA_100FULL }, - { "1000baseT", {0, MII_BMCR2_1000HALF|MII_BMCR2_1000FULL} },
+ { "100baseT4", LPA_100BASE4 }, + { "10baseT-HD", {LPA_10HALF} },
+ { "100baseTx", LPA_100FULL | LPA_100HALF }, + { "10baseT-FD", {LPA_10FULL} },
+ { "10baseT", LPA_10FULL | LPA_10HALF }, + { "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])) #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; char *s;
mask = strtoul(arg, &s, 16); mask = strtoul(arg, &s, 16);
if ((*arg != '\0') && (*s == '\0')) { if ((*arg != '\0') && (*s == '\0')) {
- if ((mask & MII_AN_ABILITY_MASK) && - if ((mask & MII_AN_ABILITY_MASK) &&
- !(mask & ~MII_AN_ABILITY_MASK)) - !(mask & ~MII_AN_ABILITY_MASK)) {
+ if ((mask & LPA_ABILITY_MASK) && + if ((mask & LPA_ABILITY_MASK) &&
+ !(mask & ~LPA_ABILITY_MASK)) + !(mask & ~LPA_ABILITY_MASK)) {
*bmcr2 = 0;
return mask; return mask;
goto failed; }
} else { @@ -198,18 +200,19 @@ static const char *media_list(unsigned m
@@ -202,13 +204,22 @@ int show_basic_mii(int sock, int phy_id) int i;
char buf[100]; *buf = '\0';
int i, mii_val[32];
int bmcr, bmsr, advert, lkpar; - 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 /* Some bits in the BMSR are latched, but we can't rely on being
the only reader, so only the current values are meaningful */ the only reader, so only the current values are meaningful */
mdio_read(sock, MII_BMSR); 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); - mii_val[i] = mdio_read(sock, i);
- + for (i = 0; i < ((verbose > 1) ? 32 : (MII_STAT1000+1)); i++) {
+ for (i = 0; i < ((verbose > 1) ? 32 : 8); i++) {
+ if ((i == MII_BMCR) || (i == MII_BMSR) || (i == MII_PHYSID1) || + if ((i == MII_BMCR) || (i == MII_BMSR) || (i == MII_PHYSID1) ||
+ (i == MII_PHYSID2) || (i == MII_ADVERTISE) || (i == MII_LPA) || + (i == MII_PHYSID2) || (i == MII_ADVERTISE) || (i == MII_LPA) ||
+ (i == MII_EXPANSION) || (i == MII_CTRL1000) || (i == MII_STAT1000) || + (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 + else
+ mii_val[i] = 0; + 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"); fprintf(stderr, " No MII transceiver present!.\n");
return -1; @@ -243,31 +257,31 @@ int show_basic_mii(int sock, int phy_id)
@@ -216,28 +227,28 @@ int show_basic_mii(int sock, int phy_id)
/* Descriptive rename. */ /* Descriptive rename. */
bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR]; bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
- advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR]; - advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR];
+ advert = mii_val[MII_ADVERTISE]; lkpar = mii_val[MII_LPA]; + 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); sprintf(buf, "%s: ", ifr.ifr_name);
- if (bmcr & MII_BMCR_AN_ENA) { - 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 & MII_AN_ACK) ?
+ strcat(buf, (lkpar & LPA_LPACK) ? + strcat(buf, (lkpar & LPA_LPACK) ?
"negotiated" : "no autonegotiation,"); "negotiated" : "no autonegotiation,");
strcat(buf, media_list(advert & lkpar, 1)); strcat(buf, media_list(advert & lkpar, bmcr2 & lpa2>>2, 1));
strcat(buf, ", "); strcat(buf, ", ");
} else { } else {
strcat(buf, "autonegotiation failed, "); 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 { } else {
sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ", 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 & MII_BMCR_DUPLEX) ? "full" : "half");
+ (bmcr & BMCR_SPEED100) ? "100" : "10", + : (bmcr & BMCR_SPEED100) ? "100" : "10",
+ (bmcr & BMCR_FULLDPLX) ? "full" : "half"); + (bmcr & BMCR_FULLDPLX) ? "full" : "half");
} }
- strcat(buf, (bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link"); - 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_watch) {
if (opt_log) { 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[2]<<6)|(mii_val[3]>>10))&0xff,
(mii_val[3]>>4)&0x3f, mii_val[3]&0x0f); (mii_val[3]>>4)&0x3f, mii_val[3]&0x0f);
printf(" basic mode: "); 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("remote fault, ");
- printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link"); - printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
+ printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link"); + printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
printf("\n capabilities:%s", media_list(bmsr >> 6, 0)); printf("\n capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
printf("\n advertising: %s", media_list(advert, 0)); printf("\n advertising: %s", media_list(advert, lpa2 >> 2, 0));
- if (lkpar & MII_AN_ABILITY_MASK) - if (lkpar & MII_AN_ABILITY_MASK)
+ if (lkpar & LPA_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"); 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) 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. */ /* Get the vitals from the interface. */
strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 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) { if (opt_reset) {
printf("resetting the transceiver...\n"); printf("resetting the transceiver...\n");
- mdio_write(skfd, MII_BMCR, MII_BMCR_RESET); - mdio_write(skfd, MII_BMCR, MII_BMCR_RESET);
+ mdio_write(skfd, MII_BMCR, 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_ANAR, nway_advertise | 1);
+ mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1); + mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1);
opt_restart = 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); 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) 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 diff -up net-tools-1.60/nameif.c.strncpy net-tools-1.60/nameif.c
+++ net-tools-1.60/nameif.c 2006-10-03 14:22:43.000000000 +0200 --- net-tools-1.60/nameif.c.strncpy 2011-12-06 12:35:36.123687853 +0100
@@ -100,8 +100,8 @@ +++ 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; struct ifreq ifr;
opensock(); opensock();
memset(&ifr,0,sizeof(struct ifreq)); memset(&ifr,0,sizeof(struct ifreq));
- strcpy(ifr.ifr_name, oldname); - strcpy(ifr.ifr_name, oldname);
- strcpy(ifr.ifr_newname, newname); - strcpy(ifr.ifr_newname, newname);
+ strncpy(ifr.ifr_name, oldname, IF_NAMESIZE); + strncpy(ifr.ifr_name, oldname, IFNAMSIZ);
+ strncpy(ifr.ifr_newname, newname, IF_NAMESIZE); + strncpy(ifr.ifr_newname, newname, IFNAMSIZ);
return ioctl(ctl_sk, SIOCSIFNAME, &ifr); 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 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.p-basename 2011-12-06 14:54:17.023662287 +0100
+++ net-tools-1.60/netstat.c 2011-06-09 12:02:28.437352480 +0200 +++ net-tools-1.60/netstat.c 2011-12-06 14:56:27.852026709 +0100
@@ -413,7 +413,7 @@ static void prg_cache_load(void) @@ -395,7 +395,7 @@ static void prg_cache_load(void)
{ {
char line[LINE_MAX],eacces=0; char line[LINE_MAX],eacces=0;
int procfdlen,fd,cmdllen,lnamelen; 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; unsigned long inode;
const char *cs,*cmdlp; const char *cs,*cmdlp;
DIR *dirproc=NULL,*dirfd=NULL; DIR *dirproc=NULL,*dirfd=NULL;
@@ -484,10 +484,12 @@ static void prg_cache_load(void) @@ -459,6 +459,8 @@ static void prg_cache_load(void)
continue;
if (cmdllen < sizeof(cmdlbuf) - 1)
cmdlbuf[cmdllen]='\0';
- if ((cmdlp = strrchr(cmdlbuf, '/')))
+ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/')))
cmdlp++; cmdlp++;
else else
cmdlp = cmdlbuf; cmdlp = cmdlbuf;

View File

@ -1,7 +1,7 @@
diff -up net-tools-1.60/netstat.c.probe net-tools-1.60/netstat.c 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.probe 2011-12-06 13:06:40.626378359 +0100
+++ net-tools-1.60/netstat.c 2008-10-15 12:49:48.000000000 +0200 +++ net-tools-1.60/netstat.c 2011-12-06 13:06:40.650378062 +0100
@@ -1061,6 +1061,11 @@ static void tcp_do_one(int lnr, const ch @@ -1150,6 +1150,11 @@ static void tcp_do_one(int lnr, const ch
(double) time_len / HZ, retr, timeout); (double) time_len / HZ, retr, timeout);
break; 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 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.scanf-format 2011-12-06 13:14:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-02-04 14:39:54.000000000 +0100 +++ net-tools-1.60/lib/inet6_gr.c 2011-12-06 13:21:01.417616990 +0100
@@ -78,7 +78,7 @@ int rprint_fib6(int ext, int numeric) @@ -82,7 +82,7 @@ int rprint_fib6(int ext, int numeric)
"Flags Metric Ref Use Iface\n")); "Flag Met Ref Use If\n"));
while (fgets(buff, 1023, fp)) { while (fgets(buff, 1023, fp)) {
- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n", - num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %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], addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&prefix_len, &prefix_len,
diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c 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.scanf-format 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet_gr.c 2011-02-04 14:55:41.000000000 +0100 +++ net-tools-1.60/lib/inet_gr.c 2011-12-06 13:23:25.408816852 +0100
@@ -68,19 +68,19 @@ int rprint_fib(int ext, int numeric) @@ -68,7 +68,7 @@ int rprint_fib(int ext, int numeric)
mss = 0; mss = 0;
fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp, fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp,
- "Iface", "%16s", - "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s", + "Iface", "%15s",
+ "Destination", "%127s", "Destination", "%127s",
+ "Gateway", "%127s", "Gateway", "%127s",
"Flags", "%X", "Flags", "%X",
"RefCnt", "%d", @@ -80,7 +80,7 @@ int rprint_fib(int ext, int numeric)
"Use", "%d",
"Metric", "%d",
- "Mask", "%128s",
+ "Mask", "%127s",
"MTU", "%d",
"Window", "%d", "Window", "%d",
"IRTT", "%d", "IRTT", "%d",
NULL); 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" */ + /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */
if (!fmt) if (!fmt)
return 1; 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")); "MSS Window irtt HH Arp\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
- "Iface", "%16s", - "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s", + "Iface", "%15s",
+ "Destination", "%127s", "Destination", "%127s",
+ "Gateway", "%127s", "Gateway", "%127s",
"Flags", "%X", "Flags", "%X",
"RefCnt", "%d", @@ -282,7 +282,7 @@ int rprint_cache(int ext, int numeric)
"Use", "%d",
"Metric", "%d",
- "Source", "%128s",
+ "Source", "%127s",
"MTU", "%d",
"Window", "%d",
"IRTT", "%d",
"HH", "%d", "HH", "%d",
"ARP", "%d", "ARP", "%d",
NULL); 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" */ + /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
} }
if (format == 2) { 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 " "Flags Metric Ref Use Iface "
"MSS Window irtt TOS HHRef HHUptod SpecDst\n")); "MSS Window irtt TOS HHRef HHUptod SpecDst\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
- "Iface", "%16s", - "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s", + "Iface", "%15s",
+ "Destination", "%127s", "Destination", "%127s",
+ "Gateway", "%127s", "Gateway", "%127s",
"Flags", "%X", "Flags", "%X",
"RefCnt", "%d", @@ -307,7 +307,7 @@ int rprint_cache(int ext, int numeric)
"Use", "%d",
"Metric", "%d",
- "Source", "%128s",
+ "Source", "%127s",
"MTU", "%d",
"Window", "%d",
"IRTT", "%d",
"TOS", "%d",
"HHRef", "%d",
"HHUptod", "%d", "HHUptod", "%d",
- "SpecDst", "%128s", "SpecDst", "%127s",
+ "SpecDst", "%127s",
NULL); 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" */ + /* "%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 diff -up net-tools-1.60/Makefile.selinux net-tools-1.60/Makefile
+++ net-tools-1.60/Makefile 2005-12-29 16:54:06.000000000 -0500 --- net-tools-1.60/Makefile.selinux 2011-11-21 02:31:57.000000000 +0100
@@ -113,6 +113,12 @@ +++ 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 NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
@ -10,12 +11,13 @@
+else +else
+endif +endif
+ +
CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH) CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH)
LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH) LDFLAGS += -L$(NET_LIB_PATH)
--- net-tools-1.60/netstat.c~ 2005-12-24 06:56:57.000000000 -0500 diff -up net-tools-1.60/netstat.c.selinux net-tools-1.60/netstat.c
+++ net-tools-1.60/netstat.c 2005-12-29 16:54:07.000000000 -0500 --- net-tools-1.60/netstat.c.selinux 2011-12-05 15:28:23.187230365 +0100
@@ -86,6 +86,11 @@ +++ net-tools-1.60/netstat.c 2011-12-05 15:37:31.376377055 +0100
@@ -89,6 +89,11 @@
#include <net/if.h> #include <net/if.h>
#include <dirent.h> #include <dirent.h>
@ -27,15 +29,15 @@
#include "net-support.h" #include "net-support.h"
#include "pathnames.h" #include "pathnames.h"
#include "version.h" #include "version.h"
@@ -96,6 +101,7 @@ @@ -100,6 +105,7 @@
#include "util.h" #include "proc.h"
#define PROGNAME_WIDTH 20 #define PROGNAME_WIDTH 20
+#define SELINUX_WIDTH 50 +#define SELINUX_WIDTH 50
#if !defined(s6_addr32) && defined(in6a_words) #if !defined(s6_addr32) && defined(in6a_words)
#define s6_addr32 in6a_words /* libinet6 */ #define s6_addr32 in6a_words /* libinet6 */
@@ -150,6 +156,7 @@ @@ -159,6 +165,7 @@ int flag_wide= 0;
int flag_prg = 0; int flag_prg = 0;
int flag_arg = 0; int flag_arg = 0;
int flag_ver = 0; int flag_ver = 0;
@ -43,7 +45,7 @@
FILE *procinfo; FILE *procinfo;
@@ -213,12 +220,17 @@ @@ -222,12 +229,17 @@ FILE *procinfo;
#define PROGNAME_WIDTH1(s) PROGNAME_WIDTH2(s) #define PROGNAME_WIDTH1(s) PROGNAME_WIDTH2(s)
#define PROGNAME_WIDTH2(s) #s #define PROGNAME_WIDTH2(s) #s
@ -55,35 +57,35 @@
static struct prg_node { static struct prg_node {
struct prg_node *next; struct prg_node *next;
int inode; unsigned long inode;
char name[PROGNAME_WIDTH]; char name[PROGNAME_WIDTH];
+ char scon[SELINUX_WIDTH]; + char scon[SELINUX_WIDTH];
} *prg_hash[PRG_HASH_SIZE]; } *prg_hash[PRG_HASH_SIZE];
static char prg_cache_loaded = 0; 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 PRG_HASHIT(x) ((x) % PRG_HASH_SIZE)
#define PROGNAME_BANNER "PID/Program name" #define PROGNAME_BANNER "PID/Program name"
+#define SELINUX_BANNER "Security Context" +#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 print_selinux_banner() do { if (flag_selinux) printf("%-" SELINUX_WIDTHs "s"," " SELINUX_BANNER); } while (0)
+ +
#define PRG_LOCAL_ADDRESS "local_address" #define PRG_LOCAL_ADDRESS "local_address"
#define PRG_INODE "inode" #define PRG_INODE "inode"
#define PRG_SOCKET_PFX "socket:[" #define PRG_SOCKET_PFX "socket:["
@@ -250,7 +265,7 @@ @@ -257,7 +272,7 @@ static char prg_cache_loaded = 0;
/* NOT working as of glibc-2.0.7: */ #define PATH_CMDLINE "cmdline"
#undef DIRENT_HAVE_D_TYPE_WORKS #define PATH_CMDLINEl strlen(PATH_CMDLINE)
-static void prg_cache_add(int inode, char *name) -static void prg_cache_add(unsigned long inode, char *name)
+static void prg_cache_add(int inode, char *name, char *scon) +static void prg_cache_add(unsigned long inode, char *name, char *scon)
{ {
unsigned hi = PRG_HASHIT(inode); unsigned hi = PRG_HASHIT(inode);
struct prg_node **pnp,*pn; 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) if (strlen(name)>sizeof(pn->name)-1)
name[sizeof(pn->name)-1]='\0'; name[sizeof(pn->name)-1]='\0';
strcpy(pn->name,name); strcpy(pn->name,name);
@ -98,7 +100,7 @@
} }
static const char *prg_cache_get(unsigned long inode) 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("-"); return("-");
} }
@ -115,7 +117,7 @@
static void prg_cache_clear(void) static void prg_cache_clear(void)
{ {
struct prg_node **pnp,*pn; struct prg_node **pnp,*pn;
@@ -348,6 +381,7 @@ @@ -367,6 +400,7 @@ static void prg_cache_load(void)
const char *cs,*cmdlp; const char *cs,*cmdlp;
DIR *dirproc=NULL,*dirfd=NULL; DIR *dirproc=NULL,*dirfd=NULL;
struct dirent *direproc,*direfd; struct dirent *direproc,*direfd;
@ -123,7 +125,7 @@
if (prg_cache_loaded || !flag_prg) return; if (prg_cache_loaded || !flag_prg) return;
prg_cache_loaded=1; 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); snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp);
@ -140,32 +142,44 @@
} }
closedir(dirfd); closedir(dirfd);
dirfd = NULL; 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("- "); printf("- ");
if (flag_prg) 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) + if (flag_selinux)
+ printf("%-" SELINUX_WIDTHs "s",(has & HAS_INODE?prg_cache_get_con(inode):"-")); + printf(" %-" SELINUX_WIDTHs "s",(has & HAS_INODE?prg_cache_get_con(inode):"-"));
puts(path); +
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_progname_banner();
+ print_selinux_banner(); + print_selinux_banner();
printf(_(" Path\n")); /* xxx */ 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, _(" -o, --timers display timers\n"));
fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\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, _(" -C, --cache display routing cache instead of FIB\n\n"));
+ fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\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} {-U|--udplite} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
@@ -1729,6 +1776,7 @@ @@ -1850,6 +1899,7 @@ int main
{"cache", 0, 0, 'C'}, {"cache", 0, 0, 'C'},
{"fib", 0, 0, 'F'}, {"fib", 0, 0, 'F'},
{"groups", 0, 0, 'g'}, {"groups", 0, 0, 'g'},
@ -173,16 +187,16 @@
{NULL, 0, 0, 0} {NULL, 0, 0, 0}
}; };
@@ -1741,7 +1789,7 @@ @@ -1861,7 +1911,7 @@ int main
getroute_init(); /* Set up AF routing support */
afname[0] = '\0'; afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?", longopts, &lop)) != EOF)
- while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxl", longopts, &lop)) != EOF) + while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?Z", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZ", longopts, &lop)) != EOF)
switch (i) { switch (i) {
case -1: case -1:
break; break;
@@ -1838,6 +1886,20 @@ @@ -1973,6 +2023,20 @@ int main
if (aftrans_opt("unix")) if (aftrans_opt("unix"))
exit(1); exit(1);
break; break;
@ -203,19 +217,7 @@
case '?': case '?':
case 'h': case 'h':
usage(); usage();
--- net-tools-1.60/netstat.c.sel 2007-05-21 14:02:08.000000000 -0400 @@ -2099,6 +2163,7 @@ int main
+++ 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
if (flag_exp > 1) if (flag_exp > 1)
printf(_(" User Inode ")); printf(_(" User Inode "));
print_progname_banner(); 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 diff -up net-tools-1.60/lib/interface.c.statalias net-tools-1.60/lib/interface.c
+++ net-tools-1.60/lib/interface.c 2005-01-07 12:49:38.527388088 +0100 --- net-tools-1.60/lib/interface.c.statalias 2011-12-02 16:37:32.258671807 +0100
@@ -395,9 +395,11 @@ +++ 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]; char *s, name[IFNAMSIZ];
s = get_name(name, buf); s = get_name(name, buf);
get_dev_fields(s, ife); 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 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.doubleword 2011-12-02 15:41:03.000000000 +0100
+++ net-tools-1.60/statistics.c 2010-08-10 15:21:24.000000000 +0200 +++ net-tools-1.60/statistics.c 2011-12-02 15:55:22.202301865 +0100
@@ -63,54 +63,54 @@ static enum State state; @@ -64,115 +64,115 @@ static enum State state;
struct entry Iptab[] = struct entry Iptab[] =
{ {
{"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC}, {"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC},
- {"DefaultTTL", N_("Default TTL is %lu"), number | I_STATIC}, - {"DefaultTTL", N_("Default TTL is %u"), number | I_STATIC},
- {"InReceives", N_("%lu total packets received"), number}, - {"InReceives", N_("%u total packets received"), number},
- {"InHdrErrors", N_("%lu with invalid headers"), opt_number}, - {"InHdrErrors", N_("%u with invalid headers"), opt_number},
- {"InAddrErrors", N_("%lu with invalid addresses"), opt_number}, - {"InAddrErrors", N_("%u with invalid addresses"), opt_number},
- {"ForwDatagrams", N_("%lu forwarded"), number}, - {"ForwDatagrams", N_("%u forwarded"), number},
- {"InUnknownProtos", N_("%lu with unknown protocol"), opt_number}, - {"InUnknownProtos", N_("%u with unknown protocol"), opt_number},
- {"InDiscards", N_("%lu incoming packets discarded"), number}, - {"InDiscards", N_("%u incoming packets discarded"), number},
- {"InDelivers", N_("%lu incoming packets delivered"), number}, - {"InDelivers", N_("%u incoming packets delivered"), number},
- {"OutRequests", N_("%lu requests sent out"), number}, /*? */ - {"OutRequests", N_("%u requests sent out"), number}, /*? */
- {"OutDiscards", N_("%lu outgoing packets dropped"), opt_number}, - {"OutDiscards", N_("%u outgoing packets dropped"), opt_number},
- {"OutNoRoutes", N_("%lu dropped because of missing route"), opt_number}, - {"OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
- {"ReasmTimeout", N_("%lu fragments dropped after timeout"), opt_number}, - {"ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
- {"ReasmReqds", N_("%lu reassemblies required"), opt_number}, /* ? */ - {"ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
- {"ReasmOKs", N_("%lu packets reassembled ok"), opt_number}, - {"ReasmOKs", N_("%u packets reassembled ok"), opt_number},
- {"ReasmFails", N_("%lu packet reassembles failed"), opt_number}, - {"ReasmFails", N_("%u packet reassembles failed"), opt_number},
- {"FragOKs", N_("%lu fragments received ok"), opt_number}, - {"FragOKs", N_("%u fragments received ok"), opt_number},
- {"FragFails", N_("%lu fragments failed"), opt_number}, - {"FragFails", N_("%u fragments failed"), opt_number},
- {"FragCreates", N_("%lu fragments created"), opt_number} - {"FragCreates", N_("%u fragments created"), opt_number}
+ {"DefaultTTL", N_("Default TTL is %llu"), number | I_STATIC}, + {"DefaultTTL", N_("Default TTL is %llu"), number | I_STATIC},
+ {"InReceives", N_("%llu total packets received"), number}, + {"InReceives", N_("%llu total packets received"), number},
+ {"InHdrErrors", N_("%llu with invalid headers"), opt_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} + {"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[] = struct entry Icmptab[] =
{ {
- {"InMsgs", N_("%lu ICMP messages received"), number}, - {"InMsgs", N_("%u ICMP messages received"), number},
- {"InErrors", N_("%lu input ICMP message failed."), number}, - {"InErrors", N_("%u input ICMP message failed."), number},
- {"InDestUnreachs", N_("destination unreachable: %lu"), i_inp_icmp | I_TITLE}, - {"InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
- {"InTimeExcds", N_("timeout in transit: %lu"), i_inp_icmp | I_TITLE}, - {"InTimeExcds", N_("timeout in transit: %u"), i_inp_icmp | I_TITLE},
- {"InParmProbs", N_("wrong parameters: %lu"), i_inp_icmp | I_TITLE}, /*? */ - {"InParmProbs", N_("wrong parameters: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InSrcQuenchs", N_("source quenches: %lu"), i_inp_icmp | I_TITLE}, - {"InSrcQuenchs", N_("source quenches: %u"), i_inp_icmp | I_TITLE},
- {"InRedirects", N_("redirects: %lu"), i_inp_icmp | I_TITLE}, - {"InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
- {"InEchos", N_("echo requests: %lu"), i_inp_icmp | I_TITLE}, - {"InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
- {"InEchoReps", N_("echo replies: %lu"), i_inp_icmp | I_TITLE}, - {"InEchoReps", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
- {"InTimestamps", N_("timestamp request: %lu"), i_inp_icmp | I_TITLE}, - {"InTimestamps", N_("timestamp request: %u"), i_inp_icmp | I_TITLE},
- {"InTimestampReps", N_("timestamp reply: %lu"), i_inp_icmp | I_TITLE}, - {"InTimestampReps", N_("timestamp reply: %u"), i_inp_icmp | I_TITLE},
- {"InAddrMasks", N_("address mask request: %lu"), i_inp_icmp | I_TITLE}, /*? */ - {"InAddrMasks", N_("address mask request: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InAddrMaskReps", N_("address mask replies: %lu"), i_inp_icmp | I_TITLE}, /*? */ - {"InAddrMaskReps", N_("address mask replies: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"OutMsgs", N_("%lu ICMP messages sent"), number}, - {"OutMsgs", N_("%u ICMP messages sent"), number},
- {"OutErrors", N_("%lu ICMP messages failed"), number}, - {"OutErrors", N_("%u ICMP messages failed"), number},
- {"OutDestUnreachs", N_("destination unreachable: %lu"), i_outp_icmp | I_TITLE}, - {"OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
- {"OutTimeExcds", N_("time exceeded: %lu"), i_outp_icmp | I_TITLE}, - {"OutTimeExcds", N_("time exceeded: %u"), i_outp_icmp | I_TITLE},
- {"OutParmProbs", N_("wrong parameters: %lu"), i_outp_icmp | I_TITLE}, /*? */ - {"OutParmProbs", N_("wrong parameters: %u"), i_outp_icmp | I_TITLE}, /*? */
- {"OutSrcQuenchs", N_("source quench: %lu"), i_outp_icmp | I_TITLE}, - {"OutSrcQuenchs", N_("source quench: %u"), i_outp_icmp | I_TITLE},
- {"OutRedirects", N_("redirect: %lu"), i_outp_icmp | I_TITLE}, - {"OutRedirects", N_("redirect: %u"), i_outp_icmp | I_TITLE},
- {"OutEchos", N_("echo request: %lu"), i_outp_icmp | I_TITLE}, - {"OutEchos", N_("echo request: %u"), i_outp_icmp | I_TITLE},
- {"OutEchoReps", N_("echo replies: %lu"), i_outp_icmp | I_TITLE}, - {"OutEchoReps", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestamps", N_("timestamp requests: %lu"), i_outp_icmp | I_TITLE}, - {"OutTimestamps", N_("timestamp requests: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestampReps", N_("timestamp replies: %lu"), i_outp_icmp | I_TITLE}, - {"OutTimestampReps", N_("timestamp replies: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMasks", N_("address mask requests: %lu"), i_outp_icmp | I_TITLE}, - {"OutAddrMasks", N_("address mask requests: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMaskReps", N_("address mask replies: %lu"), i_outp_icmp | I_TITLE}, - {"OutAddrMaskReps", N_("address mask replies: %u"), i_outp_icmp | I_TITLE},
+ {"InMsgs", N_("%llu ICMP messages received"), number}, + {"InMsgs", N_("%llu ICMP messages received"), number},
+ {"InErrors", N_("%llu input ICMP message failed."), number}, + {"InErrors", N_("%llu input ICMP message failed."), number},
+ {"InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE}, + {"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}, + {"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[] = struct entry Tcptab[] =
@@ -119,131 +119,133 @@ struct entry Tcptab[] = @@ -181,122 +181,122 @@ struct entry Tcptab[] =
{"RtoMin", "", number}, {"RtoMin", "", number},
{"RtoMax", "", number}, {"RtoMax", "", number},
{"MaxConn", "", number}, {"MaxConn", "", number},
- {"ActiveOpens", N_("%lu active connections openings"), number}, - {"ActiveOpens", N_("%u active connections openings"), number},
- {"PassiveOpens", N_("%lu passive connection openings"), number}, - {"PassiveOpens", N_("%u passive connection openings"), number},
- {"AttemptFails", N_("%lu failed connection attempts"), number}, - {"AttemptFails", N_("%u failed connection attempts"), number},
- {"EstabResets", N_("%lu connection resets received"), number}, - {"EstabResets", N_("%u connection resets received"), number},
- {"CurrEstab", N_("%lu connections established"), number}, - {"CurrEstab", N_("%u connections established"), number},
- {"InSegs", N_("%lu segments received"), number}, - {"InSegs", N_("%u segments received"), number},
- {"OutSegs", N_("%lu segments send out"), number}, - {"OutSegs", N_("%u segments send out"), number},
- {"RetransSegs", N_("%lu segments retransmited"), number}, - {"RetransSegs", N_("%u segments retransmited"), number},
- {"InErrs", N_("%lu bad segments received."), number}, - {"InErrs", N_("%u bad segments received."), number},
- {"OutRsts", N_("%lu resets sent"), number}, - {"OutRsts", N_("%u resets sent"), number},
+ {"ActiveOpens", N_("%llu active connections openings"), number}, + {"ActiveOpens", N_("%llu active connections openings"), number},
+ {"PassiveOpens", N_("%llu passive connection openings"), number}, + {"PassiveOpens", N_("%llu passive connection openings"), number},
+ {"AttemptFails", N_("%llu failed connection attempts"), 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[] = struct entry Udptab[] =
{ {
- {"InDatagrams", N_("%lu packets received"), number}, - {"InDatagrams", N_("%u packets received"), number},
- {"NoPorts", N_("%lu packets to unknown port received."), number}, - {"NoPorts", N_("%u packets to unknown port received."), number},
- {"InErrors", N_("%lu packet receive errors"), number}, - {"InErrors", N_("%u packet receive errors"), number},
- {"OutDatagrams", N_("%lu packets sent"), 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}, + {"InDatagrams", N_("%llu packets received"), number},
+ {"NoPorts", N_("%llu packets to unknown port received."), number}, + {"NoPorts", N_("%llu packets to unknown port received."), number},
+ {"InErrors", N_("%llu packet receive errors"), 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}, + {"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[] = struct entry Tcpexttab[] =
{ {
- {"SyncookiesSent", N_("%lu SYN cookies sent"), opt_number}, - {"SyncookiesSent", N_("%u SYN cookies sent"), opt_number},
- {"SyncookiesRecv", N_("%lu SYN cookies received"), opt_number}, - {"SyncookiesRecv", N_("%u SYN cookies received"), opt_number},
- {"SyncookiesFailed", N_("%lu invalid SYN cookies received"), opt_number}, - {"SyncookiesFailed", N_("%u invalid SYN cookies received"), opt_number},
+ {"SyncookiesSent", N_("%llu SYN cookies sent"), opt_number}, + {"SyncookiesSent", N_("%llu SYN cookies sent"), opt_number},
+ {"SyncookiesRecv", N_("%llu SYN cookies received"), opt_number}, + {"SyncookiesRecv", N_("%llu SYN cookies received"), opt_number},
+ {"SyncookiesFailed", N_("%llu invalid 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"), + { "EmbryonicRsts", N_("%llu resets received for embryonic SYN_RECV sockets"),
opt_number }, 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" + { "PruneCalled", N_("%llu packets pruned from receive queue because of socket"
" buffer overrun"), opt_number }, " buffer overrun"), opt_number },
/* obsolete: 2.2.0 doesn't do that anymore */ /* obsolete: 2.2.0 doesn't do that anymore */
- { "RcvPruned", N_("%lu packets pruned from receive queue"), opt_number }, - { "RcvPruned", N_("%u packets pruned from receive queue"), opt_number },
- { "OfoPruned", N_("%lu packets dropped from out-of-order queue because of" - { "OfoPruned", N_("%u packets dropped from out-of-order queue because of"
+ { "RcvPruned", N_("%llu packets pruned from receive queue"), opt_number }, + { "RcvPruned", N_("%llu packets pruned from receive queue"), opt_number },
+ { "OfoPruned", N_("%llu packets dropped from out-of-order queue because of" + { "OfoPruned", N_("%llu packets dropped from out-of-order queue because of"
" socket buffer overrun"), opt_number }, " 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 " + { "OutOfWindowIcmps", N_("%llu ICMP packets dropped because they were "
"out-of-window"), opt_number }, "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" + { "LockDroppedIcmps", N_("%llu ICMP packets dropped because"
" socket was locked"), opt_number }, " socket was locked"), opt_number },
- { "TW", N_("%lu TCP sockets finished time wait in fast timer"), opt_number }, - { "TW", N_("%u TCP sockets finished time wait in fast timer"), opt_number },
- { "TWRecycled", N_("%lu time wait sockets recycled by time stamp"), opt_number }, - { "TWRecycled", N_("%u time wait sockets recycled by time stamp"), opt_number },
- { "TWKilled", N_("%lu TCP sockets finished time wait in slow timer"), opt_number }, - { "TWKilled", N_("%u TCP sockets finished time wait in slow timer"), opt_number },
- { "PAWSPassive", N_("%lu passive connections rejected because of" - { "PAWSPassive", N_("%u passive connections rejected because of"
+ { "TW", N_("%llu TCP sockets finished time wait in fast timer"), opt_number }, + { "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 }, + { "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 }, + { "TWKilled", N_("%llu TCP sockets finished time wait in slow timer"), opt_number },
+ { "PAWSPassive", N_("%llu passive connections rejected because of" + { "PAWSPassive", N_("%llu passive connections rejected because of"
" time stamp"), opt_number }, " 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 " + { "PAWSActive", N_("%llu active connections rejected because of "
"time stamp"), opt_number }, "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" + { "PAWSEstab", N_("%llu packets rejects in established connections because of"
" timestamp"), opt_number }, " timestamp"), opt_number },
- { "DelayedACKs", N_("%lu delayed acks sent"), opt_number }, - { "DelayedACKs", N_("%u delayed acks sent"), opt_number },
- { "DelayedACKLocked", N_("%lu delayed acks further delayed because of" - { "DelayedACKLocked", N_("%u delayed acks further delayed because of"
+ { "DelayedACKs", N_("%llu delayed acks sent"), opt_number }, + { "DelayedACKs", N_("%llu delayed acks sent"), opt_number },
+ { "DelayedACKLocked", N_("%llu delayed acks further delayed because of" + { "DelayedACKLocked", N_("%llu delayed acks further delayed because of"
" locked socket"), opt_number }, " locked socket"), opt_number },
- { "DelayedACKLost", N_("Quick ack mode was activated %lu times"), opt_number }, - { "DelayedACKLost", N_("Quick ack mode was activated %u times"), opt_number },
- { "ListenOverflows", N_("%lu times the listen queue of a socket overflowed"), - { "ListenOverflows", N_("%u times the listen queue of a socket overflowed"),
+ { "DelayedACKLost", N_("Quick ack mode was activated %llu times"), opt_number }, + { "DelayedACKLost", N_("Quick ack mode was activated %llu times"), opt_number },
+ { "ListenOverflows", N_("%llu times the listen queue of a socket overflowed"), + { "ListenOverflows", N_("%llu times the listen queue of a socket overflowed"),
opt_number }, opt_number },
- { "ListenDrops", N_("%lu SYNs to LISTEN sockets ignored"), opt_number }, - { "ListenDrops", N_("%u SYNs to LISTEN sockets dropped"), opt_number },
- { "TCPPrequeued", N_("%lu packets directly queued to recvmsg prequeue."), - { "TCPPrequeued", N_("%u packets directly queued to recvmsg prequeue."),
+ { "ListenDrops", N_("%llu SYNs to LISTEN sockets ignored"), opt_number }, + { "ListenDrops", N_("%llu SYNs to LISTEN sockets dropped"), opt_number },
+ { "TCPPrequeued", N_("%llu packets directly queued to recvmsg prequeue."), + { "TCPPrequeued", N_("%llu packets directly queued to recvmsg prequeue."),
opt_number }, opt_number },
- { "TCPDirectCopyFromBacklog", N_("%lu packets directly received" - { "TCPDirectCopyFromBacklog", N_("%u bytes directly in process context from backlog"), opt_number },
+ { "TCPDirectCopyFromBacklog", N_("%llu packets directly received" - { "TCPDirectCopyFromPrequeue", N_("%u bytes directly received in process context from prequeue"),
" from backlog"), opt_number }, + { "TCPDirectCopyFromBacklog", N_("%llu bytes directly in process context from backlog"), opt_number },
- { "TCPDirectCopyFromPrequeue", N_("%lu packets directly received" + { "TCPDirectCopyFromPrequeue", N_("%llu bytes directly received in process context from prequeue"),
+ { "TCPDirectCopyFromPrequeue", N_("%llu packets directly received" opt_number },
" from prequeue"), opt_number }, - { "TCPPrequeueDropped", N_("%u packets dropped from prequeue"), opt_number },
- { "TCPPrequeueDropped", N_("%lu packets dropped from prequeue"), opt_number }, - { "TCPHPHits", N_("%u packet headers predicted"), number },
- { "TCPHPHits", N_("%lu packets header predicted"), number }, - { "TCPHPHitsToUser", N_("%u packets header predicted and "
- { "TCPHPHitsToUser", N_("%lu packets header predicted and "
+ { "TCPPrequeueDropped", N_("%llu packets dropped from prequeue"), opt_number }, + { "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 " + { "TCPHPHitsToUser", N_("%llu packets header predicted and "
"directly queued to user"), opt_number }, "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 " + { "SockMallocOOM", N_("Ran %llu times out of system memory during "
"packet sending"), opt_number }, "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 }, - { "TCPHPAcks", N_("%u predicted acknowledgments"), opt_number },
- { "TCPRenoRecovery", N_("%u times recovered from packet loss due to fast retransmit"), 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 }, - { "TCPSackRecovery", N_("%u times recovered from packet loss by selective acknowledgements"), opt_number },
- { "TCPSACKReneging", N_("%u bad SACKs received"), opt_number }, - { "TCPSACKReneging", N_("%u bad SACK blocks received"), opt_number },
- { "TCPFACKReorder", N_("Detected reordering %u times using FACK"), opt_number }, - { "TCPFACKReorder", N_("Detected reordering %u times using FACK"), opt_number },
- { "TCPSACKReorder", N_("Detected reordering %u times using SACK"), opt_number }, - { "TCPSACKReorder", N_("Detected reordering %u times using SACK"), opt_number },
- { "TCPTSReorder", N_("Detected reordering %u times using time stamp"), 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 }, - { "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 }, - { "TCPPartialUndo", N_("%u congestion windows partially recovered using Hoe heuristic"), opt_number },
- { "TCPDSackUndo", N_("%u congestion window recovered using DSACK"), opt_number }, - { "TCPDSackUndo", N_("%u congestion window recovered without slow start using DSACK"), opt_number },
- { "TCPLossUndo", N_("%u congestion windows recovered after partial ack"), opt_number }, - { "TCPLossUndo", N_("%u congestion windows recovered without slow start after partial ack"), opt_number },
- { "TCPLostRetransmits", N_("%u retransmits lost"), opt_number }, - { "TCPLostRetransmits", N_("%u retransmits lost"), opt_number },
- { "TCPRenoFailures", N_("%u timeouts after reno fast retransmit"), opt_number }, - { "TCPRenoFailures", N_("%u timeouts after reno fast retransmit"), opt_number },
- { "TCPSackFailures", N_("%u timeouts after SACK recovery"), 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 }, - { "TCPSlowStartRetrans", N_("%u retransmits in slow start"), opt_number },
- { "TCPTimeouts", N_("%u other TCP timeouts"), opt_number }, - { "TCPTimeouts", N_("%u other TCP timeouts"), opt_number },
- { "TCPRenoRecoveryFailed", N_("%u reno fast retransmits failed"), 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 }, - { "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 }, - { "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 }, - { "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 }, - { "TCPAbortOnMemory", N_("%u connections aborted due to memory pressure"), opt_number },
- { "TCPAbortOnTimeout", N_("%u connections aborted due to timeout"), 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 }, - { "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 }, - { "TCPMemoryPressures", N_("TCP ran low on memory %u times"), opt_number },
- { "TCPLoss", N_("%u TCP data loss events") }, - { "TCPLoss", N_("%u TCP data loss events"), opt_number },
+ { "TCPPureAcks", N_("%llu acknowledgments not containing data received"), 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 }, + { "TCPHPAcks", N_("%llu predicted acknowledgments"), opt_number },
+ { "TCPRenoRecovery", N_("%llu times recovered from packet loss due to fast retransmit"), 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 }, + { "TCPSackRecovery", N_("%llu times recovered from packet loss by selective acknowledgements"), opt_number },
+ { "TCPSACKReneging", N_("%llu bad SACKs received"), opt_number }, + { "TCPSACKReneging", N_("%llu bad SACK blocks received"), opt_number },
+ { "TCPFACKReorder", N_("Detected reordering %llu times using FACK"), opt_number }, + { "TCPFACKReorder", N_("Detected reordering %llu times using FACK"), opt_number },
+ { "TCPSACKReorder", N_("Detected reordering %llu times using SACK"), opt_number }, + { "TCPSACKReorder", N_("Detected reordering %llu times using SACK"), opt_number },
+ { "TCPTSReorder", N_("Detected reordering %llu times using time stamp"), 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 }, + { "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 }, + { "TCPPartialUndo", N_("%llu congestion windows partially recovered using Hoe heuristic"), opt_number },
+ { "TCPDSackUndo", N_("%llu congestion window recovered using DSACK"), opt_number }, + { "TCPDSackUndo", N_("%llu congestion window recovered without slow start using DSACK"), opt_number },
+ { "TCPLossUndo", N_("%llu congestion windows recovered after partial ack"), opt_number }, + { "TCPLossUndo", N_("%llu congestion windows recovered without slow start after partial ack"), opt_number },
+ { "TCPLostRetransmits", N_("%llu retransmits lost"), opt_number }, + { "TCPLostRetransmits", N_("%llu retransmits lost"), opt_number },
+ { "TCPRenoFailures", N_("%llu timeouts after reno fast retransmit"), opt_number }, + { "TCPRenoFailures", N_("%llu timeouts after reno fast retransmit"), opt_number },
+ { "TCPSackFailures", N_("%llu timeouts after SACK recovery"), 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 }, + { "TCPSlowStartRetrans", N_("%llu retransmits in slow start"), opt_number },
+ { "TCPTimeouts", N_("%llu other TCP timeouts"), opt_number }, + { "TCPTimeouts", N_("%llu other TCP timeouts"), opt_number },
+ { "TCPRenoRecoveryFailed", N_("%llu reno fast retransmits failed"), 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 }, + { "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 }, + { "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 }, + { "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 }, + { "TCPAbortOnMemory", N_("%llu connections aborted due to memory pressure"), opt_number },
+ { "TCPAbortOnTimeout", N_("%llu connections aborted due to timeout"), 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 }, + { "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 }, + { "TCPMemoryPressures", N_("TCP ran low on memory %llu times"), opt_number },
+ { "TCPLoss", N_("%llu TCP data loss events") }, + { "TCPLoss", N_("%llu TCP data loss events"), opt_number },
}; + { "TCPDSACKUndo", N_("%llu congestion windows recovered without slow start by DSACK"),
opt_number },
struct entry Sctptab[] = - { "TCPRenoRecoveryFail", N_("%u classic Reno fast retransmits failed"), opt_number },
{ + { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
- {"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},
}; };
struct tabtab { 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); 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; struct entry *ent = NULL, key;
int type; 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); sizeof(struct entry), cmpentries);
if (!ent) { /* try our best */ if (!ent) { /* try our best */
if (val) if (val)
@ -348,7 +442,7 @@ diff -up net-tools-1.60/statistics.c.doubleword net-tools-1.60/statistics.c
return; return;
} }
type = ent->type; 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'; *p = '\0';
if (*sp != '\0' && *(tab->flag)) 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; sp = p + 1;
} }
@@ -426,7 +426,7 @@ void process_fd2(FILE *f, const char *fi @@ -481,12 +481,12 @@ void cpytitle(char *original, char *new)
sp += strspn(sp, " \t\n"); void process6_fd(FILE *f)
{
if (*sp != '\0' && *(tab->flag)) char buf1[1024],buf2[50],buf3[1024];
- printval(tab, buf1, strtoul(sp, 0, 10)); - unsigned long val;
+ printval(tab, buf1, strtoull(sp, 0, 10)); + unsigned long long val;
} struct tabtab *tab = NULL;
return; 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 diff -up net-tools-1.60/lib/interface.c.trim-iface net-tools-1.60/lib/interface.c
+++ net-tools-1.60/ifconfig.c 2005-03-30 10:40:50.000000000 +0200 --- net-tools-1.60/lib/interface.c.trim-iface 2011-12-02 18:00:09.000000000 +0100
@@ -177,7 +177,7 @@ +++ 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
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 @@
void ife_print_short(struct interface *ptr) void ife_print_short(struct interface *ptr)
{ {
@ -20,12 +10,3 @@
printf("%5d %3d ", ptr->mtu, ptr->metric); printf("%5d %3d ", ptr->mtu, ptr->metric);
/* If needed, display the interface statistics. */ /* If needed, display the interface statistics. */
if (ptr->statistics_valid) { 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 diff -up net-tools-1.60/lib/interface.c.virtualname net-tools-1.60/lib/interface.c
+++ net-tools-1.60/lib/interface.c 2003-08-19 13:18:01.000000000 +0200 --- net-tools-1.60/lib/interface.c.virtualname 2011-11-21 02:31:57.000000000 +0100
@@ -579,18 +579,18 @@ +++ 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) void ife_print_short(struct interface *ptr)
{ {
- printf("%-5.5s ", ptr->name); - 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("%-9.9s ", ptr->name);
+ printf("%5d %3d ", ptr->mtu, ptr->metric); + printf("%5d %3d ", ptr->mtu, ptr->metric);
/* If needed, display the interface statistics. */ /* If needed, display the interface statistics. */
if (ptr->statistics_valid) { if (ptr->statistics_valid) {
- printf("%8llu %6lu %6lu %6lu", printf("%8llu %6lu %6lu %-6lu ",
+ printf("%8llu %6lu %6lu %6lu ", @@ -608,7 +608,7 @@ void ife_print_short(struct interface *p
ptr->stats.rx_packets, ptr->stats.rx_errors,
ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors);
printf("%8llu %6lu %6lu %6lu ",
ptr->stats.tx_packets, ptr->stats.tx_errors, ptr->stats.tx_packets, ptr->stats.tx_errors,
ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors); ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors);
} else { } else {
@ -23,9 +21,10 @@
} }
/* DONT FORGET TO ADD THE FLAGS IN ife_print_long, too */ /* DONT FORGET TO ADD THE FLAGS IN ife_print_long, too */
if (ptr->flags == 0) if (ptr->flags == 0)
--- net-tools-1.60/netstat.c.virtualname 2001-04-15 16:41:17.000000000 +0200 diff -up net-tools-1.60/netstat.c.virtualname net-tools-1.60/netstat.c
+++ net-tools-1.60/netstat.c 2003-08-19 13:18:34.000000000 +0200 --- net-tools-1.60/netstat.c.virtualname 2011-11-21 02:31:57.000000000 +0100
@@ -1449,7 +1449,7 @@ +++ 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) { if (flag_exp < 2) {
ife_short = 1; 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 diff -up net-tools-1.60/lib/pathnames.h.x25 net-tools-1.60/lib/pathnames.h
+++ net-tools-1.60/lib/pathnames.h 2006-04-12 22:19:34.072430000 -0400 --- net-tools-1.60/lib/pathnames.h.x25 2011-11-21 02:31:57.000000000 +0100
@@ -42,8 +42,8 @@ +++ 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_PROCNET_RARP "/proc/net/rarp"
#define _PATH_ETHERS "/etc/ethers" #define _PATH_ETHERS "/etc/ethers"
#define _PATH_PROCNET_ROSE_ROUTE "/proc/net/rose_routes" #define _PATH_PROCNET_ROSE_ROUTE "/proc/net/rose_routes"
@ -9,5 +10,5 @@
+#define _PATH_PROCNET_X25 "/proc/net/x25" +#define _PATH_PROCNET_X25 "/proc/net/x25"
+#define _PATH_PROCNET_X25_ROUTE "/proc/net/x25/route" +#define _PATH_PROCNET_X25_ROUTE "/proc/net/x25/route"
#define _PATH_PROCNET_DEV_MCAST "/proc/net/dev_mcast" #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 Summary: Basic networking tools
Name: net-tools Name: net-tools
Version: 1.60 Version: 1.60
Release: 128%{?dist} Release: 129.%{checkout}%{?dist}
License: GPL+ License: GPL+
Group: System Environment/Base Group: System Environment/Base
URL: http://net-tools.sourceforge.net 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 Source1: net-tools-%{version}-config.h
Source2: net-tools-%{version}-config.make Source2: net-tools-%{version}-config.make
Source3: ether-wake.c Source3: ether-wake.c
@ -17,119 +20,234 @@ Source7: iptunnel.8
Source8: ipmaddr.8 Source8: ipmaddr.8
Source9: arp-ethers.service Source9: arp-ethers.service
Patch1: net-tools-1.57-bug22040.patch # Not needed
Patch2: net-tools-1.60-miiioctl.patch #Patch1: net-tools-1.57-bug22040.patch
Patch3: net-tools-1.60-manydevs.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 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 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 Patch7: net-tools-1.60-ipx.patch
# hostname lookup problems with route --inet6 (#84108)
Patch8: net-tools-1.60-inet6-lookup.patch Patch8: net-tools-1.60-inet6-lookup.patch
# various man page fixes merged into one patch
Patch9: net-tools-1.60-man.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 Patch12: net-tools-1.60-interface.patch
Patch14: net-tools-1.60-gcc34.patch
Patch15: net-tools-1.60-overflow.patch # Fixed upstream
Patch19: net-tools-1.60-siunits.patch #Patch14: net-tools-1.60-gcc34.patch
Patch20: net-tools-1.60-trunc.patch
Patch21: net-tools-1.60-return.patch # Fixed upstream
Patch22: net-tools-1.60-parse.patch #Patch15: net-tools-1.60-overflow.patch
Patch23: net-tools-1.60-netmask.patch
Patch24: net-tools-1.60-ulong.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 Patch25: net-tools-1.60-bcast.patch
Patch27: net-tools-1.60-netstat_ulong.patch
Patch28: net-tools-1.60-note.patch # Fixed upstream
Patch29: net-tools-1.60-num-ports.patch #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 Patch30: net-tools-1.60-duplicate-tcp.patch
# don't report statistics for virtual devices (#143981)
Patch31: net-tools-1.60-statalias.patch Patch31: net-tools-1.60-statalias.patch
Patch32: net-tools-1.60-isofix.patch
Patch34: net-tools-1.60-ifconfig_ib.patch # translation headers - content type format
Patch35: net-tools-1.60-de.patch # is it good for anything ?
Patch37: net-tools-1.60-pie.patch #Patch32: net-tools-1.60-isofix.patch
Patch38: net-tools-1.60-ifaceopt.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 Patch39: net-tools-1.60-trim_iface.patch
Patch40: net-tools-1.60-stdo.patch
Patch41: net-tools-1.60-statistics.patch # flush output in mii-tool (#152568)
Patch42: net-tools-1.60-ifconfig.patch # 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 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 Patch45: net-tools-1.60-interface_stack.patch
# new option for nestat, -Z shows selinux context
Patch46: net-tools-1.60-selinux.patch 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 Patch49: net-tools-1.60-fgets.patch
# wrong definition of _PATH_PROCNET_X25_ROUTE (#188786)
Patch51: net-tools-1.60-x25-proc.patch 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 Patch54: net-tools-1.60-ifconfig-long-iface-crasher.patch
Patch55: net-tools-1.60-netdevice.patch
Patch56: net-tools-1.60-skip.patch # Fixed upstream
Patch57: net-tools-1.60-netstat-I-fix.patch #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 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 # fix arp unaligned access (#220438)
Patch61: net-tools-1.60-remove_node.patch # Fixed upstream
Patch62: net-tools-1.60-netstat-interfaces-crash.patch #Patch59: net-tools-1.60-arp-unaligned-access.patch
Patch64: net-tools-1.60-ec_hw_null.patch
Patch65: net-tools-1.60-statistics_buffer.patch # Fixed upstream
Patch66: net-tools-1.60-sctp-addrs.patch #Patch60: net-tools-1.60-sctp-quiet.patch
Patch67: net-tools-1.60-i-option.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 Patch69: net-tools-1.60-clear-flag.patch
# fixed tcp timers info in netstat (#466845)
Patch71: net-tools-1.60-netstat-probe.patch 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 Patch72: net-tools-1.60-scanf-format.patch
# netstat - avoid name resolution for listening or established sockets (-l) by return fast # upstream
Patch73: net-tools-1.60-avoid-name-resolution.patch #Patch73: net-tools-1.60-avoid-name-resolution.patch
# netstat - --continuous should flush stdout # upstream
Patch74: net-tools-1.60-continous-flush-stdout.patch #Patch74: net-tools-1.60-continous-flush-stdout.patch
# fix some errors so net-tools can be build with DEBUG defined # upstream
Patch75: net-tools-1.60-debug-fix.patch #Patch75: net-tools-1.60-debug-fix.patch
# let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address # 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 Patch76: net-tools-1.60-ib-warning.patch
# handle raw "IP" masqinfo # upstream
Patch79: net-tools-1.60-masqinfo-raw-ip.patch #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 # upstream
# add missing dependency on version.h to libdir target to fix parallel build failures #Patch80: net-tools-1.60-makefile-berlios.patch
# convert -idirafter to -I
Patch80: net-tools-1.60-makefile-berlios.patch
# slattach: use fchown() rather than chown() to avoid race between creation and permission changing # 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) # hostname patch
Patch82: net-tools-1.60-hostname-short.patch #Patch82: net-tools-1.60-hostname-short.patch
# use <linux/mii.h> instead of "mii.h" and fix Bug #491358 # use <linux/mii.h> instead of "mii.h" and fix Bug #491358
Patch83: net-tools-1.60-mii-refactor.patch Patch83: net-tools-1.60-mii-refactor.patch
# Bug 473211: ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 # ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 (#473211)
# interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways
Patch84: net-tools-1.60-IA64.patch Patch84: net-tools-1.60-IA64.patch
# interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543) # upstream
Patch85: net-tools-1.60-large-indexes.patch #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) # Fixed upstream
Patch86: net-tools-1.60-statistics-doubleword.patch #Patch87: net-tools-1.60-mii-gigabit.patch
# update mii-tool to support gigabit links (#539575)
Patch87: net-tools-1.60-mii-gigabit.patch
# fix memory leak in netstat when run with -c option # fix memory leak in netstat when run with -c option
Patch88: net-tools-1.60-netstat-leak.patch Patch88: net-tools-1.60-netstat-leak.patch
# HFI support # upstream
Patch89: net-tools-1.60-hfi.patch #Patch90: net-tools-1.60-ifdef-vs-if.patch
# Fix the handling of some of the HAVE_* flags ifdef vs if. (BerliOS #17812)
Patch90: net-tools-1.60-ifdef-vs-if.patch
# Don't rely on eth0 being default network device name. # Don't rely on eth0 being default network device name.
# Since Fedora 15 network devices can have arbitrary names (#682367) # 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) # plipconfig man page and usage output fixes. (#694766)
Patch92: net-tools-1.60-plipconfig.patch Patch92: net-tools-1.60-plipconfig.patch
# patch netstat to separate basename of -p only if it is absolute # netstat: remove part starting with colon in 'PID/Program name' column (#707427)
# path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0).
Patch93: net-tools-1.60-netstat-p-basename.patch Patch93: net-tools-1.60-netstat-p-basename.patch
# Possible problems found by static analysis of code. # Possible problems found by static analysis of code.
Patch94: net-tools-1.60-coverity.patch 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 Patch95: net-tools-1.60-2digit.patch
BuildRequires: gettext, libselinux BuildRequires: gettext, libselinux
@ -160,84 +277,83 @@ including ifconfig, netstat, route, and others.
Most of them are obsolete. For replacement check iproute package. Most of them are obsolete. For replacement check iproute package.
%prep %prep
%setup -q %setup -q -c
%patch1 -p1 -b .bug22040 #%%patch1 -p1 -b .bug22040
%patch2 -p1 -b .miiioctl #%%patch2 -p1 -b .miiioctl
%patch3 -p0 -b .manydevs #%%patch3 -p0 -b .manydevs
%patch4 -p1 -b .virtualname %patch4 -p1 -b .virtualname
%patch5 -p1 -b .cycle %patch5 -p1 -b .cycle
%patch6 -p1 -b .nameif #%%patch6 -p1 -b .nameif
%patch7 -p1 -b .ipx %patch7 -p1 -b .ipx
%patch8 -p1 -b .inet6-lookup %patch8 -p1 -b .inet6-lookup
%patch9 -p1 -b .man %patch9 -p1 -b .man
%patch10 -p1 -b .gcc33 #%%patch10 -p1 -b .gcc33
%patch11 -p1 -b .trailingblank #%%patch11 -p1 -b .trailingblank
%patch12 -p1 -b .interface %patch12 -p1 -b .interface
%patch14 -p1 -b .gcc34 #%%patch14 -p1 -b .gcc34
%patch15 -p1 -b .overflow #%%patch15 -p1 -b .overflow
%patch19 -p1 -b .siunits #%%patch19 -p1 -b .siunits
%patch20 -p1 -b .trunc #%%patch20 -p1 -b .trunc
%patch21 -p1 -b .return %patch21 -p1 -b .return
%patch22 -p1 -b .parse #%%patch22 -p1 -b .parse
%patch23 -p1 -b .netmask #%%patch23 -p1 -b .netmask
%patch24 -p1 -b .ulong %patch24 -p1 -b .doubleword
%patch25 -p1 -b .bcast %patch25 -p1 -b .bcast
%patch27 -p1 -b .netstat_ulong #%%patch27 -p1 -b .netstat_ulong
%patch28 -p1 -b .note #%%patch28 -p1 -b .note
%patch29 -p1 -b .num-ports #%%patch29 -p1 -b .num-ports
%patch30 -p1 -b .dup-tcp %patch30 -p1 -b .dup-tcp
%patch31 -p1 -b .statalias %patch31 -p1 -b .statalias
%patch32 -p1 -b .isofix #%%patch32 -p1 -b .isofix
%patch34 -p1 -b .ifconfig_ib #%%patch34 -p1 -b .ifconfig_ib
%patch35 -p1 #%%patch35 -p1
%patch37 -p1 -b .pie #%%patch37 -p1 -b .pie
%patch38 -p1 -b .ifaceopt #%%patch38 -p1 -b .ifaceopt
%patch39 -p1 -b .trim-iface %patch39 -p1 -b .trim-iface
%patch40 -p1 -b .stdo #%%patch40 -p1 -b .stdo
%patch41 -p1 -b .statistics #%%patch41 -p1 -b .statistics
%patch42 -p1 -b .iface_drop #%%patch42 -p1 -b .iface_drop
%patch43 -p1 -b .overflow %patch43 -p1 -b .overflow
%patch44 -p1 -b .hostname_man #%%patch44 -p1 -b .hostname_man
%patch45 -p0 -b .stack %patch45 -p1 -b .stack
%patch46 -p1 -b .selinux %patch46 -p1 -b .selinux
%patch47 -p1 -b .trim #%%patch47 -p1 -b .trim
%patch48 -p1 -b .inode #%%patch48 -p1 -b .inode
%patch49 -p1 -b .fgets %patch49 -p1 -b .fgets
%patch51 -p1 -b .x25 %patch51 -p1 -b .x25
%patch52 -p1 -b .sctp %patch52 -p1 -b .sctp
%patch54 -p1 -b .long_iface %patch54 -p1 -b .long_iface
%patch55 -p1 -b .netdevice #%%patch55 -p1 -b .netdevice
%patch56 -p1 -b .skip #%%patch56 -p1 -b .skip
%patch57 -p1 #%%patch57 -p1
%patch58 -p1 -b .strncpy %patch58 -p1 -b .strncpy
%patch59 -p1 -b .arp-un-access #%%patch59 -p1 -b .arp-un-access
%patch60 -p1 -b .quiet #%%patch60 -p1 -b .quiet
%patch61 -p1 #%%patch61 -p1
%patch62 -p1 -b .iface-crash #%%patch62 -p1 -b .iface-crash
%patch64 -p1 #%%patch64 -p1
%patch65 -p1 -b .buffer #%%patch65 -p1 -b .buffer
%patch66 -p1 -b .sctp-addrs #%%patch66 -p1 -b .sctp-addrs
%patch67 -p1 -b .i-option #%%patch67 -p1 -b .i-option
%patch69 -p1 -b .clear-flag %patch69 -p1 -b .clear-flag
%patch71 -p1 -b .probe %patch71 -p1 -b .probe
%patch72 -p1 -b .scanf-format %patch72 -p1 -b .scanf-format
%patch73 -p1 -b .avoid-name-resolution #%%patch73 -p1 -b .avoid-name-resolution
%patch74 -p1 -b .continous-flush-stdout #%%patch74 -p1 -b .continous-flush-stdout
%patch75 -p1 -b .debug-fix #%%patch75 -p1 -b .debug-fix
%patch76 -p1 -b .ib-warning %patch76 -p1 -b .ib-warning
%patch79 -p1 -b .masqinfo-raw-ip #%%patch79 -p1 -b .masqinfo-raw-ip
%patch80 -p1 -b .makefile-berlios #%%patch80 -p1 -b .makefile-berlios
%patch81 -p1 -b .slattach-fchown #%%patch81 -p1 -b .slattach-fchown
%patch82 -p1 -b .hostname-short #%%patch82 -p1 -b .hostname-short
%patch83 -p1 -b .mii-refactor %patch83 -p1 -b .mii-refactor
%patch84 -p1 -b .IA64 %patch84 -p1 -b .IA64
%patch85 -p1 -b .large-indexes #%%patch85 -p1 -b .large-indexes
%patch86 -p1 -b .doubleword #%%patch87 -p1 -b .mii-gigabit
%patch87 -p1 -b .mii-gigabit
%patch88 -p1 -b .netstat-leak %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 %patch91 -p1 -b .arbitrary-device-names
%patch92 -p1 -b .plipconfig %patch92 -p1 -b .plipconfig
%patch93 -p1 -b .p-basename %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 gcc $RPM_OPT_FLAGS -o mii-diag mii-diag.c
%install %install
rm -rf %{buildroot}
mv man/de_DE man/de mv man/de_DE man/de
mv man/fr_FR man/fr mv man/fr_FR man/fr
mv man/pt_BR man/pt mv man/pt_BR man/pt
@ -335,7 +450,6 @@ fi
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING %doc COPYING
/bin/netstat /bin/netstat
/sbin/* /sbin/*
@ -346,6 +460,10 @@ fi
%attr(0644,root,root) %{_unitdir}/arp-ethers.service %attr(0644,root,root) %{_unitdir}/arp-ethers.service
%changelog %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 * Tue Oct 25 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-128
- Removed HFI support. - Removed HFI support.
- Improved num-ports.patch - Improved num-ports.patch