removed unused patches
This commit is contained in:
parent
626e1f7d6b
commit
90b4e5c29f
@ -1,50 +0,0 @@
|
||||
--- net-tools-1.57/arp.c.orig Sun May 14 17:57:41 2000
|
||||
+++ net-tools-1.57/arp.c Sat Nov 25 15:05:27 2000
|
||||
@@ -618,6 +618,7 @@
|
||||
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub <-''-\n\n"));
|
||||
|
||||
fprintf(stderr, _(" -a display (all) hosts in alternative (BSD) style\n"));
|
||||
+ fprintf(stderr, _(" -e display (all) hosts in default (Linux) style\n"));
|
||||
fprintf(stderr, _(" -s, --set set a new ARP entry\n"));
|
||||
fprintf(stderr, _(" -d, --delete delete a specified entry\n"));
|
||||
fprintf(stderr, _(" -v, --verbose be verbose\n"));
|
||||
--- net-tools-1.57/man/en_US/arp.8.orig Sat Nov 25 15:13:26 2000
|
||||
+++ net-tools-1.57/man/en_US/arp.8 Sat Nov 25 15:15:12 2000
|
||||
@@ -3,7 +3,7 @@
|
||||
arp \- manipulate the system ARP cache
|
||||
.SH SYNOPSIS
|
||||
.B arp
|
||||
-.RB [ \-vn ]
|
||||
+.RB [ \-evn ]
|
||||
.RB [ "\-H type" ]
|
||||
.RB [ "-i if" ]
|
||||
.B -a
|
||||
@@ -60,7 +60,7 @@
|
||||
shows numerical addresses instead of trying to determine symbolic host, port
|
||||
or user names.
|
||||
.TP
|
||||
-.B "\-H type, \-\-hw-type type"
|
||||
+.B "\-H type, \-\-hw-type type, \-t type"
|
||||
When setting or reading the ARP cache, this optional parameter tells
|
||||
.B arp
|
||||
which class of entries it should check for. The default value of
|
||||
@@ -81,7 +81,8 @@
|
||||
.B hostname
|
||||
parameter is not used,
|
||||
.B all
|
||||
-entries will be displayed.
|
||||
+entries will be displayed.
|
||||
+The entries will be displayed in alternate (BSD) style.
|
||||
.TP
|
||||
.B "\-d hostname, \-\-delete hostname"
|
||||
Remove any entry for the specified host. This can be used if the
|
||||
@@ -91,6 +92,9 @@
|
||||
Use the interface
|
||||
.BR ifa "'s"
|
||||
hardware address.
|
||||
+.TP
|
||||
+.B "\-e"
|
||||
+Shows the entries in default (Linux) style.
|
||||
.TP
|
||||
.B "\-i If, \-\-device If"
|
||||
Select an interface. When dumping the ARP cache only entries matching
|
@ -1,116 +0,0 @@
|
||||
--- net-tools-1.60/arp.c 2001-04-08 10:05:05.000000000 -0700
|
||||
+++ net-tools-1.60.new/arp.c 2006-01-31 13:10:01.479716750 -0800
|
||||
@@ -100,7 +100,7 @@ static int arp_del(char **args)
|
||||
{
|
||||
char host[128];
|
||||
struct arpreq req;
|
||||
- struct sockaddr sa;
|
||||
+ struct sockaddr_storage ss;
|
||||
int flags = 0;
|
||||
int err;
|
||||
|
||||
@@ -112,12 +112,12 @@ static int arp_del(char **args)
|
||||
return (-1);
|
||||
}
|
||||
safe_strncpy(host, *args, (sizeof host));
|
||||
- if (ap->input(0, host, &sa) < 0) {
|
||||
+ if (ap->input(0, host, (struct sockaddr*)&ss) < 0) {
|
||||
ap->herror(host);
|
||||
return (-1);
|
||||
}
|
||||
/* If a host has more than one address, use the correct one! */
|
||||
- memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
|
||||
+ memcpy((char *) &req.arp_pa, (char *) &ss, sizeof(struct sockaddr));
|
||||
|
||||
if (hw_set)
|
||||
req.arp_ha.sa_family = hw->type;
|
||||
@@ -177,11 +177,11 @@ static int arp_del(char **args)
|
||||
usage();
|
||||
if (strcmp(*args, "255.255.255.255") != 0) {
|
||||
strcpy(host, *args);
|
||||
- if (ap->input(0, host, &sa) < 0) {
|
||||
+ if (ap->input(0, host, (struct sockaddr*)&ss) < 0) {
|
||||
ap->herror(host);
|
||||
return (-1);
|
||||
}
|
||||
- memcpy((char *) &req.arp_netmask, (char *) &sa,
|
||||
+ memcpy((char *) &req.arp_netmask, (char *) &ss,
|
||||
sizeof(struct sockaddr));
|
||||
req.arp_flags |= ATF_NETMASK;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ static int arp_set(char **args)
|
||||
{
|
||||
char host[128];
|
||||
struct arpreq req;
|
||||
- struct sockaddr sa;
|
||||
+ struct sockaddr_storage ss;
|
||||
int flags;
|
||||
|
||||
memset((char *) &req, 0, sizeof(req));
|
||||
@@ -271,12 +271,12 @@ static int arp_set(char **args)
|
||||
return (-1);
|
||||
}
|
||||
safe_strncpy(host, *args++, (sizeof host));
|
||||
- if (ap->input(0, host, &sa) < 0) {
|
||||
+ if (ap->input(0, host, (struct sockaddr*)&ss) < 0) {
|
||||
ap->herror(host);
|
||||
return (-1);
|
||||
}
|
||||
/* If a host has more than one address, use the correct one! */
|
||||
- memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
|
||||
+ memcpy((char *) &req.arp_pa, (char *) &ss, sizeof(struct sockaddr));
|
||||
|
||||
/* Fetch the hardware address. */
|
||||
if (*args == NULL) {
|
||||
@@ -346,11 +346,11 @@ static int arp_set(char **args)
|
||||
usage();
|
||||
if (strcmp(*args, "255.255.255.255") != 0) {
|
||||
strcpy(host, *args);
|
||||
- if (ap->input(0, host, &sa) < 0) {
|
||||
+ if (ap->input(0, host, (struct sockaddr*)&ss) < 0) {
|
||||
ap->herror(host);
|
||||
return (-1);
|
||||
}
|
||||
- memcpy((char *) &req.arp_netmask, (char *) &sa,
|
||||
+ memcpy((char *) &req.arp_netmask, (char *) &ss,
|
||||
sizeof(struct sockaddr));
|
||||
flags |= ATF_NETMASK;
|
||||
}
|
||||
@@ -519,7 +519,7 @@ static void arp_disp(char *name, char *i
|
||||
static int arp_show(char *name)
|
||||
{
|
||||
char host[100];
|
||||
- struct sockaddr sa;
|
||||
+ struct sockaddr_storage ss;
|
||||
char ip[100];
|
||||
char hwa[100];
|
||||
char mask[100];
|
||||
@@ -535,11 +535,11 @@ static int arp_show(char *name)
|
||||
if (name != NULL) {
|
||||
/* Resolve the host name. */
|
||||
safe_strncpy(host, name, (sizeof host));
|
||||
- if (ap->input(0, host, &sa) < 0) {
|
||||
+ if (ap->input(0, host, (struct sockaddr*)&ss) < 0) {
|
||||
ap->herror(host);
|
||||
return (-1);
|
||||
}
|
||||
- safe_strncpy(host, ap->sprint(&sa, 1), sizeof(host));
|
||||
+ safe_strncpy(host, ap->sprint((struct sockaddr*)&ss, 1), sizeof(host));
|
||||
}
|
||||
/* Open the PROCps kernel table. */
|
||||
if ((fp = fopen(_PATH_PROCNET_ARP, "r")) == NULL) {
|
||||
@@ -575,10 +575,11 @@ static int arp_show(char *name)
|
||||
if (opt_n)
|
||||
hostname = "?";
|
||||
else {
|
||||
- if (ap->input(0, ip, &sa) < 0)
|
||||
+ if (ap->input(0, ip, (struct sockaddr*)&ss) < 0)
|
||||
hostname = ip;
|
||||
else
|
||||
- hostname = ap->sprint(&sa, opt_n | 0x8000);
|
||||
+ hostname = ap->sprint((struct sockaddr*)&ss,
|
||||
+ opt_n | 0x8000);
|
||||
if (strcmp(hostname, ip) == 0)
|
||||
hostname = "?";
|
||||
}
|
||||
|
@ -1,31 +0,0 @@
|
||||
diff -up net-tools-1.60/netstat.c.avoid-name-resolution net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.avoid-name-resolution 2009-08-28 10:48:40.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2009-08-14 12:36:56.000000000 +0200
|
||||
@@ -961,6 +961,10 @@ static void tcp_do_one(int lnr, const ch
|
||||
&d, local_addr, &local_port, rem_addr, &rem_port, &state,
|
||||
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
|
||||
|
||||
+ if (!flag_all &&
|
||||
+ ((flag_lst && rem_port) || (!flag_lst && !rem_port)))
|
||||
+ return;
|
||||
+
|
||||
if (strlen(local_addr) > 8) {
|
||||
#if HAVE_AFINET6
|
||||
/* Demangle what the kernel gives us */
|
||||
@@ -1014,7 +1018,7 @@ static void tcp_do_one(int lnr, const ch
|
||||
flag_not & FLAG_NUM_HOST), sizeof(local_addr));
|
||||
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST),
|
||||
sizeof(rem_addr));
|
||||
- if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
|
||||
+
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(local_port), "tcp",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
@@ -1075,7 +1079,6 @@ static void tcp_do_one(int lnr, const ch
|
||||
rxq, txq, local_addr, rem_addr, _(tcp_state[state]));
|
||||
|
||||
finish_this_one(uid,inode,timers);
|
||||
- }
|
||||
}
|
||||
|
||||
static int tcp_info(void)
|
@ -1,61 +0,0 @@
|
||||
diff -up net-tools-1.60/netstat.c.continous-flush-stdout net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.continous-flush-stdout 2009-08-28 10:57:12.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2009-08-28 10:58:48.000000000 +0200
|
||||
@@ -357,6 +357,12 @@ static void prg_cache_clear(void)
|
||||
prg_cache_loaded=0;
|
||||
}
|
||||
|
||||
+static void wait_continous(const int reptimer)
|
||||
+{
|
||||
+ fflush(stdout);
|
||||
+ sleep(reptimer);
|
||||
+}
|
||||
+
|
||||
static void extract_type_1_socket_inode(const char lname[], unsigned long * inode_p, int * status) {
|
||||
|
||||
/* If lname is of the form "socket:[12345]", extract the "12345"
|
||||
@@ -2289,7 +2295,7 @@ int main
|
||||
flag_not & FLAG_NUM_PORT, flag_exp);
|
||||
if (i || !flag_cnt)
|
||||
break;
|
||||
- sleep(reptimer);
|
||||
+ wait_continous(reptimer);
|
||||
}
|
||||
#else
|
||||
ENOSUPP("netstat.c", "FW_MASQUERADE");
|
||||
@@ -2305,7 +2311,7 @@ int main
|
||||
|
||||
if(i || !flag_cnt)
|
||||
break;
|
||||
- sleep(reptimer);
|
||||
+ wait_continous(reptimer);
|
||||
}
|
||||
return(i);
|
||||
}
|
||||
@@ -2329,7 +2335,7 @@ int main
|
||||
i = route_info(afname, options);
|
||||
if (i || !flag_cnt)
|
||||
break;
|
||||
- sleep(reptimer);
|
||||
+ wait_continous(reptimer);
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
@@ -2338,7 +2344,7 @@ int main
|
||||
i = iface_info();
|
||||
if (!flag_cnt || i)
|
||||
break;
|
||||
- sleep(reptimer);
|
||||
+ wait_continous(reptimer);
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
@@ -2470,7 +2476,7 @@ int main
|
||||
}
|
||||
if (!flag_cnt || i)
|
||||
break;
|
||||
- sleep(reptimer);
|
||||
+ wait_continous(reptimer);
|
||||
prg_cache_clear();
|
||||
tcp_node_hash_clear();
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
--- net-tools-1.60/po/de.po.old 2005-02-16 16:46:02.000000000 +0100
|
||||
+++ net-tools-1.60/po/de.po 2005-02-16 16:54:07.886323928 +0100
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
#: ../arp.c:467
|
||||
msgid "(incomplete)"
|
||||
-msgstr "(unvollsändig)"
|
||||
+msgstr "(unvollständig)"
|
||||
|
||||
#: ../arp.c:484
|
||||
#, c-format
|
@ -1,61 +0,0 @@
|
||||
diff -up net-tools-1.60/lib/rose.c.debug-fix net-tools-1.60/lib/rose.c
|
||||
--- net-tools-1.60/lib/rose.c.debug-fix 2000-03-05 12:26:03.000000000 +0100
|
||||
+++ net-tools-1.60/lib/rose.c 2009-09-01 13:02:20.000000000 +0200
|
||||
@@ -86,7 +86,7 @@ static int ROSE_input(int type, char *bu
|
||||
if (strlen(bufp) != 10) {
|
||||
strcpy(ROSE_errmsg, _("Node address must be ten digits"));
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "rose_input(%s): %s !\n", ROSE_errmsg, orig);
|
||||
+ fprintf(stderr, "rose_input(%s): %s !\n", bufp, ROSE_errmsg);
|
||||
#endif
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
@@ -99,7 +99,7 @@ static int ROSE_input(int type, char *bu
|
||||
|
||||
/* All done. */
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "rose_input(%s): ", orig);
|
||||
+ fprintf(stderr, "rose_input(%s): ", bufp);
|
||||
for (i = 0; i < sizeof(rose_address); i++)
|
||||
fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
|
||||
fprintf(stderr, "\n");
|
||||
diff -up net-tools-1.60/lib/x25.c.debug-fix net-tools-1.60/lib/x25.c
|
||||
--- net-tools-1.60/lib/x25.c.debug-fix 2000-05-20 20:53:25.000000000 +0200
|
||||
+++ net-tools-1.60/lib/x25.c 2009-09-01 13:06:05.000000000 +0200
|
||||
@@ -81,6 +81,7 @@ X25_input(int type, char *bufp, struct s
|
||||
unsigned char *ptr;
|
||||
char *p;
|
||||
unsigned int sigdigits;
|
||||
+ int i;
|
||||
|
||||
sap->sa_family = x25_aftype.af;
|
||||
ptr = ((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr;
|
||||
@@ -90,7 +91,7 @@ X25_input(int type, char *bufp, struct s
|
||||
if (strlen(bufp)>18) {
|
||||
strcpy(X25_errmsg, _("Address can't exceed eighteen digits with sigdigits"));
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
|
||||
+ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
|
||||
#endif
|
||||
errno = EINVAL;
|
||||
return(-1);
|
||||
@@ -108,7 +109,7 @@ X25_input(int type, char *bufp, struct s
|
||||
*p = '/';
|
||||
strcpy(X25_errmsg, _("Invalid address"));
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
|
||||
+ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
|
||||
#endif
|
||||
errno = EINVAL;
|
||||
return(-1);
|
||||
@@ -118,8 +119,8 @@ X25_input(int type, char *bufp, struct s
|
||||
|
||||
/* All done. */
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "x25_input(%s): ", orig);
|
||||
- for (i = 0; i < sizeof(x25_address); i++)
|
||||
+ fprintf(stderr, "x25_input(%s): ", bufp);
|
||||
+ for (i = 0; i < sizeof(sap->sa_data); i++)
|
||||
fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
|
||||
fprintf(stderr, "\n");
|
||||
#endif
|
@ -1,12 +0,0 @@
|
||||
diff -up net-tools-1.60/lib/ec_hw.c.ec_hw_null net-tools-1.60/lib/ec_hw.c
|
||||
--- net-tools-1.60/lib/ec_hw.c.ec_hw_null 1999-11-20 22:02:53.000000000 +0100
|
||||
+++ net-tools-1.60/lib/ec_hw.c 2009-09-15 16:33:27.000000000 +0200
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_HWEC
|
||||
-
|
||||
+#include <stdlib.h>
|
||||
#include <net/if_arp.h>
|
||||
#include "net-support.h"
|
||||
|
@ -1,31 +0,0 @@
|
||||
--- net-tools-1.60/mii-tool.c.gcc33 2003-05-22 23:34:06.000000000 -0400
|
||||
+++ net-tools-1.60/mii-tool.c 2003-05-22 23:34:57.000000000 -0400
|
||||
@@ -378,17 +378,17 @@
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
|
||||
-const char *usage =
|
||||
-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
|
||||
- -V, --version display version information
|
||||
- -v, --verbose more verbose output
|
||||
- -R, --reset reset MII to poweron state
|
||||
- -r, --restart restart autonegotiation
|
||||
- -w, --watch monitor for link status changes
|
||||
- -l, --log with -w, write events to syslog
|
||||
- -A, --advertise=media,... advertise only specified media
|
||||
- -F, --force=media force specified media technology
|
||||
-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
|
||||
+const char *usage = "\
|
||||
+usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\
|
||||
+ -V, --version display version information\n\
|
||||
+ -v, --verbose more verbose output\n\
|
||||
+ -R, --reset reset MII to poweron state\n\
|
||||
+ -r, --restart restart autonegotiation\n\
|
||||
+ -w, --watch monitor for link status changes\n\
|
||||
+ -l, --log with -w, write events to syslog\n\
|
||||
+ -A, --advertise=media,... advertise only specified media\n\
|
||||
+ -F, --force=media force specified media technology\n\
|
||||
+media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\
|
||||
(to advertise both HD and FD) 100baseTx, 10baseT\n";
|
||||
|
||||
int main(int argc, char **argv)
|
@ -1,36 +0,0 @@
|
||||
--- net-tools-1.60/lib/inet_sr.c.gcc34 2000-02-20 22:46:45.000000000 +0100
|
||||
+++ net-tools-1.60/lib/inet_sr.c 2004-03-30 15:57:25.276049571 +0200
|
||||
@@ -105,6 +105,7 @@
|
||||
case 2:
|
||||
isnet = 0; break;
|
||||
default:
|
||||
+ ;
|
||||
}
|
||||
|
||||
/* Fill in the other fields. */
|
||||
--- net-tools-1.60/hostname.c.gcc34 2004-03-30 15:58:12.979830341 +0200
|
||||
+++ net-tools-1.60/hostname.c 2004-03-30 15:58:47.110380585 +0200
|
||||
@@ -98,6 +98,7 @@
|
||||
fprintf(stderr, _("%s: name too long\n"), program_name);
|
||||
break;
|
||||
default:
|
||||
+ ;
|
||||
}
|
||||
exit(1);
|
||||
};
|
||||
@@ -117,6 +118,7 @@
|
||||
fprintf(stderr, _("%s: name too long\n"), program_name);
|
||||
break;
|
||||
default:
|
||||
+ ;
|
||||
}
|
||||
exit(1);
|
||||
};
|
||||
@@ -180,6 +182,7 @@
|
||||
printf("%s\n", hp->h_name);
|
||||
break;
|
||||
default:
|
||||
+ ;
|
||||
}
|
||||
}
|
||||
|
@ -1,38 +0,0 @@
|
||||
diff -up net-tools-1.60/hostname.c.hostname-short net-tools-1.60/hostname.c
|
||||
--- net-tools-1.60/hostname.c.hostname-short 2009-09-30 17:44:21.000000000 +0200
|
||||
+++ net-tools-1.60/hostname.c 2009-09-08 11:55:03.000000000 +0200
|
||||
@@ -176,11 +176,6 @@ static void showhname(char *hname, int c
|
||||
case 'f':
|
||||
printf("%s\n", hp->h_name);
|
||||
break;
|
||||
- case 's':
|
||||
- if (p != NULL)
|
||||
- *p = '\0';
|
||||
- printf("%s\n", hp->h_name);
|
||||
- break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
@@ -270,6 +265,7 @@ int main(int argc, char **argv)
|
||||
char myname[MAXHOSTNAMELEN + 1] =
|
||||
{0};
|
||||
char *file = NULL;
|
||||
+ char *p;
|
||||
|
||||
static const struct option long_options[] =
|
||||
{
|
||||
@@ -370,7 +366,13 @@ int main(int argc, char **argv)
|
||||
if (!type)
|
||||
printf("%s\n", myname);
|
||||
else
|
||||
- showhname(myname, type);
|
||||
+ if (type == 's') {
|
||||
+ if (p = strchr(myname, '.'))
|
||||
+ *p = '\0';
|
||||
+ printf("%s\n", myname);
|
||||
+ }
|
||||
+ else
|
||||
+ showhname(myname, type);
|
||||
break;
|
||||
case 3:
|
||||
if (file) {
|
@ -1,36 +0,0 @@
|
||||
--- net-tools-1.60/man/en_US/hostname.1.gethostbyname 2005-10-14 11:33:41.000000000 +0200
|
||||
+++ net-tools-1.60/man/en_US/hostname.1 2005-10-15 11:46:14.646697600 +0200
|
||||
@@ -99,6 +99,33 @@
|
||||
complete FQDN of the system is returned with
|
||||
.BR "hostname \-\-fqdn" .
|
||||
|
||||
+.LP
|
||||
+The function
|
||||
+.BR gethostname(2)
|
||||
+is used to get the hostname. When the
|
||||
+.BR "hostname \-a, \-d, \-f or \-i"
|
||||
+is called will
|
||||
+.BR gethostbyname(3)
|
||||
+be called. The difference in
|
||||
+.BR gethostname(2)
|
||||
+and
|
||||
+.BR gethostbyname(3)
|
||||
+is that
|
||||
+.BR gethostbyname(3)
|
||||
+is network aware, so it consults
|
||||
+.IR /etc/nsswitch.conf
|
||||
+and
|
||||
+.IR /etc/host.conf
|
||||
+to decide whether to read information in
|
||||
+.IR /etc/sysconfig/network
|
||||
+or
|
||||
+.IR /etc/hosts
|
||||
+
|
||||
+To add another dimension to this,
|
||||
+the
|
||||
+.B hostname
|
||||
+is also set when the network interface is brought up.
|
||||
+
|
||||
.SS "SET NAME"
|
||||
When called with one argument or with the
|
||||
.B \-\-file
|
@ -1,57 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.i-option 2008-07-10 10:56:29.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2008-07-10 13:46:27.000000000 +0200
|
||||
@@ -2042,7 +2042,7 @@ static void usage(void)
|
||||
fprintf(stderr, _(" netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
|
||||
|
||||
fprintf(stderr, _(" -r, --route display routing table\n"));
|
||||
- fprintf(stderr, _(" -I, --interface=[<Iface>] display interface table for <Iface>\n"));
|
||||
+ fprintf(stderr, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
|
||||
fprintf(stderr, _(" -i, --interfaces display interface table\n"));
|
||||
fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
|
||||
fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
|
||||
@@ -2085,7 +2085,6 @@ int main
|
||||
AFTRANS_OPTS,
|
||||
{"version", 0, 0, 'V'},
|
||||
{"interfaces", 2, 0, 'I'},
|
||||
- {"interfaces", 0, 0, 'i'},
|
||||
{"help", 0, 0, 'h'},
|
||||
{"route", 0, 0, 'r'},
|
||||
#if HAVE_FW_MASQUERADE
|
||||
@@ -2173,10 +2172,6 @@ int main
|
||||
if (optarg[0] == '=') optarg++;
|
||||
if (optarg && strcmp(optarg, "(null)"))
|
||||
flag_int_name = strdup(optarg);
|
||||
- else {
|
||||
- usage();
|
||||
- exit(1);
|
||||
- }
|
||||
flag_int++;
|
||||
break;
|
||||
case 'i':
|
||||
--- net-tools-1.60/man/en_US/netstat.8.i-option 2008-07-10 13:55:04.000000000 +0200
|
||||
+++ net-tools-1.60/man/en_US/netstat.8 2008-07-15 12:21:51.000000000 +0200
|
||||
@@ -43,10 +43,10 @@ netstat \- Print network connections, ro
|
||||
.RB [delay]
|
||||
.P
|
||||
.B netstat
|
||||
-.RB { \-\-interfaces | \-i }
|
||||
+.RB { \-\-interfaces | \-I | \-i }
|
||||
.RI [ iface ]
|
||||
.RB [ \-\-all | \-a ]
|
||||
-.RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
|
||||
+.RB [ \-\-extend | \-e ]
|
||||
.RB [ \-\-verbose | \-v ]
|
||||
.RB [ \-\-program | \-p ]
|
||||
.RB [ \-\-numeric | \-n ]
|
||||
@@ -107,9 +107,8 @@ families will be printed.
|
||||
Display the kernel routing tables.
|
||||
.SS "\-\-groups , \-g"
|
||||
Display multicast group membership information for IPv4 and IPv6.
|
||||
-.SS "\-\-interface=\fIiface \fR, \fB\-i"
|
||||
-Display a table of all network interfaces, or the specified
|
||||
-.IR iface ) .
|
||||
+.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"
|
@ -1,52 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.ifaceopt 2005-03-01 12:11:43.695661632 +0100
|
||||
+++ net-tools-1.60/netstat.c 2005-03-01 12:16:37.601981080 +0100
|
||||
@@ -1658,10 +1658,11 @@
|
||||
{
|
||||
fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
|
||||
fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
|
||||
- fprintf(stderr, _(" netstat { [-veenNac] -i[<Iface>] | [-cnNe] -M | -s } [delay]\n\n"));
|
||||
+ fprintf(stderr, _(" netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
|
||||
|
||||
fprintf(stderr, _(" -r, --route display routing table\n"));
|
||||
- fprintf(stderr, _(" -i, --interfaces=[<Iface>] display interface table\n"));
|
||||
+ fprintf(stderr, _(" -I, --interfaces=[<Iface>] display interface table for <Iface>\n"));
|
||||
+ fprintf(stderr, _(" -i, --interfaces display interface table\n"));
|
||||
fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
|
||||
fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
|
||||
#if HAVE_FW_MASQUERADE
|
||||
@@ -1700,7 +1701,8 @@
|
||||
{
|
||||
AFTRANS_OPTS,
|
||||
{"version", 0, 0, 'V'},
|
||||
- {"interfaces", 2, 0, 'i'},
|
||||
+ {"interfaces", 2, 0, 'I'},
|
||||
+ {"interfaces", 0, 0, 'i'},
|
||||
{"help", 0, 0, 'h'},
|
||||
{"route", 0, 0, 'r'},
|
||||
#if HAVE_FW_MASQUERADE
|
||||
@@ -1738,7 +1740,8 @@
|
||||
getroute_init(); /* Set up AF routing support */
|
||||
|
||||
afname[0] = '\0';
|
||||
- while ((i = getopt_long(argc, argv, "MCFA:acdegphi::nNorstuVv?wxl", longopts, &lop)) != EOF)
|
||||
+
|
||||
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxl", longopts, &lop)) != EOF)
|
||||
switch (i) {
|
||||
case -1:
|
||||
break;
|
||||
@@ -1779,11 +1782,14 @@
|
||||
case 'p':
|
||||
flag_prg++;
|
||||
break;
|
||||
- case 'i':
|
||||
+ case 'I':
|
||||
if (optarg && strcmp(optarg, "(null)"))
|
||||
flag_int_name = strdup(optarg);
|
||||
flag_int++;
|
||||
break;
|
||||
+ case 'i':
|
||||
+ flag_int++;
|
||||
+ break;
|
||||
case 'n':
|
||||
flag_not |= FLAG_NUM;
|
||||
break;
|
@ -1,107 +0,0 @@
|
||||
--- net-tools-1.60/ifconfig.c.new 2005-07-20 12:47:29.000000000 +0200
|
||||
+++ net-tools-1.60/ifconfig.c 2005-07-20 12:54:57.000000000 +0200
|
||||
@@ -175,6 +175,32 @@
|
||||
return (0);
|
||||
}
|
||||
|
||||
+/** test is a specified flag is set */
|
||||
+static int test_flag(char *ifname, short flags)
|
||||
+{
|
||||
+ struct ifreq ifr;
|
||||
+ int fd;
|
||||
+
|
||||
+ if (strchr(ifname, ':')) {
|
||||
+ /* This is a v4 alias interface. Downing it via a socket for
|
||||
+ another AF may have bad consequences. */
|
||||
+ fd = get_socket_for_af(AF_INET);
|
||||
+ if (fd < 0) {
|
||||
+ fprintf(stderr, _("No support for INET on this system.\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } else
|
||||
+ fd = skfd;
|
||||
+
|
||||
+ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
|
||||
+ if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
|
||||
+ fprintf(stderr, _("%s: ERROR while testing interface flags: %s\n"),
|
||||
+ ifname, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return (ifr.ifr_flags & flags);
|
||||
+}
|
||||
+
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stderr, _("Usage:\n ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"));
|
||||
@@ -249,7 +275,7 @@
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
- return 0;
|
||||
+ return err;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -415,6 +441,8 @@
|
||||
}
|
||||
if (!strcmp(*spp, "-promisc")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_PROMISC);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_PROMISC) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in promisc mode... maybe other application is running?\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -425,6 +453,8 @@
|
||||
}
|
||||
if (!strcmp(*spp, "-multicast")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_MULTICAST);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in MULTICAST mode.\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -435,6 +465,8 @@
|
||||
}
|
||||
if (!strcmp(*spp, "-allmulti")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_ALLMULTI);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in ALLMULTI mode.\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -456,6 +488,8 @@
|
||||
}
|
||||
if (!strcmp(*spp, "-dynamic")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_DYNAMIC);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in DYNAMIC mode.\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -513,6 +547,8 @@
|
||||
|
||||
if (!strcmp(*spp, "-broadcast")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_BROADCAST);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in BROADCAST mode.\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -569,7 +605,7 @@
|
||||
continue;
|
||||
}
|
||||
didnetmask++;
|
||||
- goterr = set_netmask(ap->fd, &ifr, &sa, dobcast);
|
||||
+ goterr |= set_netmask(ap->fd, &ifr, &sa, dobcast);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
||||
@@ -640,6 +676,8 @@
|
||||
}
|
||||
if (!strcmp(*spp, "-pointopoint")) {
|
||||
goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
|
||||
+ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
|
||||
+ fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
|
||||
spp++;
|
||||
continue;
|
||||
}
|
@ -1,202 +0,0 @@
|
||||
--- net-tools-1.60/config.in.ifconfig_ib 2000-05-21 16:32:12.000000000 +0200
|
||||
+++ net-tools-1.60/config.in 2005-02-09 10:36:26.000000000 +0100
|
||||
@@ -82,6 +82,7 @@
|
||||
bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB n
|
||||
bool 'IrDA support' HAVE_HWIRDA y
|
||||
bool 'Econet hardware support' HAVE_HWEC n
|
||||
+bool 'InfiniBand hardware support' HAVE_HWIB y
|
||||
*
|
||||
*
|
||||
* Other Features.
|
||||
--- net-tools-1.60/lib/hw.c.ifconfig_ib 2000-05-20 20:27:25.000000000 +0200
|
||||
+++ net-tools-1.60/lib/hw.c 2005-02-09 10:36:26.000000000 +0100
|
||||
@@ -73,6 +73,8 @@
|
||||
|
||||
extern struct hwtype ec_hwtype;
|
||||
|
||||
+extern struct hwtype ib_hwtype;
|
||||
+
|
||||
static struct hwtype *hwtypes[] =
|
||||
{
|
||||
|
||||
@@ -144,6 +146,9 @@
|
||||
#if HAVE_HWX25
|
||||
&x25_hwtype,
|
||||
#endif
|
||||
+#if HAVE_HWIB
|
||||
+ &ib_hwtype,
|
||||
+#endif
|
||||
&unspec_hwtype,
|
||||
NULL
|
||||
};
|
||||
@@ -217,6 +222,9 @@
|
||||
#if HAVE_HWEC
|
||||
ec_hwtype.title = _("Econet");
|
||||
#endif
|
||||
+#if HAVE_HWIB
|
||||
+ ib_hwtype.title = _("InfiniBand");
|
||||
+#endif
|
||||
sVhwinit = 1;
|
||||
}
|
||||
|
||||
--- net-tools-1.60/lib/ib.c.ifconfig_ib 2005-02-09 10:36:26.000000000 +0100
|
||||
+++ net-tools-1.60/lib/ib.c 2005-02-09 10:42:21.000000000 +0100
|
||||
@@ -0,0 +1,147 @@
|
||||
+/*
|
||||
+ * lib/ib.c This file contains an implementation of the "Infiniband"
|
||||
+ * support functions.
|
||||
+ *
|
||||
+ * Version: $Id: ib.c,v 1.1 2005/02/06 11:00:47 tduffy Exp $
|
||||
+ *
|
||||
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
|
||||
+ * Copyright 1993 MicroWalt Corporation
|
||||
+ * Tom Duffy <tduffy@sun.com>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it
|
||||
+ * and/or modify it under the terms of the GNU General
|
||||
+ * Public License as published by the Free Software
|
||||
+ * Foundation; either version 2 of the License, or (at
|
||||
+ * your option) any later version.
|
||||
+ */
|
||||
+#include "config.h"
|
||||
+
|
||||
+#if HAVE_HWIB
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <net/if_arp.h>
|
||||
+/*#include <linux/if_infiniband.h> - not in gcc-kernheaders*/
|
||||
+#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <errno.h>
|
||||
+#include <ctype.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+#include "net-support.h"
|
||||
+#include "pathnames.h"
|
||||
+#include "intl.h"
|
||||
+#include "util.h"
|
||||
+
|
||||
+extern struct hwtype ib_hwtype;
|
||||
+
|
||||
+#define INFINIBAND_ALEN 20
|
||||
+
|
||||
+/* Display an InfiniBand address in readable format. */
|
||||
+static char *pr_ib(unsigned char *ptr)
|
||||
+{
|
||||
+ static char buff[128];
|
||||
+ char *pos;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ pos = buff;
|
||||
+ for (i = 0; i < INFINIBAND_ALEN; i++) {
|
||||
+ pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
|
||||
+ }
|
||||
+ buff[strlen(buff) - 1] = '\0';
|
||||
+
|
||||
+ /* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
+ (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
|
||||
+ (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
|
||||
+ );
|
||||
+ */
|
||||
+ return (buff);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* Input an Infiniband address and convert to binary. */
|
||||
+static int in_ib(char *bufp, struct sockaddr *sap)
|
||||
+{
|
||||
+ unsigned char *ptr;
|
||||
+ char c, *orig;
|
||||
+ int i;
|
||||
+ unsigned val;
|
||||
+
|
||||
+ sap->sa_family = ib_hwtype.type;
|
||||
+ ptr = sap->sa_data;
|
||||
+
|
||||
+ i = 0;
|
||||
+ orig = bufp;
|
||||
+ while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) {
|
||||
+ val = 0;
|
||||
+ c = *bufp++;
|
||||
+ if (isdigit(c))
|
||||
+ val = c - '0';
|
||||
+ else if (c >= 'a' && c <= 'f')
|
||||
+ val = c - 'a' + 10;
|
||||
+ else if (c >= 'A' && c <= 'F')
|
||||
+ val = c - 'A' + 10;
|
||||
+ else {
|
||||
+#ifdef DEBUG
|
||||
+ fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
|
||||
+#endif
|
||||
+ errno = EINVAL;
|
||||
+ return (-1);
|
||||
+ }
|
||||
+ val <<= 4;
|
||||
+ c = *bufp;
|
||||
+ if (isdigit(c))
|
||||
+ val |= c - '0';
|
||||
+ else if (c >= 'a' && c <= 'f')
|
||||
+ val |= c - 'a' + 10;
|
||||
+ else if (c >= 'A' && c <= 'F')
|
||||
+ val |= c - 'A' + 10;
|
||||
+ else if (c == ':' || c == 0)
|
||||
+ val >>= 4;
|
||||
+ else {
|
||||
+#ifdef DEBUG
|
||||
+ fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
|
||||
+#endif
|
||||
+ errno = EINVAL;
|
||||
+ return (-1);
|
||||
+ }
|
||||
+ if (c != 0)
|
||||
+ bufp++;
|
||||
+ *ptr++ = (unsigned char) (val & 0377);
|
||||
+ i++;
|
||||
+
|
||||
+ /* We might get a semicolon here - not required. */
|
||||
+ if (*bufp == ':') {
|
||||
+ if (i == INFINIBAND_ALEN) {
|
||||
+#ifdef DEBUG
|
||||
+ fprintf(stderr, _("in_ib(%s): trailing : ignored!\n"),
|
||||
+ orig)
|
||||
+#endif
|
||||
+ ; /* nothing */
|
||||
+ }
|
||||
+ bufp++;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* That's it. Any trailing junk? */
|
||||
+ if ((i == INFINIBAND_ALEN) && (*bufp != '\0')) {
|
||||
+#ifdef DEBUG
|
||||
+ fprintf(stderr, _("in_ib(%s): trailing junk!\n"), orig);
|
||||
+ errno = EINVAL;
|
||||
+ return (-1);
|
||||
+#endif
|
||||
+ }
|
||||
+#ifdef DEBUG
|
||||
+ fprintf(stderr, "in_ib(%s): %s\n", orig, pr_ib(sap->sa_data));
|
||||
+#endif
|
||||
+
|
||||
+ return (0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+struct hwtype ib_hwtype =
|
||||
+{
|
||||
+ "infiniband", NULL, ARPHRD_INFINIBAND, INFINIBAND_ALEN,
|
||||
+ pr_ib, in_ib, NULL
|
||||
+};
|
||||
+
|
||||
+#endif /* HAVE_HWIB */
|
||||
--- net-tools-1.60/lib/Makefile.ifconfig_ib 2000-10-28 12:59:42.000000000 +0200
|
||||
+++ net-tools-1.60/lib/Makefile 2005-02-09 10:36:26.000000000 +0100
|
||||
@@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
-HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o
|
||||
+HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o ib.o
|
||||
AFOBJS = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o rose.o econet.o x25.o
|
||||
AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o getroute.o x25_gr.o
|
||||
AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o x25_sr.o
|
@ -1,74 +0,0 @@
|
||||
diff -up net-tools-1.60/ifconfig.c.ifdef-vs-if net-tools-1.60/ifconfig.c
|
||||
--- net-tools-1.60/ifconfig.c.ifdef-vs-if 2011-01-03 12:23:14.000000000 +0100
|
||||
+++ net-tools-1.60/ifconfig.c 2011-01-03 12:31:40.000000000 +0100
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <asm/types.h>
|
||||
|
||||
|
||||
-#ifdef HAVE_HWSLIP
|
||||
+#if HAVE_HWSLIP
|
||||
#include <linux/if_slip.h>
|
||||
#endif
|
||||
|
||||
@@ -784,7 +784,7 @@ int main(int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
-#ifdef HAVE_AFINET
|
||||
+#if HAVE_AFINET
|
||||
{ /* ipv4 address a.b.c.d */
|
||||
unsigned long ip, nm, bc;
|
||||
safe_strncpy(host, *spp, (sizeof host));
|
||||
@@ -875,7 +875,7 @@ int main(int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
-#ifdef HAVE_AFINET
|
||||
+#if HAVE_AFINET
|
||||
{
|
||||
/* ipv4 address a.b.c.d */
|
||||
unsigned long ip, nm, bc;
|
||||
diff -up net-tools-1.60/lib/interface.c.ifdef-vs-if net-tools-1.60/lib/interface.c
|
||||
--- net-tools-1.60/lib/interface.c.ifdef-vs-if 2011-01-03 12:23:14.000000000 +0100
|
||||
+++ net-tools-1.60/lib/interface.c 2011-01-03 12:40:57.000000000 +0100
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <neteconet/ec.h>
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE_HWSLIP
|
||||
+#if HAVE_HWSLIP
|
||||
#include <linux/if_slip.h>
|
||||
#include <net/if_arp.h>
|
||||
#endif
|
||||
@@ -482,7 +482,7 @@ int if_fetch(struct interface *ife)
|
||||
else
|
||||
ife->mtu = ifr.ifr_mtu;
|
||||
|
||||
-#ifdef HAVE_HWSLIP
|
||||
+#if HAVE_HWSLIP
|
||||
if (ife->type == ARPHRD_SLIP || ife->type == ARPHRD_CSLIP ||
|
||||
ife->type == ARPHRD_SLIP6 || ife->type == ARPHRD_CSLIP6 ||
|
||||
ife->type == ARPHRD_ADAPT) {
|
||||
@@ -726,8 +726,10 @@ void ife_print_long(struct interface *pt
|
||||
|
||||
hf = ptr->type;
|
||||
|
||||
+#if HAVE_HWSLIP
|
||||
if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6)
|
||||
can_compress = 1;
|
||||
+#endif
|
||||
|
||||
hw = get_hwntype(hf);
|
||||
if (hw == NULL)
|
||||
diff -up net-tools-1.60/lib/net-support.h.ifdef-vs-if net-tools-1.60/lib/net-support.h
|
||||
--- net-tools-1.60/lib/net-support.h.ifdef-vs-if 2000-10-28 12:59:42.000000000 +0200
|
||||
+++ net-tools-1.60/lib/net-support.h 2011-01-03 12:33:21.000000000 +0100
|
||||
@@ -234,7 +234,7 @@ extern char afname[];
|
||||
/* this is a 2.0.36 flag from /usr/src/linux/include/linux/route.h */
|
||||
#define RTF_NOTCACHED 0x0400 /* this route isn't cached */
|
||||
|
||||
-#ifdef HAVE_AFECONET
|
||||
+#if HAVE_AFECONET
|
||||
#ifndef AF_ECONET
|
||||
#define AF_ECONET 19 /* Acorn Econet */
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
--- net-tools-1.60/po/de.po.isofix 2000-10-28 12:59:43.000000000 +0200
|
||||
+++ net-tools-1.60/po/de.po 2005-01-10 11:29:29.407639208 +0100
|
||||
@@ -9,7 +9,7 @@
|
||||
"Last-Translator: Ralf Bächle <ralf@gnu.org>\n"
|
||||
"Language-Team:\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
-"Content-Type: text/plain; charset=iso8859-1\n"
|
||||
+"Content-Type: text/plain; charset=iso-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../arp.c:110 ../arp.c:269
|
||||
--- net-tools-1.60/po/fr.po.isofix 2000-02-20 22:47:00.000000000 +0100
|
||||
+++ net-tools-1.60/po/fr.po 2005-01-10 11:29:23.613520048 +0100
|
||||
@@ -9,7 +9,7 @@
|
||||
"Last-Translator: J.M.Vansteene <vanstee@worldnet.fr>\n"
|
||||
"Language-Team:\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
-"Content-Type: text/plain; charset=iso8859-1\n"
|
||||
+"Content-Type: text/plain; charset=iso-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../arp.c:110 ../arp.c:269
|
||||
--- net-tools-1.60/po/pt_BR.po.isofix 2000-02-20 22:47:06.000000000 +0100
|
||||
+++ net-tools-1.60/po/pt_BR.po 2005-01-10 11:29:16.294632688 +0100
|
||||
@@ -14,7 +14,7 @@
|
||||
"PO-Revision-Date: 1999-03-01 02:38+0100\n"
|
||||
"Last-Translator: Arnaldo Carvalho de Melo <acme@conectiva.com.br>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
-"Content-Type: text/plain; charset=ISO8859-9\n"
|
||||
+"Content-Type: text/plain; charset=iso-8859-9\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../arp.c:110 ../arp.c:269
|
@ -1,12 +0,0 @@
|
||||
diff -up net-tools-1.60/lib/interface.c.large-indexes net-tools-1.60/lib/interface.c
|
||||
--- net-tools-1.60/lib/interface.c.large-indexes 2010-01-02 12:05:13.000000000 +0100
|
||||
+++ net-tools-1.60/lib/interface.c 2010-01-02 12:34:24.000000000 +0100
|
||||
@@ -766,7 +766,7 @@ void ife_print_long(struct interface *pt
|
||||
/* FIXME: should be integrated into interface.c. */
|
||||
|
||||
if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
|
||||
- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
|
||||
+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
|
||||
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
|
||||
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
|
||||
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
|
@ -1,69 +0,0 @@
|
||||
diff -up net-tools-1.60/lib/Makefile.makefile-berlios net-tools-1.60/lib/Makefile
|
||||
--- net-tools-1.60/lib/Makefile.makefile-berlios 2009-09-15 18:07:12.000000000 +0200
|
||||
+++ net-tools-1.60/lib/Makefile 2009-09-15 18:07:12.000000000 +0200
|
||||
@@ -36,7 +36,7 @@ OBJS = $(sort $(VARIA) $(AFOBJS) $(HWOBJ
|
||||
|
||||
# This can be overwritten by the TOPLEVEL Makefile
|
||||
TOPDIR=..
|
||||
-CFLAGS += -I$(TOPDIR) -idirafter $(TOPDIR)/include # -fPIC
|
||||
+CFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include # -fPIC
|
||||
SONAME=libnet-tools.so.0
|
||||
|
||||
.SUFFIXES: .a .so
|
||||
diff -up net-tools-1.60/Makefile.makefile-berlios net-tools-1.60/Makefile
|
||||
--- net-tools-1.60/Makefile.makefile-berlios 2009-09-15 18:07:12.000000000 +0200
|
||||
+++ net-tools-1.60/Makefile 2009-09-15 18:08:25.000000000 +0200
|
||||
@@ -88,10 +88,9 @@ endif
|
||||
|
||||
# Compiler and Linker Options
|
||||
# You may need to uncomment and edit these if you are using libc5 and IPv6.
|
||||
-COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
|
||||
-ifeq ($(origin LOPTS), undefined)
|
||||
-LOPTS =
|
||||
-endif
|
||||
+CFLAGS ?= -O2 -g
|
||||
+CFLAGS += -fno-strict-aliasing # code needs a lot of work before strict aliasing is safe
|
||||
+CPPFLAGS += -D_GNU_SOURCE
|
||||
RESLIB = # -L/usr/inet6/lib -linet6
|
||||
|
||||
ifeq ($(HAVE_AFDECnet),1)
|
||||
@@ -119,8 +118,9 @@ CFLAGS += -DHAVE_SELINUX
|
||||
else
|
||||
endif
|
||||
|
||||
-CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
|
||||
-LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH)
|
||||
+CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH)
|
||||
+LDFLAGS += -L$(NET_LIB_PATH)
|
||||
+
|
||||
|
||||
SUBDIRS = man/ $(NET_LIB_PATH)/
|
||||
|
||||
@@ -131,8 +131,6 @@ LD = $(CC)
|
||||
|
||||
NLIB = -l$(NET_LIB_NAME)
|
||||
|
||||
-MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
|
||||
-
|
||||
%.o: %.c config.h version.h intl.h net-features.h $<
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
@@ -181,14 +179,15 @@ $(NET_LIB): config.h version.h intl.h li
|
||||
|
||||
i18n.h: i18ndir
|
||||
|
||||
-libdir:
|
||||
- @$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES)
|
||||
+libdir: version.h
|
||||
+ @$(MAKE) -C $(NET_LIB_PATH)
|
||||
|
||||
i18ndir:
|
||||
@$(MAKE) -C po
|
||||
|
||||
subdirs:
|
||||
- @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
|
||||
+ @for i in $(SUBDIRS); do $(MAKE) -C $$i || exit $$? ; done
|
||||
+
|
||||
|
||||
ifconfig: $(NET_LIB) ifconfig.o
|
||||
$(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
|
@ -1,13 +0,0 @@
|
||||
--- lib/nstrcmp.c.bak Fri Apr 12 00:15:01 2002
|
||||
+++ lib/nstrcmp.c Fri Apr 12 00:15:29 2002
|
||||
@@ -16,8 +16,8 @@
|
||||
b++;
|
||||
}
|
||||
if (isdigit(*a)) {
|
||||
- if (!isdigit(*b))
|
||||
- return -1;
|
||||
+ if (!isdigit(*b))
|
||||
+ return 1;
|
||||
while (a > astr) {
|
||||
a--;
|
||||
if (!isdigit(*a)) {
|
@ -1,14 +0,0 @@
|
||||
diff -up net-tools-1.60/lib/masq_info.c.masqinfo-raw-ip net-tools-1.60/lib/masq_info.c
|
||||
--- net-tools-1.60/lib/masq_info.c.masqinfo-raw-ip 2000-10-28 12:59:42.000000000 +0200
|
||||
+++ net-tools-1.60/lib/masq_info.c 2009-09-15 17:05:24.000000000 +0200
|
||||
@@ -119,7 +119,9 @@ static int read_masqinfo(FILE * f, struc
|
||||
ms->src.sin_family = AF_INET;
|
||||
ms->dst.sin_family = AF_INET;
|
||||
|
||||
- if (strcmp("TCP", buf) == 0)
|
||||
+ if (strcmp("IP", buf) == 0)
|
||||
+ ms->proto = "ip";
|
||||
+ else if (strcmp("TCP", buf) == 0)
|
||||
ms->proto = "tcp";
|
||||
else if (strcmp("UDP", buf) == 0)
|
||||
ms->proto = "udp";
|
@ -1,240 +0,0 @@
|
||||
diff -up net-tools-1.60/mii-tool.c.mii-gigabit net-tools-1.60/mii-tool.c
|
||||
--- net-tools-1.60/mii-tool.c.mii-gigabit 2010-06-14 15:51:23.000000000 +0200
|
||||
+++ net-tools-1.60/mii-tool.c 2010-06-14 16:10:34.000000000 +0200
|
||||
@@ -57,7 +57,7 @@ static char version[] =
|
||||
#define LPA_ABILITY_MASK 0x07e0
|
||||
|
||||
/* Table of known MII's */
|
||||
-static struct {
|
||||
+static const struct {
|
||||
u_short id1, id2;
|
||||
char *name;
|
||||
} mii_id[] = {
|
||||
@@ -76,6 +76,9 @@ static struct {
|
||||
{ 0x0181, 0x4410, "Quality QS6612" },
|
||||
{ 0x0282, 0x1c50, "SMSC 83C180" },
|
||||
{ 0x0300, 0xe540, "TDK 78Q2120" },
|
||||
+ { 0x0141, 0x0c20, "Yukon 88E1011" },
|
||||
+ { 0x0141, 0x0cc0, "Yukon-EC 88E1111" },
|
||||
+ { 0x0141, 0x0c90, "Yukon-2 88E1112" },
|
||||
};
|
||||
#define NMII (sizeof(mii_id)/sizeof(mii_id[0]))
|
||||
|
||||
@@ -139,40 +142,47 @@ static void mdio_write(int skfd, int loc
|
||||
|
||||
const struct {
|
||||
char *name;
|
||||
- u_short value;
|
||||
+ u_short value[2];
|
||||
} media[] = {
|
||||
/* The order through 100baseT4 matches bits in the BMSR */
|
||||
- { "10baseT-HD", LPA_10HALF },
|
||||
- { "10baseT-FD", LPA_10FULL },
|
||||
- { "100baseTx-HD", LPA_100HALF },
|
||||
- { "100baseTx-FD", LPA_100FULL },
|
||||
- { "100baseT4", LPA_100BASE4 },
|
||||
- { "100baseTx", LPA_100FULL | LPA_100HALF },
|
||||
- { "10baseT", LPA_10FULL | LPA_10HALF },
|
||||
+ { "10baseT-HD", {LPA_10HALF} },
|
||||
+ { "10baseT-FD", {LPA_10FULL} },
|
||||
+ { "100baseTx-HD", {LPA_100HALF} },
|
||||
+ { "100baseTx-FD", {LPA_100FULL} },
|
||||
+ { "100baseT4", {LPA_100BASE4} },
|
||||
+ { "100baseTx", {LPA_100FULL | LPA_100HALF} },
|
||||
+ { "10baseT", {LPA_10FULL | LPA_10HALF} },
|
||||
+ { "1000baseT-HD", {0, ADVERTISE_1000HALF} },
|
||||
+ { "1000baseT-FD", {0, ADVERTISE_1000FULL} },
|
||||
+ { "1000baseT", {0, ADVERTISE_1000HALF|ADVERTISE_1000FULL} },
|
||||
};
|
||||
#define NMEDIA (sizeof(media)/sizeof(media[0]))
|
||||
|
||||
/* Parse an argument list of media types */
|
||||
-static int parse_media(char *arg)
|
||||
+static int parse_media(char *arg, unsigned *bmcr2)
|
||||
{
|
||||
int mask, i;
|
||||
char *s;
|
||||
mask = strtoul(arg, &s, 16);
|
||||
if ((*arg != '\0') && (*s == '\0')) {
|
||||
- if ((mask & LPA_ABILITY_MASK) &&
|
||||
- !(mask & ~LPA_ABILITY_MASK))
|
||||
- return mask;
|
||||
- goto failed;
|
||||
- } else {
|
||||
- mask = 0;
|
||||
- s = strtok(arg, ", ");
|
||||
- do {
|
||||
- for (i = 0; i < NMEDIA; i++)
|
||||
- if (strcasecmp(media[i].name, s) == 0) break;
|
||||
- if (i == NMEDIA) goto failed;
|
||||
- mask |= media[i].value;
|
||||
- } while ((s = strtok(NULL, ", ")) != NULL);
|
||||
- }
|
||||
+ if ((mask & LPA_ABILITY_MASK) &&
|
||||
+ !(mask & ~LPA_ABILITY_MASK)) {
|
||||
+ *bmcr2 = 0;
|
||||
+ return mask;
|
||||
+ }
|
||||
+ goto failed;
|
||||
+ }
|
||||
+ mask = 0;
|
||||
+ *bmcr2 = 0;
|
||||
+ s = strtok(arg, ", ");
|
||||
+ do {
|
||||
+ for (i = 0; i < NMEDIA; i++)
|
||||
+ if (s && strcasecmp(media[i].name, s) == 0) break;
|
||||
+ if (i == NMEDIA) goto failed;
|
||||
+ mask |= media[i].value[0];
|
||||
+ *bmcr2 |= media[i].value[1];
|
||||
+ } while ((s = strtok(NULL, ", ")) != NULL);
|
||||
+
|
||||
return mask;
|
||||
failed:
|
||||
fprintf(stderr, "Invalid media specification '%s'.\n", arg);
|
||||
@@ -181,11 +191,25 @@ failed:
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
|
||||
-static char *media_list(int mask, int best)
|
||||
+static const char *media_list(unsigned mask, unsigned mask2, int best)
|
||||
{
|
||||
static char buf[100];
|
||||
int i;
|
||||
*buf = '\0';
|
||||
+
|
||||
+ if (mask & BMCR_SPEED1000) {
|
||||
+ if (mask2 & ADVERTISE_1000HALF) {
|
||||
+ strcat(buf, " ");
|
||||
+ strcat(buf, "1000baseT-HD");
|
||||
+ if (best) goto out;
|
||||
+ }
|
||||
+ 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)) {
|
||||
@@ -194,6 +218,7 @@ static char *media_list(int mask, int be
|
||||
if (best) break;
|
||||
}
|
||||
}
|
||||
+out:
|
||||
if (mask & (1<<5))
|
||||
strcat(buf, " flow-control");
|
||||
return buf;
|
||||
@@ -203,11 +228,11 @@ int show_basic_mii(int sock, int phy_id)
|
||||
{
|
||||
char buf[100];
|
||||
int i, mii_val[32];
|
||||
- int bmcr, bmsr, advert, lkpar;
|
||||
+ unsigned bmcr, bmsr, advert, lkpar, bmcr2, lpa2;
|
||||
/* Some bits in the BMSR are latched, but we can't rely on being
|
||||
the only reader, so only the current values are meaningful */
|
||||
mdio_read(sock, MII_BMSR);
|
||||
- for (i = 0; i < ((verbose > 1) ? 32 : 8); i++) {
|
||||
+ for (i = 0; i < ((verbose > 1) ? 32 : (MII_STAT1000+1)); i++) {
|
||||
if ((i == MII_BMCR) || (i == MII_BMSR) || (i == MII_PHYSID1) ||
|
||||
(i == MII_PHYSID2) || (i == MII_ADVERTISE) || (i == MII_LPA) ||
|
||||
(i == MII_EXPANSION) || (i == MII_CTRL1000) || (i == MII_STAT1000) ||
|
||||
@@ -220,7 +245,7 @@ int show_basic_mii(int sock, int phy_id)
|
||||
else
|
||||
mii_val[i] = 0;
|
||||
}
|
||||
- if (mii_val[MII_BMCR] == 0xffff) {
|
||||
+ if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
|
||||
fprintf(stderr, " No MII transceiver present!.\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -228,6 +253,7 @@ int show_basic_mii(int sock, int phy_id)
|
||||
/* Descriptive rename. */
|
||||
bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
|
||||
advert = mii_val[MII_ADVERTISE]; lkpar = mii_val[MII_LPA];
|
||||
+ bmcr2 = mii_val[MII_CTRL1000]; lpa2 = mii_val[MII_STAT1000];
|
||||
|
||||
sprintf(buf, "%s: ", ifr.ifr_name);
|
||||
if (bmcr & BMCR_ANENABLE) {
|
||||
@@ -235,7 +261,7 @@ int show_basic_mii(int sock, int phy_id)
|
||||
if (advert & lkpar) {
|
||||
strcat(buf, (lkpar & LPA_LPACK) ?
|
||||
"negotiated" : "no autonegotiation,");
|
||||
- strcat(buf, media_list(advert & lkpar, 1));
|
||||
+ strcat(buf, media_list(advert & lkpar, bmcr2 & lpa2>>2, 1));
|
||||
strcat(buf, ", ");
|
||||
} else {
|
||||
strcat(buf, "autonegotiation failed, ");
|
||||
@@ -245,8 +271,10 @@ int show_basic_mii(int sock, int phy_id)
|
||||
}
|
||||
} else {
|
||||
sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ",
|
||||
- (bmcr & BMCR_SPEED100) ? "100" : "10",
|
||||
- (bmcr & BMCR_FULLDPLX) ? "full" : "half");
|
||||
+ ((bmcr2 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL)) & lpa2 >> 2)
|
||||
+ ? "1000"
|
||||
+ : (bmcr & BMCR_SPEED100) ? "100" : "10",
|
||||
+ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
|
||||
}
|
||||
strcat(buf, (bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
|
||||
|
||||
@@ -307,10 +335,10 @@ int show_basic_mii(int sock, int phy_id)
|
||||
if (bmsr & BMSR_RFAULT)
|
||||
printf("remote fault, ");
|
||||
printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
|
||||
- printf("\n capabilities:%s", media_list(bmsr >> 6, 0));
|
||||
- printf("\n advertising: %s", media_list(advert, 0));
|
||||
+ printf("\n capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
|
||||
+ printf("\n advertising: %s", media_list(advert, lpa2 >> 2, 0));
|
||||
if (lkpar & LPA_ABILITY_MASK)
|
||||
- printf("\n link partner:%s", media_list(lkpar, 0));
|
||||
+ printf("\n link partner:%s", media_list(lkpar, bmcr2, 0));
|
||||
printf("\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
@@ -341,7 +369,7 @@ static int do_one_xcvr(int skfd, char *i
|
||||
printf("resetting the transceiver...\n");
|
||||
mdio_write(skfd, MII_BMCR, BMCR_RESET);
|
||||
}
|
||||
- if (nway_advertise) {
|
||||
+ if (nway_advertise > 0) {
|
||||
mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1);
|
||||
opt_restart = 1;
|
||||
}
|
||||
@@ -400,18 +428,20 @@ usage: %s [-VvRrwl] [-A media,... | -F m
|
||||
-l, --log with -w, write events to syslog\n\
|
||||
-A, --advertise=media,... advertise only specified media\n\
|
||||
-F, --force=media force specified media technology\n\
|
||||
-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\
|
||||
+media: 1000baseTx-HD, 1000baseTx-FD,\n\
|
||||
+ 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\
|
||||
(to advertise both HD and FD) 100baseTx, 10baseT\n";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, c, ret, errflag = 0;
|
||||
char s[6];
|
||||
-
|
||||
+ unsigned ctrl1000 = 0;
|
||||
+
|
||||
while ((c = getopt_long(argc, argv, "A:F:p:lrRvVw?", longopts, 0)) != EOF)
|
||||
switch (c) {
|
||||
- case 'A': nway_advertise = parse_media(optarg); break;
|
||||
- case 'F': fixed_speed = parse_media(optarg); break;
|
||||
+ case 'A': nway_advertise = parse_media(optarg, &ctrl1000); break;
|
||||
+ case 'F': fixed_speed = parse_media(optarg, &ctrl1000); break;
|
||||
case 'p': override_phy = atoi(optarg); break;
|
||||
case 'r': opt_restart++; break;
|
||||
case 'R': opt_reset++; break;
|
||||
@@ -423,6 +453,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
/* Check for a few inappropriate option combinations */
|
||||
if (opt_watch) verbose = 0;
|
||||
+
|
||||
+ if ((nway_advertise < 0) || (fixed_speed < 0))
|
||||
+ return 2;
|
||||
+
|
||||
if (errflag || (fixed_speed & (fixed_speed-1)) ||
|
||||
(fixed_speed && (opt_restart || nway_advertise))) {
|
||||
fprintf(stderr, usage, argv[0]);
|
@ -1,17 +0,0 @@
|
||||
--- net-tools-1.60/include/mii.h.bar Tue Jul 31 11:49:39 2001
|
||||
+++ net-tools-1.60/include/mii.h Tue Jul 31 11:49:33 2001
|
||||
@@ -11,11 +11,9 @@
|
||||
|
||||
/* network interface ioctl's for MII commands */
|
||||
#ifndef SIOCGMIIPHY
|
||||
-#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Read from current PHY */
|
||||
-#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read any PHY register */
|
||||
-#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write any PHY register */
|
||||
-#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters */
|
||||
-#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters */
|
||||
+#define SIOCGMIIPHY 0x8947 /* Read from current PHY */
|
||||
+#define SIOCGMIIREG 0x8948 /* Read any PHY register */
|
||||
+#define SIOCSMIIREG 0x8949 /* Write any PHY register */
|
||||
#endif
|
||||
|
||||
#include <linux/types.h>
|
28
net-tools-1.60-nameif-return.patch
Normal file
28
net-tools-1.60-nameif-return.patch
Normal file
@ -0,0 +1,28 @@
|
||||
--- 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;
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
--- net-tools-1.60/nameif.c.nameif 2000-10-18 19:26:29.000000000 +0200
|
||||
+++ net-tools-1.60/nameif.c 2003-03-19 11:02:01.000000000 +0100
|
||||
@@ -3,7 +3,7 @@
|
||||
* Writen 2000 by Andi Kleen.
|
||||
* Subject to the Gnu Public License, version 2.
|
||||
* TODO: make it support token ring etc.
|
||||
- * $Id: nameif.c,v 1.1 2000/10/18 17:26:29 ak Exp $
|
||||
+ * $Id: nameif.c,v 1.3 2003/03/06 23:26:52 ecki Exp $
|
||||
*/
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
@@ -117,7 +117,8 @@
|
||||
}
|
||||
|
||||
struct change {
|
||||
- struct change *next,**pprev;
|
||||
+ struct change *next;
|
||||
+ int found;
|
||||
char ifname[IFNAMSIZ+1];
|
||||
unsigned char mac[6];
|
||||
};
|
||||
@@ -139,10 +140,7 @@
|
||||
ch->ifname, pos);
|
||||
if (parsemac(p,ch->mac) < 0)
|
||||
complain(_("cannot parse MAC `%s' at %s"), p, pos);
|
||||
- if (clist)
|
||||
- clist->pprev = &ch->next;
|
||||
ch->next = clist;
|
||||
- ch->pprev = &clist;
|
||||
clist = ch;
|
||||
return 0;
|
||||
}
|
||||
@@ -200,7 +198,7 @@
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
- fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}"));
|
||||
+ fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -277,21 +275,21 @@
|
||||
ch = lookupmac(mac);
|
||||
if (!ch)
|
||||
continue;
|
||||
-
|
||||
- *ch->pprev = ch->next;
|
||||
+
|
||||
+ ch->found = 1;
|
||||
if (strcmp(p, ch->ifname)) {
|
||||
if (setname(p, ch->ifname) < 0)
|
||||
complain(_("cannot change name of %s to %s: %s"),
|
||||
p, ch->ifname, strerror(errno));
|
||||
}
|
||||
- free(ch);
|
||||
}
|
||||
fclose(ifh);
|
||||
|
||||
while (clist) {
|
||||
struct change *ch = clist;
|
||||
clist = clist->next;
|
||||
- warning(_("interface '%s' not found"), ch->ifname);
|
||||
+ if (!ch->found)
|
||||
+ warning(_("interface '%s' not found"), ch->ifname);
|
||||
free(ch);
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- net-tools-1.60/lib/fddi.c.netdevice 2000-03-05 12:26:02.000000000 +0100
|
||||
+++ net-tools-1.60/lib/fddi.c 2006-05-09 11:19:51.000000000 +0200
|
||||
@@ -26,6 +26,8 @@
|
||||
#error "No FDDI Support in your current Kernelsource Tree."
|
||||
#error "Disable HW Type FDDI"
|
||||
#endif
|
||||
+#include <linux/netdevice.h>
|
||||
+#include <asm/byteorder.h>
|
||||
#if __GLIBC__ >= 2
|
||||
#include <netinet/if_fddi.h>
|
||||
#else
|
||||
--- net-tools-1.60/lib/x25_sr.c.netdevice 2000-05-20 15:38:10.000000000 +0200
|
||||
+++ net-tools-1.60/lib/x25_sr.c 2006-05-09 11:20:15.000000000 +0200
|
||||
@@ -77,7 +77,7 @@
|
||||
rt.sigdigits=sigdigits;
|
||||
|
||||
/* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
|
||||
- memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
|
||||
+ memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
|
||||
|
||||
while (*args) {
|
||||
if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
|
@ -1,61 +0,0 @@
|
||||
--- net-tools-1.60/ifconfig.c.netmask 2001-04-13 20:25:18.000000000 +0200
|
||||
+++ net-tools-1.60/ifconfig.c 2004-11-02 15:31:56.454594456 +0100
|
||||
@@ -23,6 +23,7 @@
|
||||
* 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
|
||||
* (default AF was wrong)
|
||||
* 20010404 - Arnaldo Carvalho de Melo, use setlocale
|
||||
+ * 20040831 - Florin Malita <fmalita@glenayre.com> delayed CIDR netmask
|
||||
*/
|
||||
|
||||
#define DFLT_AF "inet"
|
||||
@@ -227,13 +228,13 @@
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
- struct sockaddr sa;
|
||||
+ struct sockaddr sa, sa_netmask;
|
||||
struct sockaddr_in sin;
|
||||
char host[128];
|
||||
struct aftype *ap;
|
||||
struct hwtype *hw;
|
||||
struct ifreq ifr;
|
||||
- int goterr = 0, didnetmask = 0;
|
||||
+ int goterr = 0, didnetmask = 0, donetmask = 0;
|
||||
char **spp;
|
||||
int fd;
|
||||
#if HAVE_AFINET6
|
||||
@@ -903,16 +904,16 @@
|
||||
/* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
|
||||
broadcast is unexpected */
|
||||
if (ap->getmask) {
|
||||
- switch (ap->getmask(host, &sa, NULL)) {
|
||||
+ switch (ap->getmask(host, &sa_netmask, NULL)) {
|
||||
case -1:
|
||||
usage();
|
||||
break;
|
||||
case 1:
|
||||
if (didnetmask)
|
||||
usage();
|
||||
-
|
||||
- goterr = set_netmask(skfd, &ifr, &sa);
|
||||
- didnetmask++;
|
||||
+
|
||||
+ /* delay setting the CIDR netmask till after setting the addr */
|
||||
+ donetmask = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -960,6 +961,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ /* set CIDR netmask */
|
||||
+ if (donetmask) {
|
||||
+ donetmask = 0;
|
||||
+ goterr = set_netmask(skfd, &ifr, &sa_netmask);
|
||||
+ didnetmask++;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Don't do the set_flag() if the address is an alias with a - at the
|
||||
* end, since it's deleted already! - Roman
|
@ -1,10 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.old 2006-10-02 12:03:49.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2006-10-02 12:02:12.000000000 +0200
|
||||
@@ -2233,6 +2233,7 @@ int main
|
||||
break;
|
||||
case 'I':
|
||||
if (optarg && strcmp(optarg, "(null)"))
|
||||
+ if (optarg[0] == '=') optarg++;
|
||||
flag_int_name = strdup(optarg);
|
||||
flag_int++;
|
||||
break;
|
@ -1,25 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.old 2007-03-27 09:28:28.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2007-03-27 09:26:39.000000000 +0200
|
||||
@@ -2105,7 +2105,7 @@
|
||||
fprintf(stderr, _(" netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
|
||||
|
||||
fprintf(stderr, _(" -r, --route display routing table\n"));
|
||||
- fprintf(stderr, _(" -I, --interfaces=[<Iface>] display interface table for <Iface>\n"));
|
||||
+ fprintf(stderr, _(" -I, --interface=[<Iface>] display interface table for <Iface>\n"));
|
||||
fprintf(stderr, _(" -i, --interfaces display interface table\n"));
|
||||
fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
|
||||
fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
|
||||
@@ -2234,7 +2234,12 @@
|
||||
case 'I':
|
||||
if (optarg && strcmp(optarg, "(null)"))
|
||||
if (optarg[0] == '=') optarg++;
|
||||
- flag_int_name = strdup(optarg);
|
||||
+ if (optarg && strcmp(optarg, "(null)"))
|
||||
+ flag_int_name = strdup(optarg);
|
||||
+ else {
|
||||
+ usage();
|
||||
+ exit(1);
|
||||
+ }
|
||||
flag_int++;
|
||||
break;
|
||||
case 'i':
|
@ -1,186 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.inode 2006-02-23 09:28:23.000000000 +0100
|
||||
+++ net-tools-1.60/netstat.c 2006-02-23 09:33:57.000000000 +0100
|
||||
@@ -231,7 +231,7 @@
|
||||
|
||||
static struct prg_node {
|
||||
struct prg_node *next;
|
||||
- int inode;
|
||||
+ unsigned long inode;
|
||||
char name[PROGNAME_WIDTH];
|
||||
char scon[SELINUX_WIDTH];
|
||||
} *prg_hash[PRG_HASH_SIZE];
|
||||
@@ -268,7 +268,7 @@
|
||||
/* NOT working as of glibc-2.0.7: */
|
||||
#undef DIRENT_HAVE_D_TYPE_WORKS
|
||||
|
||||
-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);
|
||||
struct prg_node **pnp,*pn;
|
||||
@@ -332,15 +332,16 @@
|
||||
prg_cache_loaded=0;
|
||||
}
|
||||
|
||||
-static void extract_type_1_socket_inode(const char lname[], long * inode_p) {
|
||||
+static void extract_type_1_socket_inode(const char lname[], unsigned long * inode_p, int * status) {
|
||||
|
||||
/* If lname is of the form "socket:[12345]", extract the "12345"
|
||||
- as *inode_p. Otherwise, return -1 as *inode_p.
|
||||
+ as *inode_p. Otherwise, return -1 as *status.
|
||||
*/
|
||||
|
||||
- if (strlen(lname) < PRG_SOCKET_PFXl+3) *inode_p = -1;
|
||||
- else if (memcmp(lname, PRG_SOCKET_PFX, PRG_SOCKET_PFXl)) *inode_p = -1;
|
||||
- else if (lname[strlen(lname)-1] != ']') *inode_p = -1;
|
||||
+ *status = 0;
|
||||
+ if (strlen(lname) < PRG_SOCKET_PFXl+3) *status = -1;
|
||||
+ else if (memcmp(lname, PRG_SOCKET_PFX, PRG_SOCKET_PFXl)) *status = -1;
|
||||
+ else if (lname[strlen(lname)-1] != ']') *status = -1;
|
||||
else {
|
||||
char inode_str[strlen(lname + 1)]; /* e.g. "12345" */
|
||||
const int inode_str_len = strlen(lname) - PRG_SOCKET_PFXl - 1;
|
||||
@@ -348,28 +349,30 @@
|
||||
|
||||
strncpy(inode_str, lname+PRG_SOCKET_PFXl, inode_str_len);
|
||||
inode_str[inode_str_len] = '\0';
|
||||
- *inode_p = strtol(inode_str,&serr,0);
|
||||
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
|
||||
- *inode_p = -1;
|
||||
+ errno = 0;
|
||||
+ *inode_p = strtoul(inode_str,&serr,0);
|
||||
+ if (!serr || *serr || errno)
|
||||
+ *status = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
-static void extract_type_2_socket_inode(const char lname[], long * inode_p) {
|
||||
+static void extract_type_2_socket_inode(const char lname[], unsigned long * inode_p, int * status) {
|
||||
|
||||
/* If lname is of the form "[0000]:12345", extract the "12345"
|
||||
- as *inode_p. Otherwise, return -1 as *inode_p.
|
||||
+ as *inode_p. Otherwise, return -1 as *status.
|
||||
*/
|
||||
|
||||
- if (strlen(lname) < PRG_SOCKET_PFX2l+1) *inode_p = -1;
|
||||
- else if (memcmp(lname, PRG_SOCKET_PFX2, PRG_SOCKET_PFX2l)) *inode_p = -1;
|
||||
+ if (strlen(lname) < PRG_SOCKET_PFX2l+1) *status = -1;
|
||||
+ else if (memcmp(lname, PRG_SOCKET_PFX2, PRG_SOCKET_PFX2l)) *status = -1;
|
||||
else {
|
||||
char *serr;
|
||||
|
||||
- *inode_p=strtol(lname + PRG_SOCKET_PFX2l,&serr,0);
|
||||
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
|
||||
- *inode_p = -1;
|
||||
+ errno = 0;
|
||||
+ *inode_p=strtoul(lname + PRG_SOCKET_PFX2l,&serr,0);
|
||||
+ if (!serr || *serr || errno)
|
||||
+ *status = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,11 +383,12 @@
|
||||
char line[LINE_MAX],eacces=0;
|
||||
int procfdlen,fd,cmdllen,lnamelen;
|
||||
char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH];
|
||||
- long inode;
|
||||
+ unsigned long inode;
|
||||
const char *cs,*cmdlp;
|
||||
DIR *dirproc=NULL,*dirfd=NULL;
|
||||
struct dirent *direproc,*direfd;
|
||||
security_context_t scon=NULL;
|
||||
+ int status;
|
||||
|
||||
if (prg_cache_loaded || !flag_prg) return;
|
||||
prg_cache_loaded=1;
|
||||
@@ -424,11 +428,11 @@
|
||||
lnamelen=readlink(line,lname,sizeof(lname)-1);
|
||||
lname[lnamelen] = '\0'; /*make it a null-terminated string*/
|
||||
|
||||
- extract_type_1_socket_inode(lname, &inode);
|
||||
+ extract_type_1_socket_inode(lname, &inode, &status);
|
||||
|
||||
- if (inode < 0) extract_type_2_socket_inode(lname, &inode);
|
||||
+ if (status < 0) extract_type_2_socket_inode(lname, &inode, &status);
|
||||
|
||||
- if (inode < 0) continue;
|
||||
+ if (status < 0) continue;
|
||||
|
||||
if (!cmdlp) {
|
||||
if (procfdlen - PATH_FD_SUFFl + PATH_CMDLINEl >=
|
||||
@@ -732,7 +736,7 @@
|
||||
printf("%-10s ", pw->pw_name);
|
||||
else
|
||||
printf("%-10d ", uid);
|
||||
- printf("%-10ld ",inode);
|
||||
+ printf("%-10lu ",inode);
|
||||
}
|
||||
if (flag_prg)
|
||||
printf("%-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
|
||||
@@ -921,7 +925,7 @@
|
||||
return;
|
||||
|
||||
num = sscanf(line,
|
||||
- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %ld %512s\n",
|
||||
+ "%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, local_addr, &local_port, rem_addr, &rem_port, &state,
|
||||
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
|
||||
|
||||
@@ -1064,7 +1068,7 @@
|
||||
|
||||
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 %ld %512s\n",
|
||||
+ "%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, local_addr, &local_port,
|
||||
rem_addr, &rem_port, &state,
|
||||
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
|
||||
@@ -1206,7 +1210,7 @@
|
||||
|
||||
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 %ld %512s\n",
|
||||
+ "%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, local_addr, &local_port, rem_addr, &rem_port, &state,
|
||||
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
|
||||
|
||||
@@ -1320,9 +1324,9 @@
|
||||
static int has = 0;
|
||||
char path[MAXPATHLEN], ss_flags[32];
|
||||
char *ss_proto, *ss_state, *ss_type;
|
||||
- int num, state, type, inode;
|
||||
+ int num, state, type;
|
||||
void *d;
|
||||
- unsigned long refcnt, proto, flags;
|
||||
+ unsigned long refcnt, proto, flags, inode;
|
||||
|
||||
if (nr == 0) {
|
||||
if (strstr(line, "Inode"))
|
||||
@@ -1330,14 +1334,14 @@
|
||||
return;
|
||||
}
|
||||
path[0] = '\0';
|
||||
- num = sscanf(line, "%p: %lX %lX %lX %X %X %d %s",
|
||||
+ num = sscanf(line, "%p: %lX %lX %lX %X %X %lu %s",
|
||||
&d, &refcnt, &proto, &flags, &type, &state, &inode, path);
|
||||
if (num < 6) {
|
||||
fprintf(stderr, _("warning, got bogus unix line.\n"));
|
||||
return;
|
||||
}
|
||||
if (!(has & HAS_INODE))
|
||||
- snprintf(path,sizeof(path),"%d",inode);
|
||||
+ snprintf(path,sizeof(path),"%lu",inode);
|
||||
|
||||
if (!flag_all) {
|
||||
if ((state == SS_UNCONNECTED) && (flags & SO_ACCEPTCON)) {
|
||||
@@ -1429,7 +1433,7 @@
|
||||
printf("%-5s %-6ld %-11s %-10s %-13s ",
|
||||
ss_proto, refcnt, ss_flags, ss_type, ss_state);
|
||||
if (has & HAS_INODE)
|
||||
- printf("%-6d ",inode);
|
||||
+ printf("%-6lu ",inode);
|
||||
else
|
||||
printf("- ");
|
||||
if (flag_prg)
|
@ -1,143 +0,0 @@
|
||||
diff -up net-tools-1.60/man/en_US/netstat.8.trim net-tools-1.60/man/en_US/netstat.8
|
||||
--- net-tools-1.60/man/en_US/netstat.8.trim 2011-08-24 13:56:54.303033055 +0200
|
||||
+++ net-tools-1.60/man/en_US/netstat.8 2011-08-24 13:56:54.475030422 +0200
|
||||
@@ -185,6 +185,10 @@ option, show interfaces that are not mar
|
||||
Print routing information from the FIB. (This is the default.)
|
||||
.SS "\-C"
|
||||
Print routing information from the route cache.
|
||||
+.SS "\-Z \-\-context"
|
||||
+If SELinux enabled print SELinux context.
|
||||
+.SS "\-T \-\-notrim"
|
||||
+Stop trimming long addresses.
|
||||
.SS delay
|
||||
Netstat will cycle printing through statistics every
|
||||
.B delay
|
||||
diff -up net-tools-1.60/netstat.c.trim net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.trim 2011-08-24 13:56:54.472030469 +0200
|
||||
+++ net-tools-1.60/netstat.c 2011-08-24 13:56:54.477030390 +0200
|
||||
@@ -157,6 +157,9 @@ int flag_prg = 0;
|
||||
int flag_arg = 0;
|
||||
int flag_ver = 0;
|
||||
int flag_selinux = 0;
|
||||
+int flag_trim = 0;
|
||||
+
|
||||
+
|
||||
|
||||
FILE *procinfo;
|
||||
|
||||
@@ -983,16 +986,20 @@ static void tcp_do_one(int lnr, const ch
|
||||
get_sname(htons(local_port), "tcp",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
|
||||
- if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
- local_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
+ local_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+ }
|
||||
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
|
||||
-
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
- rem_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
+ rem_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+ }
|
||||
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
@@ -1133,8 +1140,10 @@ static void udp_do_one(int lnr, const ch
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(local_port), "udp",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
- if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
- local_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
+ local_addr[27 - strlen(buffer)] = '\0';
|
||||
+ }
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
|
||||
@@ -1142,8 +1151,10 @@ static void udp_do_one(int lnr, const ch
|
||||
get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
|
||||
flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
- rem_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
+ rem_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+ }
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
|
||||
@@ -1252,8 +1263,10 @@ static void raw_do_one(int lnr, const ch
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
|
||||
flag_not & FLAG_NUM_HOST), sizeof(local_addr));
|
||||
- if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
- local_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
+ local_addr[27 - strlen(buffer)] = '\0';
|
||||
+ }
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
|
||||
@@ -1261,8 +1274,10 @@ static void raw_do_one(int lnr, const ch
|
||||
get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
|
||||
flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
- rem_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if (!flag_trim) {
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
+ rem_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
+ }
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
|
||||
@@ -1723,7 +1738,8 @@ static void usage(void)
|
||||
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, _(" -C, --cache display routing cache instead of FIB\n"));
|
||||
+ fprintf(stderr, _(" -T, --notrim stop trimming long addresses\n"));
|
||||
fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n\n"));
|
||||
|
||||
fprintf(stderr, _(" <Iface>: Name of interface to monitor/list.\n"));
|
||||
@@ -1773,6 +1789,7 @@ int main
|
||||
{"fib", 0, 0, 'F'},
|
||||
{"groups", 0, 0, 'g'},
|
||||
{"context", 0, 0, 'Z'},
|
||||
+ {"notrim", 0, 0, 'T'},
|
||||
{NULL, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -1785,7 +1802,7 @@ int main
|
||||
|
||||
afname[0] = '\0';
|
||||
|
||||
- while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZ", longopts, &lop)) != EOF)
|
||||
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphiI::nNorstuVv?wxlZT", longopts, &lop)) != EOF)
|
||||
switch (i) {
|
||||
case -1:
|
||||
break;
|
||||
@@ -1901,6 +1918,10 @@ int main
|
||||
usage();
|
||||
case 's':
|
||||
flag_sta++;
|
||||
+ break;
|
||||
+ case 'T':
|
||||
+ flag_trim++;
|
||||
+ break;
|
||||
}
|
||||
|
||||
if(argc == optind + 1) {
|
@ -1,11 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.netstat_ulong 2004-11-11 14:28:44.000000000 +0100
|
||||
+++ net-tools-1.60/netstat.c 2004-11-11 14:31:14.099313000 +0100
|
||||
@@ -273,7 +273,7 @@
|
||||
strcpy(pn->name,name);
|
||||
}
|
||||
|
||||
-static const char *prg_cache_get(int inode)
|
||||
+static const char *prg_cache_get(unsigned long inode)
|
||||
{
|
||||
unsigned hi=PRG_HASHIT(inode);
|
||||
struct prg_node *pn;
|
@ -1,13 +0,0 @@
|
||||
--- net-tools-1.60/man/en_US/hostname.1.note 2004-11-24 12:09:28.000000000 +0100
|
||||
+++ net-tools-1.60/man/en_US/hostname.1 2004-11-24 12:16:41.121050760 +0100
|
||||
@@ -191,6 +191,10 @@
|
||||
) then root can also set a new NIS domain.
|
||||
.SH FILES
|
||||
.B /etc/hosts
|
||||
+.B /etc/sysconfig/network
|
||||
+.SH NOTE
|
||||
+Note that hostname doesn't change anything permanently. After reboot
|
||||
+original names from \fI/etc/hosts\fR are used again.
|
||||
.SH AUTHOR
|
||||
Peter Tobias, <tobias@et-inf.fho-emden.de>
|
||||
.br
|
@ -1,113 +0,0 @@
|
||||
diff -up net-tools-1.60/netstat.c.num-ports net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.num-ports 2011-10-21 17:40:53.632829074 +0200
|
||||
+++ net-tools-1.60/netstat.c 2011-10-21 17:43:39.448756090 +0200
|
||||
@@ -600,7 +600,7 @@ static void igmp_do_one(int lnr, const c
|
||||
return;
|
||||
}
|
||||
safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
|
||||
- flag_not), sizeof(mcast_addr));
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(mcast_addr));
|
||||
printf("%-15s %-6d %s\n", device, refcnt, mcast_addr);
|
||||
#endif
|
||||
} else { /* IPV4 */
|
||||
@@ -638,7 +638,7 @@ static void igmp_do_one(int lnr, const c
|
||||
return;
|
||||
}
|
||||
safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
|
||||
- flag_not), sizeof(mcast_addr));
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(mcast_addr));
|
||||
printf("%-15s %-6d %s\n", device, refcnt, mcast_addr );
|
||||
#endif
|
||||
} /* IPV4 */
|
||||
@@ -765,8 +765,8 @@ static void tcp_do_one(int lnr, const ch
|
||||
txq = 0L;
|
||||
}
|
||||
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
|
||||
- flag_not), sizeof(local_addr));
|
||||
- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
|
||||
+ safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST),
|
||||
sizeof(rem_addr));
|
||||
if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
@@ -919,11 +919,11 @@ static void udp_do_one(int lnr, const ch
|
||||
if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
|
||||
{
|
||||
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
|
||||
- flag_not), sizeof(local_addr));
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(local_port), "udp",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
- if ((strlen(local_addr) + strlen(buffer)) > 22)
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
local_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
@@ -931,8 +931,8 @@ static void udp_do_one(int lnr, const ch
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
|
||||
- flag_not), sizeof(rem_addr));
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
rem_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
@@ -954,7 +954,7 @@ static void udp_do_one(int lnr, const ch
|
||||
retr, timeout);
|
||||
break;
|
||||
}
|
||||
- printf("udp %6ld %6ld %-23s %-23s %-12s",
|
||||
+ printf("udp %6ld %6ld %-27s %-27s %-12s",
|
||||
rxq, txq, local_addr, rem_addr, udp_state);
|
||||
|
||||
finish_this_one(uid,inode,timers);
|
||||
@@ -1041,8 +1041,8 @@ static void raw_do_one(int lnr, const ch
|
||||
get_sname(htons(local_port), "raw",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
|
||||
- flag_not), sizeof(local_addr));
|
||||
- if ((strlen(local_addr) + strlen(buffer)) > 22)
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
local_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
@@ -1050,8 +1050,8 @@ static void raw_do_one(int lnr, const ch
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
|
||||
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
|
||||
- flag_not), sizeof(rem_addr));
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
|
||||
+ flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
rem_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
@@ -1075,7 +1075,7 @@ static void raw_do_one(int lnr, const ch
|
||||
retr, timeout);
|
||||
break;
|
||||
}
|
||||
- printf("raw %6ld %6ld %-23s %-23s %-12d",
|
||||
+ printf("raw %6ld %6ld %-27s %-27s %-12d",
|
||||
rxq, txq, local_addr, rem_addr, state);
|
||||
|
||||
finish_this_one(uid,inode,timers);
|
||||
@@ -1414,13 +1414,13 @@ static int ipx_info(void)
|
||||
|
||||
/* Fetch and resolve the Source */
|
||||
(void) ap->input(0, sad, &sa);
|
||||
- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
|
||||
+ safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
|
||||
snprintf(sad, sizeof(sad), "%s:%04X", buf, sport);
|
||||
|
||||
if (!nc) {
|
||||
/* Fetch and resolve the Destination */
|
||||
(void) ap->input(0, dad, &sa);
|
||||
- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
|
||||
+ safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
|
||||
snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
|
||||
} else
|
||||
strcpy(dad, "-");
|
@ -1,57 +0,0 @@
|
||||
diff -up net-tools-1.60/netstat.c.overflow net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.overflow 2010-01-02 10:45:45.000000000 +0100
|
||||
+++ net-tools-1.60/netstat.c 2010-01-02 10:50:50.000000000 +0100
|
||||
@@ -777,7 +777,7 @@ static void tcp_do_one(int lnr, const ch
|
||||
local_addr[22 - strlen(buffer)] = '\0';
|
||||
|
||||
strcat(local_addr, ":");
|
||||
- strcat(local_addr, buffer);
|
||||
+ strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
|
||||
|
||||
@@ -785,7 +785,7 @@ static void tcp_do_one(int lnr, const ch
|
||||
rem_addr[22 - strlen(buffer)] = '\0';
|
||||
|
||||
strcat(rem_addr, ":");
|
||||
- strcat(rem_addr, buffer);
|
||||
+ strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
timers[0] = '\0';
|
||||
|
||||
if (flag_opt)
|
||||
@@ -926,7 +926,7 @@ static void udp_do_one(int lnr, const ch
|
||||
if ((strlen(local_addr) + strlen(buffer)) > 22)
|
||||
local_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(local_addr, ":");
|
||||
- strcat(local_addr, buffer);
|
||||
+ strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
|
||||
@@ -935,7 +935,7 @@ static void udp_do_one(int lnr, const ch
|
||||
if ((strlen(rem_addr) + strlen(buffer)) > 22)
|
||||
rem_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(rem_addr, ":");
|
||||
- strcat(rem_addr, buffer);
|
||||
+ strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
|
||||
timers[0] = '\0';
|
||||
if (flag_opt)
|
||||
@@ -1045,7 +1045,7 @@ static void raw_do_one(int lnr, const ch
|
||||
if ((strlen(local_addr) + strlen(buffer)) > 22)
|
||||
local_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(local_addr, ":");
|
||||
- strcat(local_addr, buffer);
|
||||
+ strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
|
||||
@@ -1054,7 +1054,7 @@ static void raw_do_one(int lnr, const ch
|
||||
if ((strlen(rem_addr) + strlen(buffer)) > 22)
|
||||
rem_addr[22 - strlen(buffer)] = '\0';
|
||||
strcat(rem_addr, ":");
|
||||
- strcat(rem_addr, buffer);
|
||||
+ strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
|
||||
timers[0] = '\0';
|
||||
if (flag_opt)
|
@ -1,70 +0,0 @@
|
||||
--- net-tools-1.60/statistics.c.parse 2004-09-06 10:45:35.595130240 +0200
|
||||
+++ net-tools-1.60/statistics.c 2004-09-06 10:43:11.000000000 +0200
|
||||
@@ -289,7 +289,7 @@
|
||||
return &dummytab;
|
||||
}
|
||||
|
||||
-void process_fd(FILE *f)
|
||||
+void process_fd(FILE *f,int file_desc) // added file_desc to show propriate error mesg
|
||||
{
|
||||
char buf1[1024], buf2[1024];
|
||||
char *sp, *np, *p;
|
||||
@@ -297,12 +297,16 @@
|
||||
int endflag;
|
||||
struct tabtab *tab;
|
||||
|
||||
+ if (strcmp(buf1,"\n") == 0) // cut leading break
|
||||
+ if (!fgets(buf1, sizeof buf1, f))
|
||||
+ break;
|
||||
if (!fgets(buf2, sizeof buf2, f))
|
||||
break;
|
||||
+
|
||||
sp = strchr(buf1, ':');
|
||||
- np = strchr(buf2, ':');
|
||||
- if (!np || !sp)
|
||||
- goto formaterr;
|
||||
+ np = strchr(buf2, ':');
|
||||
+ if (!np || !sp)
|
||||
+ goto formaterr;
|
||||
*sp = '\0';
|
||||
|
||||
tab = newtable(snmptabs, buf1);
|
||||
@@ -333,7 +337,12 @@
|
||||
return;
|
||||
|
||||
formaterr:
|
||||
- perror(_("error parsing /proc/net/snmp"));
|
||||
+ switch(file_desc) {
|
||||
+ case 0: perror(_("error parsing /proc/net/snmp"));
|
||||
+ break;
|
||||
+ case 1: perror(_("error parsing /proc/net/netstat"));
|
||||
+ break;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -343,13 +352,13 @@
|
||||
FILE *f;
|
||||
|
||||
f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
|
||||
-
|
||||
+
|
||||
f = fopen("/proc/net/snmp", "r");
|
||||
if (!f) {
|
||||
perror(_("cannot open /proc/net/snmp"));
|
||||
return(1);
|
||||
}
|
||||
- process_fd(f);
|
||||
+ process_fd(f,0);
|
||||
|
||||
if (ferror(f)) {
|
||||
perror("/proc/net/snmp");
|
||||
@@ -361,7 +370,7 @@
|
||||
f = fopen("/proc/net/netstat", "r");
|
||||
|
||||
if (f) {
|
||||
- process_fd(f);
|
||||
+ process_fd(f,1);
|
||||
|
||||
if (ferror(f)) {
|
||||
perror("/proc/net/netstat");
|
@ -1,13 +0,0 @@
|
||||
--- net-tools-1.60/Makefile.pie 2001-04-15 16:34:31.000000000 +0200
|
||||
+++ net-tools-1.60/Makefile 2005-02-28 12:41:15.337127680 +0100
|
||||
@@ -113,8 +113,8 @@
|
||||
|
||||
NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
|
||||
|
||||
-CFLAGS = $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
|
||||
-LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
|
||||
+CFLAGS += $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
|
||||
+LDFLAGS += $(LOPTS) -L$(NET_LIB_PATH)
|
||||
|
||||
SUBDIRS = man/ $(NET_LIB_PATH)/
|
||||
|
@ -1,24 +0,0 @@
|
||||
--- net-tools-1.60/man/en_US/hostname.1.old 2007-03-15 13:45:55.000000000 +0100
|
||||
+++ net-tools-1.60/man/en_US/hostname.1 2007-03-15 13:49:12.000000000 +0100
|
||||
@@ -28,8 +28,6 @@
|
||||
.RB [ \-y ]
|
||||
.RB [ \-\-yp ]
|
||||
.RB [ \-\-nis ]
|
||||
-.RB [ \-n ]
|
||||
-.RB [ \-\-node ]
|
||||
|
||||
.PP
|
||||
.B hostname
|
||||
--- net-tools-1.60/hostname.c.old 2007-03-15 13:45:55.000000000 +0100
|
||||
+++ net-tools-1.60/hostname.c 2007-03-15 13:47:27.000000000 +0100
|
||||
@@ -234,8 +234,9 @@
|
||||
fprintf(stderr, _(" domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n"));
|
||||
#if HAVE_AFDECnet
|
||||
fprintf(stderr, _(" nodename [-v] {nodename|-F file} set DECnet node name (from file)\n"));
|
||||
+ fprintf(stderr, _(" hostname [-n] DECnet domain name\n"));
|
||||
#endif
|
||||
- fprintf(stderr, _(" hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name\n"));
|
||||
+ fprintf(stderr, _(" hostname [-v] [-d|-f|-s|-a|-i|-y] display formatted name\n"));
|
||||
fprintf(stderr, _(" hostname [-v] display hostname\n\n"));
|
||||
fprintf(stderr, _(" hostname -V|--version|-h|--help print info and exit\n\n"));
|
||||
fprintf(stderr, _(" dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n"));
|
@ -1,346 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.sctp-addrs 2008-06-18 14:41:29.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2008-06-18 14:12:03.000000000 +0200
|
||||
@@ -1299,23 +1299,21 @@ static void sctp_eps_do_one(int lnr, cha
|
||||
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*/
|
||||
+ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */
|
||||
return;
|
||||
}
|
||||
|
||||
- strtok(line," \t\n"); /*skip ptr*/
|
||||
- strtok(0," \t\n"); /*skip ptr*/
|
||||
+ strtok(line," \t\n"); /*skip endpt*/
|
||||
+ strtok(0," \t\n"); /*skip sock*/
|
||||
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);
|
||||
@@ -1323,61 +1321,35 @@ static void sctp_eps_do_one(int lnr, cha
|
||||
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;
|
||||
- }
|
||||
+ 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("%-55s", buffer);
|
||||
+ printf(" %-12s", first?sctp_socket_state_str(state):"");
|
||||
+ first = 0;
|
||||
}
|
||||
-
|
||||
finish_this_one(uid,inode,"");
|
||||
}
|
||||
|
||||
@@ -1403,32 +1375,29 @@ static void sctp_assoc_do_one(int lnr, c
|
||||
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*/
|
||||
+ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */
|
||||
return;
|
||||
}
|
||||
-
|
||||
- strtok(line," \t\n"); /*skip ptr*/
|
||||
- strtok(0," \t\n"); /*skip ptr*/
|
||||
+
|
||||
+ strtok(line," \t\n"); /*skip assoc*/
|
||||
+ strtok(0," \t\n"); /*skip sock*/
|
||||
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*/
|
||||
+ strtok(0," \t\n"); /*skip hash assoc-id*/
|
||||
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");
|
||||
+ laddrs_str = strtok(0,"<->\t\n");
|
||||
+ raddrs_str = strtok(0,"<->\t\n");
|
||||
|
||||
type = atoi(sty_str);
|
||||
state = atoi(sst_str);
|
||||
@@ -1439,116 +1408,81 @@ static void sctp_assoc_do_one(int lnr, c
|
||||
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);
|
||||
+ /*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) {
|
||||
+ if (this_local_addr[0] == '*') {
|
||||
+ /* skip * */
|
||||
+ 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(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);
|
||||
+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
|
||||
+ }
|
||||
+ if(this_remote_addr) {
|
||||
+ if (this_remote_addr[0] == '*') {
|
||||
+ /* skip * */
|
||||
+ 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(buffer,"%s", remote_addr);
|
||||
- printf("%-23s", buffer);
|
||||
- } else
|
||||
- printf("%-23s", "");
|
||||
-
|
||||
- printf(" %-12s", first?sctp_socket_state_str(state):"");
|
||||
+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
|
||||
+ }
|
||||
|
||||
- first = 0;
|
||||
- this_local_addr=strtok_r(0," \t\n",&ss1);
|
||||
- this_remote_addr=strtok_r(0," \t\n",&ss2);
|
||||
- }
|
||||
+ 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("%-27s", buffer);
|
||||
+ } else
|
||||
+ printf("%-27s", "");
|
||||
+ printf(" ");
|
||||
+ if(this_remote_addr) {
|
||||
+ if(first)
|
||||
+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
|
||||
+ else
|
||||
+ sprintf(buffer,"%s", remote_addr);
|
||||
+ printf("%-27s", buffer);
|
||||
+ } else
|
||||
+ printf("%-27s", "");
|
||||
+
|
||||
+ 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,"");
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.old 2007-02-22 14:39:39.000000000 +0100
|
||||
+++ net-tools-1.60/netstat.c 2007-02-22 14:44:22.000000000 +0100
|
||||
@@ -2325,7 +2325,7 @@
|
||||
usage();
|
||||
|
||||
if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
|
||||
- flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
|
||||
+ flag_tcp = flag_udp = flag_raw = 1;
|
||||
|
||||
if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
|
||||
flag_inet = flag_inet6 = 1;
|
127
net-tools-1.60-sctp-statistics.patch
Normal file
127
net-tools-1.60-sctp-statistics.patch
Normal file
@ -0,0 +1,127 @@
|
||||
diff -up net-tools-1.60/netstat.c.sctp net-tools-1.60/netstat.c
|
||||
--- net-tools-1.60/netstat.c.sctp 2011-12-06 16:28:09.726243816 +0100
|
||||
+++ net-tools-1.60/netstat.c 2011-12-06 16:28:09.769243277 +0100
|
||||
@@ -112,7 +112,7 @@
|
||||
#endif
|
||||
|
||||
/* prototypes for statistics.c */
|
||||
-int parsesnmp(int, int, int);
|
||||
+int parsesnmp(int, int, int, int);
|
||||
void inittab(void);
|
||||
int parsesnmp6(int, int, int);
|
||||
void inittab6(void);
|
||||
@@ -2093,7 +2093,7 @@ int main
|
||||
if (!strcmp(afname, "inet")) {
|
||||
#if HAVE_AFINET
|
||||
inittab();
|
||||
- i = parsesnmp(flag_raw, flag_tcp, flag_udp);
|
||||
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
|
||||
#else
|
||||
ENOSUPP("netstat", "AF INET");
|
||||
#endif
|
||||
diff -up net-tools-1.60/statistics.c.sctp net-tools-1.60/statistics.c
|
||||
--- net-tools-1.60/statistics.c.sctp 2011-12-06 16:28:09.705244079 +0100
|
||||
+++ net-tools-1.60/statistics.c 2011-12-06 16:28:49.128751215 +0100
|
||||
@@ -21,7 +21,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,
|
||||
@@ -299,6 +299,27 @@ struct entry Tcpexttab[] =
|
||||
{ "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
|
||||
};
|
||||
|
||||
+struct entry Sctptab[] =
|
||||
+{
|
||||
+ {"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 {
|
||||
char *title;
|
||||
struct entry *tab;
|
||||
@@ -312,6 +333,7 @@ struct tabtab snmptabs[] =
|
||||
{"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}
|
||||
};
|
||||
@@ -502,11 +524,37 @@ void process6_fd(FILE *f)
|
||||
|
||||
}
|
||||
|
||||
-int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
|
||||
+/* 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) {
|
||||
+ fprintf(stderr,_("error parsing %s\n"), filename);
|
||||
+ return;
|
||||
+ }
|
||||
+ *sp = '\0';
|
||||
+ sp++;
|
||||
+
|
||||
+ sp += strspn(sp, " \t\n");
|
||||
+
|
||||
+ if (*sp != '\0' && *(tab->flag))
|
||||
+ printval(tab, buf1, strtoul(sp, 0, 10));
|
||||
+ }
|
||||
+ 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 = proc_fopen("/proc/net/snmp");
|
||||
if (!f) {
|
||||
@@ -539,6 +587,17 @@ int parsesnmp(int flag_raw, int flag_tcp
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
+
|
||||
+ f = proc_fopen("/proc/net/sctp/snmp");
|
||||
+ if (f) {
|
||||
+ process_fd2(f,"/proc/net/sctp/snmp");
|
||||
+ if (ferror(f)) {
|
||||
+ perror("/proc/net/sctp/snmp");
|
||||
+ fclose(f);
|
||||
+ return(1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return(0);
|
||||
}
|
||||
|
@ -1,80 +0,0 @@
|
||||
--- net-tools-1.60/lib/interface.c.siunits 2004-03-14 12:11:22.000000000 -0600
|
||||
+++ net-tools-1.60/lib/interface.c 2004-03-14 12:27:31.990679464 -0600
|
||||
@@ -262,7 +262,7 @@
|
||||
&ife->stats.tx_compressed);
|
||||
break;
|
||||
case 2:
|
||||
- sscanf(bp, "%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu",
|
||||
+ sscanf(bp, "%Lu %llu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu",
|
||||
&ife->stats.rx_bytes,
|
||||
&ife->stats.rx_packets,
|
||||
&ife->stats.rx_errors,
|
||||
@@ -280,7 +280,7 @@
|
||||
ife->stats.rx_multicast = 0;
|
||||
break;
|
||||
case 1:
|
||||
- sscanf(bp, "%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu",
|
||||
+ sscanf(bp, "%Lu %lu %lu %lu %lu %Lu %lu %lu %lu %lu %lu",
|
||||
&ife->stats.rx_packets,
|
||||
&ife->stats.rx_errors,
|
||||
&ife->stats.rx_dropped,
|
||||
@@ -675,8 +675,8 @@
|
||||
int hf;
|
||||
int can_compress = 0;
|
||||
unsigned long long rx, tx, short_rx, short_tx;
|
||||
- char Rext[5]="b";
|
||||
- char Text[5]="b";
|
||||
+ const char *Rext = "b";
|
||||
+ const char *Text = "b";
|
||||
|
||||
#if HAVE_AFIPX
|
||||
static struct aftype *ipxtype = NULL;
|
||||
@@ -882,10 +882,44 @@
|
||||
tx = ptr->stats.tx_bytes;
|
||||
short_rx = rx * 10;
|
||||
short_tx = tx * 10;
|
||||
- if (rx > 1048576) { short_rx /= 1048576; strcpy(Rext, "Mb"); }
|
||||
- else if (rx > 1024) { short_rx /= 1024; strcpy(Rext, "Kb"); }
|
||||
- if (tx > 1048576) { short_tx /= 1048576; strcpy(Text, "Mb"); }
|
||||
- else if (tx > 1024) { short_tx /= 1024; strcpy(Text, "Kb"); }
|
||||
+ if (rx > 1152921504606846976ull) {
|
||||
+ short_rx /= 1152921504606846976ull;
|
||||
+ Rext = "EiB";
|
||||
+ } else if (rx > 1125899906842624ull) {
|
||||
+ short_rx /= 1125899906842624ull;
|
||||
+ Rext = "PiB";
|
||||
+ } else if (rx > 1099511627776ull) {
|
||||
+ short_rx /= 1099511627776ull;
|
||||
+ Rext = "TiB";
|
||||
+ } else if (rx > 1073741824ull) {
|
||||
+ short_rx /= 1073741824ull;
|
||||
+ Rext = "GiB";
|
||||
+ } else if (rx > 1048576) {
|
||||
+ short_rx /= 1048576;
|
||||
+ Rext = "MiB";
|
||||
+ } else if (rx > 1024) {
|
||||
+ short_rx /= 1024;
|
||||
+ Rext = "KiB";
|
||||
+ }
|
||||
+ if (tx > 1152921504606846976ull) {
|
||||
+ short_tx /= 1152921504606846976ull;
|
||||
+ Text = "EiB";
|
||||
+ } else if (tx > 1125899906842624ull) {
|
||||
+ short_tx /= 1125899906842624ull;
|
||||
+ Text = "PiB";
|
||||
+ } else if (tx > 1099511627776ull) {
|
||||
+ short_tx /= 1099511627776ull;
|
||||
+ Text = "TiB";
|
||||
+ } else if (tx > 1073741824ull) {
|
||||
+ short_tx /= 1073741824ull;
|
||||
+ Text = "GiB";
|
||||
+ } else if (tx > 1048576) {
|
||||
+ short_tx /= 1048576;
|
||||
+ Text = "MiB";
|
||||
+ } else if (tx > 1024) {
|
||||
+ short_tx /= 1024;
|
||||
+ Text = "KiB";
|
||||
+ }
|
||||
|
||||
printf(" ");
|
||||
printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"),
|
@ -1,13 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.skip 2006-08-07 10:45:25.000000000 +0200
|
||||
+++ net-tools-1.60/netstat.c 2006-08-07 11:17:37.000000000 +0200
|
||||
@@ -444,6 +444,10 @@
|
||||
#ifdef DIRENT_HAVE_D_TYPE_WORKS
|
||||
if (direfd->d_type!=DT_LNK)
|
||||
continue;
|
||||
+#else
|
||||
+ /* Skip . and .. */
|
||||
+ if (!isdigit(direfd->d_name[0]))
|
||||
+ continue;
|
||||
#endif
|
||||
if (procfdlen+1+strlen(direfd->d_name)+1>sizeof(line))
|
||||
continue;
|
@ -1,24 +0,0 @@
|
||||
diff -up net-tools-1.60/slattach.c.slattach-fchown net-tools-1.60/slattach.c
|
||||
--- net-tools-1.60/slattach.c.slattach-fchown 2000-10-28 12:59:41.000000000 +0200
|
||||
+++ net-tools-1.60/slattach.c 2009-09-15 18:17:01.000000000 +0200
|
||||
@@ -195,15 +195,17 @@ tty_lock(char *path, int mode)
|
||||
return(-1);
|
||||
}
|
||||
|
||||
- (void) close(fd);
|
||||
-
|
||||
/* Make sure UUCP owns the lockfile. Required by some packages. */
|
||||
if ((pw = getpwnam(_UID_UUCP)) == NULL) {
|
||||
if (opt_q == 0) fprintf(stderr, _("slattach: tty_lock: UUCP user %s unknown!\n"),
|
||||
_UID_UUCP);
|
||||
+ (void) close(fd);
|
||||
return(0); /* keep the lock anyway */
|
||||
}
|
||||
- (void) chown(saved_path, pw->pw_uid, pw->pw_gid);
|
||||
+ (void) fchown(fd, pw->pw_uid, pw->pw_gid);
|
||||
+
|
||||
+ (void) close(fd);
|
||||
+
|
||||
saved_lock = 1;
|
||||
} else { /* unlock */
|
||||
if (saved_lock != 1) return(0);
|
@ -1,65 +0,0 @@
|
||||
--- net-tools-1.60/statistics.c.tcpdata 2005-04-26 10:38:10.000000000 +0200
|
||||
+++ net-tools-1.60/statistics.c 2005-04-26 10:36:19.000000000 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL.
|
||||
- * $Id: statistics.c,v 1.14 2001/02/02 18:01:23 pb Exp $
|
||||
+ * $Id: statistics.c,v 1.17 2002/04/28 15:41:01 ak Exp $
|
||||
* 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
* 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
* 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels
|
||||
@@ -185,6 +185,44 @@
|
||||
"directly queued to user"), opt_number },
|
||||
{ "SockMallocOOM", N_("Ran %lu times out of system memory during "
|
||||
"packet sending"), opt_number },
|
||||
+ { "TCPPureAcks", N_("%u acknowledgments not containing data received"), opt_number },
|
||||
+ { "TCPHPAcks", N_("%u predicted acknowledgments"), opt_number },
|
||||
+ { "TCPRenoRecovery", N_("%u times recovered from packet loss due to fast retransmit"), opt_number },
|
||||
+ { "TCPSackRecovery", N_("%u times recovered from packet loss due to SACK data"), opt_number },
|
||||
+ { "TCPSACKReneging", N_("%u bad SACKs received"), opt_number },
|
||||
+ { "TCPFACKReorder", N_("Detected reordering %u times using FACK"), opt_number },
|
||||
+ { "TCPSACKReorder", N_("Detected reordering %u times using SACK"), opt_number },
|
||||
+ { "TCPTSReorder", N_("Detected reordering %u times using time stamp"), opt_number },
|
||||
+ { "TCPRenoReorder", N_("Detected reordering %u times using reno fast retransmit"), opt_number },
|
||||
+ { "TCPFullUndo", N_("%u congestion windows fully recovered"), opt_number },
|
||||
+ { "TCPPartialUndo", N_("%u congestion windows partially recovered using Hoe heuristic"), opt_number },
|
||||
+ { "TCPDSackUndo", N_("%u congestion window recovered using DSACK"), opt_number },
|
||||
+ { "TCPLossUndo", N_("%u congestion windows recovered after partial ack"), opt_number },
|
||||
+ { "TCPLostRetransmits", N_("%u retransmits lost"), opt_number },
|
||||
+ { "TCPRenoFailures", N_("%u timeouts after reno fast retransmit"), opt_number },
|
||||
+ { "TCPSackFailures", N_("%u timeouts after SACK recovery"), opt_number },
|
||||
+ { "TCPLossFailures", N_("%u timeouts in loss state"), opt_number },
|
||||
+ { "TCPFastRetrans", N_("%u fast retransmits"), opt_number },
|
||||
+ { "TCPForwardRetrans", N_("%u forward retransmits"), opt_number },
|
||||
+ { "TCPSlowStartRetrans", N_("%u retransmits in slow start"), opt_number },
|
||||
+ { "TCPTimeouts", N_("%u other TCP timeouts"), opt_number },
|
||||
+ { "TCPRenoRecoveryFailed", N_("%u reno fast retransmits failed"), opt_number },
|
||||
+ { "TCPSackRecoveryFail", N_("%u sack retransmits failed"), opt_number },
|
||||
+ { "TCPSchedulerFailed", N_("%u times receiver scheduled too late for direct processing"), opt_number },
|
||||
+ { "TCPRcvCollapsed", N_("%u packets collapsed in receive queue due to low socket buffer"), opt_number },
|
||||
+ { "TCPDSACKOldSent", N_("%u DSACKs sent for old packets"), opt_number },
|
||||
+ { "TCPDSACKOfoSent", N_("%u DSACKs sent for out of order packets"), opt_number },
|
||||
+ { "TCPDSACKRecv", N_("%u DSACKs received"), opt_number },
|
||||
+ { "TCPDSACKOfoRecv", N_("%u DSACKs for out of order packets received"), opt_number },
|
||||
+ { "TCPAbortOnSyn", N_("%u connections reset due to unexpected SYN"), opt_number },
|
||||
+ { "TCPAbortOnData", N_("%u connections reset due to unexpected data"), opt_number },
|
||||
+ { "TCPAbortOnClose", N_("%u connections reset due to early user close"), opt_number },
|
||||
+ { "TCPAbortOnMemory", N_("%u connections aborted due to memory pressure"), opt_number },
|
||||
+ { "TCPAbortOnTimeout", N_("%u connections aborted due to timeout"), opt_number },
|
||||
+ { "TCPAbortOnLinger", N_("%u connections aborted after user close in linger timeout"), opt_number },
|
||||
+ { "TCPAbortFailed", N_("%u times unable to send RST due to no memory"), opt_number },
|
||||
+ { "TCPMemoryPressures", N_("TCP ran low on memory %u times"), opt_number },
|
||||
+ { "TCPLoss", N_("%u TCP data loss events") },
|
||||
};
|
||||
|
||||
struct tabtab {
|
||||
@@ -222,7 +260,8 @@
|
||||
ent = bsearch(&key, tab->tab, tab->size / sizeof(struct entry),
|
||||
sizeof(struct entry), cmpentries);
|
||||
if (!ent) { /* try our best */
|
||||
- printf("%*s%s: %d\n", states[state].indent, "", title, val);
|
||||
+ if (val)
|
||||
+ printf("%*s%s: %d\n", states[state].indent, "", title, val);
|
||||
return;
|
||||
}
|
||||
type = ent->type;
|
@ -1,12 +0,0 @@
|
||||
diff -up net-tools-1.60/statistics.c.old net-tools-1.60/statistics.c
|
||||
--- net-tools-1.60/statistics.c.old 2008-03-04 10:44:41.000000000 +0100
|
||||
+++ net-tools-1.60/statistics.c 2008-03-04 10:44:11.000000000 +0100
|
||||
@@ -352,7 +352,7 @@ struct tabtab *newtable(struct tabtab *t
|
||||
|
||||
void process_fd(FILE *f,int file_desc) // added file_desc to show propriate error mesg
|
||||
{
|
||||
- char buf1[1024], buf2[1024];
|
||||
+ char buf1[2048], buf2[2048];
|
||||
char *sp, *np, *p;
|
||||
while (fgets(buf1, sizeof buf1, f)) {
|
||||
int endflag;
|
@ -1,11 +0,0 @@
|
||||
diff -urN net-tools-1.60/mii-tool.c net-tools-1.60.new/mii-tool.c
|
||||
--- net-tools-1.60/mii-tool.c 2000-05-21 16:31:17.000000000 +0200
|
||||
+++ net-tools-1.60.new/mii-tool.c 2005-03-29 13:00:18.000000000 +0200
|
||||
@@ -302,6 +302,7 @@
|
||||
printf("\n link partner:%s", media_list(lkpar, 0));
|
||||
printf("\n");
|
||||
}
|
||||
+ fflush(stdout);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
--- net-tools-1.60/hostname.c.trailingblank 2001-04-08 19:04:23.000000000 +0200
|
||||
+++ net-tools-1.60/hostname.c 2003-08-19 14:21:17.000000000 +0200
|
||||
@@ -153,13 +153,19 @@
|
||||
|
||||
switch (c) {
|
||||
case 'a':
|
||||
- while (hp->h_aliases[0])
|
||||
- printf("%s ", *hp->h_aliases++);
|
||||
+ while (hp->h_aliases[0]) {
|
||||
+ printf("%s", *hp->h_aliases++);
|
||||
+ if (hp->h_aliases[0])
|
||||
+ printf(" ");
|
||||
+ }
|
||||
printf("\n");
|
||||
break;
|
||||
case 'i':
|
||||
- while (hp->h_addr_list[0])
|
||||
- printf("%s ", inet_ntoa(*(struct in_addr *) *hp->h_addr_list++));
|
||||
+ while (hp->h_addr_list[0]) {
|
||||
+ printf("%s", inet_ntoa(*(struct in_addr *) *hp->h_addr_list++));
|
||||
+ if (hp->h_addr_list[0])
|
||||
+ printf(" ");
|
||||
+ }
|
||||
printf("\n");
|
||||
break;
|
||||
case 'd':
|
@ -1,42 +0,0 @@
|
||||
--- net-tools-1.60/netstat.c.trunc 2004-08-31 12:42:08.595426960 +0200
|
||||
+++ net-tools-1.60/netstat.c 2004-08-31 12:59:55.766192344 +0200
|
||||
@@ -773,8 +773,8 @@
|
||||
get_sname(htons(local_port), "tcp",
|
||||
flag_not & FLAG_NUM_PORT));
|
||||
|
||||
- if ((strlen(local_addr) + strlen(buffer)) > 22)
|
||||
- local_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
|
||||
+ local_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
|
||||
strcat(local_addr, ":");
|
||||
strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
|
||||
@@ -782,8 +782,8 @@
|
||||
snprintf(buffer, sizeof(buffer), "%s",
|
||||
get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
|
||||
|
||||
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
|
||||
- rem_addr[22 - strlen(buffer)] = '\0';
|
||||
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
|
||||
+ rem_addr[27 - strlen(buffer) - 1] = '\0';
|
||||
|
||||
strcat(rem_addr, ":");
|
||||
strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
|
||||
@@ -816,7 +816,7 @@
|
||||
timer_run, (double) time_len / HZ, retr, timeout);
|
||||
break;
|
||||
}
|
||||
- printf("tcp %6ld %6ld %-23s %-23s %-12s",
|
||||
+ printf("tcp %6ld %6ld %-27s %-27s %-12s",
|
||||
rxq, txq, local_addr, rem_addr, _(tcp_state[state]));
|
||||
|
||||
finish_this_one(uid,inode,timers);
|
||||
@@ -1770,7 +1770,7 @@
|
||||
else
|
||||
printf(_("(w/o servers)"));
|
||||
}
|
||||
- printf(_("\nProto Recv-Q Send-Q Local Address Foreign Address State ")); /* xxx */
|
||||
+ printf(_("\nProto Recv-Q Send-Q Local Address Foreign Address State ")); /* xxx */
|
||||
if (flag_exp > 1)
|
||||
printf(_(" User Inode "));
|
||||
print_progname_banner();
|
@ -1,215 +0,0 @@
|
||||
diff -urN net-tools-1.60/statistics.c net-tools-1.60-patch/statistics.c
|
||||
--- net-tools-1.60/statistics.c 2001-02-02 10:01:23.000000000 -0800
|
||||
+++ net-tools-1.60-patch/statistics.c 2004-06-15 11:09:44.000000000 -0700
|
||||
@@ -63,54 +63,54 @@
|
||||
struct entry Iptab[] =
|
||||
{
|
||||
{"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC},
|
||||
- {"DefaultTTL", N_("Default TTL is %u"), number | I_STATIC},
|
||||
- {"InReceives", N_("%u total packets received"), number},
|
||||
- {"InHdrErrors", N_("%u with invalid headers"), opt_number},
|
||||
- {"InAddrErrors", N_("%u with invalid addresses"), opt_number},
|
||||
- {"ForwDatagrams", N_("%u forwarded"), number},
|
||||
- {"InUnknownProtos", N_("%u with unknown protocol"), opt_number},
|
||||
- {"InDiscards", N_("%u incoming packets discarded"), number},
|
||||
- {"InDelivers", N_("%u incoming packets delivered"), number},
|
||||
- {"OutRequests", N_("%u requests sent out"), number}, /*? */
|
||||
- {"OutDiscards", N_("%u outgoing packets dropped"), opt_number},
|
||||
- {"OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
|
||||
- {"ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
|
||||
- {"ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
|
||||
- {"ReasmOKs", N_("%u packets reassembled ok"), opt_number},
|
||||
- {"ReasmFails", N_("%u packet reassembles failed"), opt_number},
|
||||
- {"FragOKs", N_("%u fragments received ok"), opt_number},
|
||||
- {"FragFails", N_("%u fragments failed"), opt_number},
|
||||
- {"FragCreates", N_("%u fragments created"), opt_number}
|
||||
+ {"DefaultTTL", N_("Default TTL is %lu"), number | I_STATIC},
|
||||
+ {"InReceives", N_("%lu total packets received"), number},
|
||||
+ {"InHdrErrors", N_("%lu with invalid headers"), opt_number},
|
||||
+ {"InAddrErrors", N_("%lu with invalid addresses"), opt_number},
|
||||
+ {"ForwDatagrams", N_("%lu forwarded"), number},
|
||||
+ {"InUnknownProtos", N_("%lu with unknown protocol"), opt_number},
|
||||
+ {"InDiscards", N_("%lu incoming packets discarded"), number},
|
||||
+ {"InDelivers", N_("%lu incoming packets delivered"), number},
|
||||
+ {"OutRequests", N_("%lu requests sent out"), number}, /*? */
|
||||
+ {"OutDiscards", N_("%lu outgoing packets dropped"), opt_number},
|
||||
+ {"OutNoRoutes", N_("%lu dropped because of missing route"), opt_number},
|
||||
+ {"ReasmTimeout", N_("%lu fragments dropped after timeout"), opt_number},
|
||||
+ {"ReasmReqds", N_("%lu reassemblies required"), opt_number}, /* ? */
|
||||
+ {"ReasmOKs", N_("%lu packets reassembled ok"), opt_number},
|
||||
+ {"ReasmFails", N_("%lu packet reassembles failed"), opt_number},
|
||||
+ {"FragOKs", N_("%lu fragments received ok"), opt_number},
|
||||
+ {"FragFails", N_("%lu fragments failed"), opt_number},
|
||||
+ {"FragCreates", N_("%lu fragments created"), opt_number}
|
||||
};
|
||||
|
||||
struct entry Icmptab[] =
|
||||
{
|
||||
- {"InMsgs", N_("%u ICMP messages received"), number},
|
||||
- {"InErrors", N_("%u input ICMP message failed."), number},
|
||||
- {"InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InTimeExcds", N_("timeout in transit: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InParmProbs", N_("wrong parameters: %u"), i_inp_icmp | I_TITLE}, /*? */
|
||||
- {"InSrcQuenchs", N_("source quenches: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InEchoReps", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InTimestamps", N_("timestamp request: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InTimestampReps", N_("timestamp reply: %u"), i_inp_icmp | I_TITLE},
|
||||
- {"InAddrMasks", N_("address mask request: %u"), i_inp_icmp | I_TITLE}, /*? */
|
||||
- {"InAddrMaskReps", N_("address mask replies: %u"), i_inp_icmp | I_TITLE}, /*? */
|
||||
- {"OutMsgs", N_("%u ICMP messages sent"), number},
|
||||
- {"OutErrors", N_("%u ICMP messages failed"), number},
|
||||
- {"OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutTimeExcds", N_("time exceeded: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutParmProbs", N_("wrong parameters: %u"), i_outp_icmp | I_TITLE}, /*? */
|
||||
- {"OutSrcQuenchs", N_("source quench: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutRedirects", N_("redirect: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutEchos", N_("echo request: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutEchoReps", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutTimestamps", N_("timestamp requests: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutTimestampReps", N_("timestamp replies: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutAddrMasks", N_("address mask requests: %u"), i_outp_icmp | I_TITLE},
|
||||
- {"OutAddrMaskReps", N_("address mask replies: %u"), i_outp_icmp | I_TITLE},
|
||||
+ {"InMsgs", N_("%lu ICMP messages received"), number},
|
||||
+ {"InErrors", N_("%lu input ICMP message failed."), number},
|
||||
+ {"InDestUnreachs", N_("destination unreachable: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InTimeExcds", N_("timeout in transit: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InParmProbs", N_("wrong parameters: %lu"), i_inp_icmp | I_TITLE}, /*? */
|
||||
+ {"InSrcQuenchs", N_("source quenches: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InRedirects", N_("redirects: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InEchos", N_("echo requests: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InEchoReps", N_("echo replies: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InTimestamps", N_("timestamp request: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InTimestampReps", N_("timestamp reply: %lu"), i_inp_icmp | I_TITLE},
|
||||
+ {"InAddrMasks", N_("address mask request: %lu"), i_inp_icmp | I_TITLE}, /*? */
|
||||
+ {"InAddrMaskReps", N_("address mask replies: %lu"), i_inp_icmp | I_TITLE}, /*? */
|
||||
+ {"OutMsgs", N_("%lu ICMP messages sent"), number},
|
||||
+ {"OutErrors", N_("%lu ICMP messages failed"), number},
|
||||
+ {"OutDestUnreachs", N_("destination unreachable: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutTimeExcds", N_("time exceeded: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutParmProbs", N_("wrong parameters: %lu"), i_outp_icmp | I_TITLE}, /*? */
|
||||
+ {"OutSrcQuenchs", N_("source quench: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutRedirects", N_("redirect: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutEchos", N_("echo request: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutEchoReps", N_("echo replies: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutTimestamps", N_("timestamp requests: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutTimestampReps", N_("timestamp replies: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutAddrMasks", N_("address mask requests: %lu"), i_outp_icmp | I_TITLE},
|
||||
+ {"OutAddrMaskReps", N_("address mask replies: %lu"), i_outp_icmp | I_TITLE},
|
||||
};
|
||||
|
||||
struct entry Tcptab[] =
|
||||
@@ -119,71 +119,71 @@
|
||||
{"RtoMin", "", number},
|
||||
{"RtoMax", "", number},
|
||||
{"MaxConn", "", number},
|
||||
- {"ActiveOpens", N_("%u active connections openings"), number},
|
||||
- {"PassiveOpens", N_("%u passive connection openings"), number},
|
||||
- {"AttemptFails", N_("%u failed connection attempts"), number},
|
||||
- {"EstabResets", N_("%u connection resets received"), number},
|
||||
- {"CurrEstab", N_("%u connections established"), number},
|
||||
- {"InSegs", N_("%u segments received"), number},
|
||||
- {"OutSegs", N_("%u segments send out"), number},
|
||||
- {"RetransSegs", N_("%u segments retransmited"), number},
|
||||
- {"InErrs", N_("%u bad segments received."), number},
|
||||
- {"OutRsts", N_("%u resets sent"), number},
|
||||
+ {"ActiveOpens", N_("%lu active connections openings"), number},
|
||||
+ {"PassiveOpens", N_("%lu passive connection openings"), number},
|
||||
+ {"AttemptFails", N_("%lu failed connection attempts"), number},
|
||||
+ {"EstabResets", N_("%lu connection resets received"), number},
|
||||
+ {"CurrEstab", N_("%lu connections established"), number},
|
||||
+ {"InSegs", N_("%lu segments received"), number},
|
||||
+ {"OutSegs", N_("%lu segments send out"), number},
|
||||
+ {"RetransSegs", N_("%lu segments retransmited"), number},
|
||||
+ {"InErrs", N_("%lu bad segments received."), number},
|
||||
+ {"OutRsts", N_("%lu resets sent"), number},
|
||||
};
|
||||
|
||||
struct entry Udptab[] =
|
||||
{
|
||||
- {"InDatagrams", N_("%u packets received"), number},
|
||||
- {"NoPorts", N_("%u packets to unknown port received."), number},
|
||||
- {"InErrors", N_("%u packet receive errors"), number},
|
||||
- {"OutDatagrams", N_("%u packets sent"), number},
|
||||
+ {"InDatagrams", N_("%lu packets received"), number},
|
||||
+ {"NoPorts", N_("%lu packets to unknown port received."), number},
|
||||
+ {"InErrors", N_("%lu packet receive errors"), number},
|
||||
+ {"OutDatagrams", N_("%lu packets sent"), number},
|
||||
};
|
||||
|
||||
struct entry Tcpexttab[] =
|
||||
{
|
||||
- {"SyncookiesSent", N_("%u SYN cookies sent"), opt_number},
|
||||
- {"SyncookiesRecv", N_("%u SYN cookies received"), opt_number},
|
||||
- {"SyncookiesFailed", N_("%u invalid SYN cookies received"), opt_number},
|
||||
+ {"SyncookiesSent", N_("%lu SYN cookies sent"), opt_number},
|
||||
+ {"SyncookiesRecv", N_("%lu SYN cookies received"), opt_number},
|
||||
+ {"SyncookiesFailed", N_("%lu invalid SYN cookies received"), opt_number},
|
||||
|
||||
- { "EmbryonicRsts", N_("%u resets received for embryonic SYN_RECV sockets"),
|
||||
+ { "EmbryonicRsts", N_("%lu resets received for embryonic SYN_RECV sockets"),
|
||||
opt_number },
|
||||
- { "PruneCalled", N_("%u packets pruned from receive queue because of socket"
|
||||
+ { "PruneCalled", N_("%lu packets pruned from receive queue because of socket"
|
||||
" buffer overrun"), opt_number },
|
||||
/* obsolete: 2.2.0 doesn't do that anymore */
|
||||
- { "RcvPruned", N_("%u packets pruned from receive queue"), opt_number },
|
||||
- { "OfoPruned", N_("%u packets dropped from out-of-order queue because of"
|
||||
+ { "RcvPruned", N_("%lu packets pruned from receive queue"), opt_number },
|
||||
+ { "OfoPruned", N_("%lu packets dropped from out-of-order queue because of"
|
||||
" socket buffer overrun"), opt_number },
|
||||
- { "OutOfWindowIcmps", N_("%u ICMP packets dropped because they were "
|
||||
+ { "OutOfWindowIcmps", N_("%lu ICMP packets dropped because they were "
|
||||
"out-of-window"), opt_number },
|
||||
- { "LockDroppedIcmps", N_("%u ICMP packets dropped because"
|
||||
+ { "LockDroppedIcmps", N_("%lu ICMP packets dropped because"
|
||||
" socket was locked"), opt_number },
|
||||
- { "TW", N_("%u TCP sockets finished time wait in fast timer"), opt_number },
|
||||
- { "TWRecycled", N_("%u time wait sockets recycled by time stamp"), opt_number },
|
||||
- { "TWKilled", N_("%u TCP sockets finished time wait in slow timer"), opt_number },
|
||||
- { "PAWSPassive", N_("%u passive connections rejected because of"
|
||||
+ { "TW", N_("%lu TCP sockets finished time wait in fast timer"), opt_number },
|
||||
+ { "TWRecycled", N_("%lu time wait sockets recycled by time stamp"), opt_number },
|
||||
+ { "TWKilled", N_("%lu TCP sockets finished time wait in slow timer"), opt_number },
|
||||
+ { "PAWSPassive", N_("%lu passive connections rejected because of"
|
||||
" time stamp"), opt_number },
|
||||
- { "PAWSActive", N_("%u active connections rejected because of "
|
||||
+ { "PAWSActive", N_("%lu active connections rejected because of "
|
||||
"time stamp"), opt_number },
|
||||
- { "PAWSEstab", N_("%u packets rejects in established connections because of"
|
||||
+ { "PAWSEstab", N_("%lu packets rejects in established connections because of"
|
||||
" timestamp"), opt_number },
|
||||
- { "DelayedACKs", N_("%u delayed acks sent"), opt_number },
|
||||
- { "DelayedACKLocked", N_("%u delayed acks further delayed because of"
|
||||
+ { "DelayedACKs", N_("%lu delayed acks sent"), opt_number },
|
||||
+ { "DelayedACKLocked", N_("%lu delayed acks further delayed because of"
|
||||
" locked socket"), opt_number },
|
||||
- { "DelayedACKLost", N_("Quick ack mode was activated %u times"), opt_number },
|
||||
- { "ListenOverflows", N_("%u times the listen queue of a socket overflowed"),
|
||||
+ { "DelayedACKLost", N_("Quick ack mode was activated %lu times"), opt_number },
|
||||
+ { "ListenOverflows", N_("%lu times the listen queue of a socket overflowed"),
|
||||
opt_number },
|
||||
- { "ListenDrops", N_("%u SYNs to LISTEN sockets ignored"), opt_number },
|
||||
- { "TCPPrequeued", N_("%u packets directly queued to recvmsg prequeue."),
|
||||
+ { "ListenDrops", N_("%lu SYNs to LISTEN sockets ignored"), opt_number },
|
||||
+ { "TCPPrequeued", N_("%lu packets directly queued to recvmsg prequeue."),
|
||||
opt_number },
|
||||
- { "TCPDirectCopyFromBacklog", N_("%u packets directly received"
|
||||
+ { "TCPDirectCopyFromBacklog", N_("%lu packets directly received"
|
||||
" from backlog"), opt_number },
|
||||
- { "TCPDirectCopyFromPrequeue", N_("%u packets directly received"
|
||||
+ { "TCPDirectCopyFromPrequeue", N_("%lu packets directly received"
|
||||
" from prequeue"), opt_number },
|
||||
- { "TCPPrequeueDropped", N_("%u packets dropped from prequeue"), opt_number },
|
||||
- { "TCPHPHits", N_("%u packets header predicted"), number },
|
||||
- { "TCPHPHitsToUser", N_("%u packets header predicted and "
|
||||
+ { "TCPPrequeueDropped", N_("%lu packets dropped from prequeue"), opt_number },
|
||||
+ { "TCPHPHits", N_("%lu packets header predicted"), number },
|
||||
+ { "TCPHPHitsToUser", N_("%lu packets header predicted and "
|
||||
"directly queued to user"), opt_number },
|
||||
- { "SockMallocOOM", N_("Ran %u times out of system memory during "
|
||||
+ { "SockMallocOOM", N_("Ran %lu times out of system memory during "
|
||||
"packet sending"), opt_number },
|
||||
};
|
||||
|
332
net-tools.spec
332
net-tools.spec
@ -20,250 +20,102 @@ Source7: iptunnel.8
|
||||
Source8: ipmaddr.8
|
||||
Source9: arp-ethers.service
|
||||
|
||||
# Not needed
|
||||
#Patch1: net-tools-1.57-bug22040.patch
|
||||
|
||||
# We don't use include/mii.h anyway (see mii-refactor.patch)
|
||||
#Patch2: net-tools-1.60-miiioctl.patch
|
||||
|
||||
# Rewritten upstream, hopefully this won't be needed.
|
||||
#Patch3: net-tools-1.60-manydevs.patch
|
||||
|
||||
# Fixes formating of 'netstat -i'
|
||||
Patch4: net-tools-1.60-virtualname.patch
|
||||
Patch1: 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
|
||||
|
||||
# Merged upstream
|
||||
#Patch6: net-tools-1.60-nameif.patch
|
||||
Patch2: net-tools-1.60-cycle.patch
|
||||
|
||||
# Fixed incorrect address display for ipx (#46434)
|
||||
Patch7: net-tools-1.60-ipx.patch
|
||||
Patch3: net-tools-1.60-ipx.patch
|
||||
|
||||
# hostname lookup problems with route --inet6 (#84108)
|
||||
Patch8: net-tools-1.60-inet6-lookup.patch
|
||||
Patch4: net-tools-1.60-inet6-lookup.patch
|
||||
|
||||
# various man page fixes merged into one patch
|
||||
Patch9: net-tools-1.60-man.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch10: net-tools-1.60-gcc33.patch
|
||||
|
||||
# hostname patch
|
||||
#Patch11: net-tools-1.60-trailingblank.patch
|
||||
Patch5: net-tools-1.60-man.patch
|
||||
|
||||
# netstat: interface option now works as described in the man page (#61113, #115987)
|
||||
Patch12: net-tools-1.60-interface.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch14: net-tools-1.60-gcc34.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch15: net-tools-1.60-overflow.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch19: net-tools-1.60-siunits.patch
|
||||
|
||||
# (#128359) Fixed upstream
|
||||
#Patch20: net-tools-1.60-trunc.patch
|
||||
Patch6: net-tools-1.60-interface.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
|
||||
Patch7: net-tools-1.60-nameif-return.patch
|
||||
|
||||
# netstat -s (statistics.c) now uses unsigned long long handle 64 bit integers (Bug #579854, Debian #561161)
|
||||
Patch24: net-tools-1.60-statistics-doubleword.patch
|
||||
Patch8: net-tools-1.60-statistics-doubleword.patch
|
||||
|
||||
# calculate broadcast only when netmask provided (#60509)
|
||||
Patch25: net-tools-1.60-bcast.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch27: net-tools-1.60-netstat_ulong.patch
|
||||
|
||||
# hostname man page fix
|
||||
#Patch28: net-tools-1.60-note.patch
|
||||
|
||||
# fixed --num-ports option for netstat (#115100)
|
||||
# fixed upstream
|
||||
#Patch29: net-tools-1.60-num-ports.patch
|
||||
Patch9: net-tools-1.60-bcast.patch
|
||||
|
||||
# filter out duplicate tcp entries (#139407)
|
||||
Patch30: net-tools-1.60-duplicate-tcp.patch
|
||||
Patch10: net-tools-1.60-duplicate-tcp.patch
|
||||
|
||||
# don't report statistics for virtual devices (#143981)
|
||||
Patch31: net-tools-1.60-statalias.patch
|
||||
|
||||
# translation headers - content type format
|
||||
# is it good for anything ?
|
||||
#Patch32: net-tools-1.60-isofix.patch
|
||||
|
||||
# Merged upstream
|
||||
#Patch34: net-tools-1.60-ifconfig_ib.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch35: net-tools-1.60-de.patch
|
||||
|
||||
# not needed
|
||||
#Patch37: net-tools-1.60-pie.patch
|
||||
|
||||
# merged into interface.patch
|
||||
#Patch38: net-tools-1.60-ifaceopt.patch
|
||||
Patch11: net-tools-1.60-statalias.patch
|
||||
|
||||
# stop trimming interface names longer than 9 characters (#152457)
|
||||
Patch39: net-tools-1.60-trim_iface.patch
|
||||
|
||||
# flush output in mii-tool (#152568)
|
||||
# Fixed upstream
|
||||
#Patch40: net-tools-1.60-stdo.patch
|
||||
|
||||
# netstat has new statistcs (#133032)
|
||||
# Fixed upstream
|
||||
#Patch41: net-tools-1.60-statistics.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch42: net-tools-1.60-ifconfig.patch
|
||||
Patch12: net-tools-1.60-trim_iface.patch
|
||||
|
||||
# buffer overflow in arp (#164695)
|
||||
Patch43: net-tools-1.60-arp_overflow.patch
|
||||
|
||||
# hostname patch
|
||||
#Patch44: net-tools-1.60-hostname_man.patch
|
||||
Patch13: net-tools-1.60-arp_overflow.patch
|
||||
|
||||
# clear static buffers in interface.c by Ulrich Drepper (#176714)
|
||||
Patch45: net-tools-1.60-interface_stack.patch
|
||||
Patch14: net-tools-1.60-interface_stack.patch
|
||||
|
||||
# new option for nestat, -Z shows selinux context
|
||||
Patch46: net-tools-1.60-selinux.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
|
||||
Patch15: net-tools-1.60-selinux.patch
|
||||
|
||||
# remove duplicate arp entries (#185604)
|
||||
Patch49: net-tools-1.60-fgets.patch
|
||||
Patch16: net-tools-1.60-fgets.patch
|
||||
|
||||
# wrong definition of _PATH_PROCNET_X25_ROUTE (#188786)
|
||||
Patch51: net-tools-1.60-x25-proc.patch
|
||||
Patch17: net-tools-1.60-x25-proc.patch
|
||||
|
||||
# statistics for SCTP
|
||||
Patch52: net-tools-1.60-sctp-statistics.patch
|
||||
Patch18: 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
|
||||
|
||||
# Fixed upstream
|
||||
#Patch55: net-tools-1.60-netdevice.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch56: net-tools-1.60-skip.patch
|
||||
|
||||
# Merged into interface.patch
|
||||
#Patch57: net-tools-1.60-netstat-I-fix.patch
|
||||
Patch19: net-tools-1.60-ifconfig-long-iface-crasher.patch
|
||||
|
||||
# nameif crash for 16char long interface names (#209120)
|
||||
Patch58: net-tools-1.60-nameif_strncpy.patch
|
||||
|
||||
# fix arp unaligned access (#220438)
|
||||
# Fixed upstream
|
||||
#Patch59: net-tools-1.60-arp-unaligned-access.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch60: net-tools-1.60-sctp-quiet.patch
|
||||
|
||||
# hostname patch
|
||||
#Patch61: net-tools-1.60-remove_node.patch
|
||||
|
||||
# merged into interface.patch
|
||||
#Patch62: net-tools-1.60-netstat-interfaces-crash.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch64: net-tools-1.60-ec_hw_null.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch65: net-tools-1.60-statistics_buffer.patch
|
||||
|
||||
# Rewritten upstream
|
||||
#Patch66: net-tools-1.60-sctp-addrs.patch
|
||||
|
||||
# merged into interface.patch
|
||||
#Patch67: net-tools-1.60-i-option.patch
|
||||
Patch20: net-tools-1.60-nameif_strncpy.patch
|
||||
|
||||
# fixed clearing flags in ifconfig (#450252)
|
||||
Patch69: net-tools-1.60-clear-flag.patch
|
||||
Patch21: net-tools-1.60-clear-flag.patch
|
||||
|
||||
# fixed tcp timers info in netstat (#466845)
|
||||
Patch71: net-tools-1.60-netstat-probe.patch
|
||||
Patch22: net-tools-1.60-netstat-probe.patch
|
||||
|
||||
# prevent 'netstat -nr -A inet6' from smashing stack (#668047)
|
||||
Patch72: net-tools-1.60-scanf-format.patch
|
||||
|
||||
# upstream
|
||||
#Patch73: net-tools-1.60-avoid-name-resolution.patch
|
||||
|
||||
# upstream
|
||||
#Patch74: net-tools-1.60-continous-flush-stdout.patch
|
||||
|
||||
# upstream
|
||||
#Patch75: net-tools-1.60-debug-fix.patch
|
||||
Patch23: net-tools-1.60-scanf-format.patch
|
||||
|
||||
# let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address
|
||||
Patch76: net-tools-1.60-ib-warning.patch
|
||||
|
||||
# upstream
|
||||
#Patch79: net-tools-1.60-masqinfo-raw-ip.patch
|
||||
|
||||
# upstream
|
||||
#Patch80: net-tools-1.60-makefile-berlios.patch
|
||||
|
||||
# slattach: use fchown() rather than chown() to avoid race between creation and permission changing
|
||||
#Patch81: net-tools-1.60-slattach-fchown.patch
|
||||
|
||||
# hostname patch
|
||||
#Patch82: net-tools-1.60-hostname-short.patch
|
||||
Patch24: net-tools-1.60-ib-warning.patch
|
||||
|
||||
# use <linux/mii.h> instead of "mii.h" and fix Bug #491358
|
||||
Patch83: net-tools-1.60-mii-refactor.patch
|
||||
Patch25: net-tools-1.60-mii-refactor.patch
|
||||
|
||||
# ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 (#473211)
|
||||
Patch84: net-tools-1.60-IA64.patch
|
||||
|
||||
# upstream
|
||||
#Patch85: net-tools-1.60-large-indexes.patch
|
||||
|
||||
# Fixed upstream
|
||||
#Patch87: net-tools-1.60-mii-gigabit.patch
|
||||
Patch26: net-tools-1.60-IA64.patch
|
||||
|
||||
# fix memory leak in netstat when run with -c option
|
||||
Patch88: net-tools-1.60-netstat-leak.patch
|
||||
|
||||
# upstream
|
||||
#Patch90: net-tools-1.60-ifdef-vs-if.patch
|
||||
Patch27: net-tools-1.60-netstat-leak.patch
|
||||
|
||||
# Don't rely on eth0 being default network device name.
|
||||
# Since Fedora 15 network devices can have arbitrary names (#682367)
|
||||
Patch91: net-tools-1.60-arbitrary-device-names.patch
|
||||
Patch28: net-tools-1.60-arbitrary-device-names.patch
|
||||
|
||||
# plipconfig man page and usage output fixes. (#694766)
|
||||
Patch92: net-tools-1.60-plipconfig.patch
|
||||
Patch29: net-tools-1.60-plipconfig.patch
|
||||
|
||||
# netstat: remove part starting with colon in 'PID/Program name' column (#707427)
|
||||
Patch93: net-tools-1.60-netstat-p-basename.patch
|
||||
Patch30: net-tools-1.60-netstat-p-basename.patch
|
||||
|
||||
# Possible problems found by static analysis of code.
|
||||
Patch94: net-tools-1.60-coverity.patch
|
||||
Patch31: net-tools-1.60-coverity.patch
|
||||
|
||||
# Update for 2 digit Linux version numbers (#718610)
|
||||
Patch95: net-tools-1.60-2digit.patch
|
||||
Patch32: net-tools-1.60-2digit.patch
|
||||
|
||||
BuildRequires: gettext, libselinux
|
||||
BuildRequires: libselinux-devel
|
||||
@ -278,87 +130,38 @@ Most of them are obsolete. For replacement check iproute package.
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
#%%patch1 -p1 -b .bug22040
|
||||
#%%patch2 -p1 -b .miiioctl
|
||||
#%%patch3 -p0 -b .manydevs
|
||||
%patch4 -p1 -b .virtualname
|
||||
%patch5 -p1 -b .cycle
|
||||
#%%patch6 -p1 -b .nameif
|
||||
%patch7 -p1 -b .ipx
|
||||
%patch8 -p1 -b .inet6-lookup
|
||||
%patch9 -p1 -b .man
|
||||
#%%patch10 -p1 -b .gcc33
|
||||
#%%patch11 -p1 -b .trailingblank
|
||||
%patch12 -p1 -b .interface
|
||||
#%%patch14 -p1 -b .gcc34
|
||||
#%%patch15 -p1 -b .overflow
|
||||
#%%patch19 -p1 -b .siunits
|
||||
#%%patch20 -p1 -b .trunc
|
||||
%patch21 -p1 -b .return
|
||||
#%%patch22 -p1 -b .parse
|
||||
#%%patch23 -p1 -b .netmask
|
||||
%patch24 -p1 -b .doubleword
|
||||
%patch25 -p1 -b .bcast
|
||||
#%%patch27 -p1 -b .netstat_ulong
|
||||
#%%patch28 -p1 -b .note
|
||||
#%%patch29 -p1 -b .num-ports
|
||||
%patch30 -p1 -b .dup-tcp
|
||||
%patch31 -p1 -b .statalias
|
||||
#%%patch32 -p1 -b .isofix
|
||||
#%%patch34 -p1 -b .ifconfig_ib
|
||||
#%%patch35 -p1
|
||||
#%%patch37 -p1 -b .pie
|
||||
#%%patch38 -p1 -b .ifaceopt
|
||||
%patch39 -p1 -b .trim-iface
|
||||
#%%patch40 -p1 -b .stdo
|
||||
#%%patch41 -p1 -b .statistics
|
||||
#%%patch42 -p1 -b .iface_drop
|
||||
%patch43 -p1 -b .overflow
|
||||
#%%patch44 -p1 -b .hostname_man
|
||||
%patch45 -p1 -b .stack
|
||||
%patch46 -p1 -b .selinux
|
||||
#%%patch47 -p1 -b .trim
|
||||
#%%patch48 -p1 -b .inode
|
||||
%patch49 -p1 -b .fgets
|
||||
%patch51 -p1 -b .x25
|
||||
%patch52 -p1 -b .sctp
|
||||
%patch54 -p1 -b .long_iface
|
||||
#%%patch55 -p1 -b .netdevice
|
||||
#%%patch56 -p1 -b .skip
|
||||
#%%patch57 -p1
|
||||
%patch58 -p1 -b .strncpy
|
||||
#%%patch59 -p1 -b .arp-un-access
|
||||
#%%patch60 -p1 -b .quiet
|
||||
#%%patch61 -p1
|
||||
#%%patch62 -p1 -b .iface-crash
|
||||
#%%patch64 -p1
|
||||
#%%patch65 -p1 -b .buffer
|
||||
#%%patch66 -p1 -b .sctp-addrs
|
||||
#%%patch67 -p1 -b .i-option
|
||||
%patch69 -p1 -b .clear-flag
|
||||
%patch71 -p1 -b .probe
|
||||
|
||||
%patch72 -p1 -b .scanf-format
|
||||
#%%patch73 -p1 -b .avoid-name-resolution
|
||||
#%%patch74 -p1 -b .continous-flush-stdout
|
||||
#%%patch75 -p1 -b .debug-fix
|
||||
%patch76 -p1 -b .ib-warning
|
||||
#%%patch79 -p1 -b .masqinfo-raw-ip
|
||||
#%%patch80 -p1 -b .makefile-berlios
|
||||
#%%patch81 -p1 -b .slattach-fchown
|
||||
#%%patch82 -p1 -b .hostname-short
|
||||
%patch83 -p1 -b .mii-refactor
|
||||
%patch84 -p1 -b .IA64
|
||||
#%%patch85 -p1 -b .large-indexes
|
||||
#%%patch87 -p1 -b .mii-gigabit
|
||||
%patch88 -p1 -b .netstat-leak
|
||||
|
||||
#%%patch90 -p1 -b .ifdef-vs-if
|
||||
%patch91 -p1 -b .arbitrary-device-names
|
||||
%patch92 -p1 -b .plipconfig
|
||||
%patch93 -p1 -b .p-basename
|
||||
%patch94 -p1 -b .coverity
|
||||
%patch95 -p1 -b .2digit
|
||||
%patch1 -p1 -b .virtualname
|
||||
%patch2 -p1 -b .cycle
|
||||
%patch3 -p1 -b .ipx
|
||||
%patch4 -p1 -b .inet6-lookup
|
||||
%patch5 -p1 -b .man
|
||||
%patch6 -p1 -b .interface
|
||||
%patch7 -p1 -b .return
|
||||
%patch8 -p1 -b .doubleword
|
||||
%patch9 -p1 -b .bcast
|
||||
%patch10 -p1 -b .dup-tcp
|
||||
%patch11 -p1 -b .statalias
|
||||
%patch12 -p1 -b .trim-iface
|
||||
%patch13 -p1 -b .overflow
|
||||
%patch14 -p1 -b .stack
|
||||
%patch15 -p1 -b .selinux
|
||||
%patch16 -p1 -b .fgets
|
||||
%patch17 -p1 -b .x25
|
||||
%patch18 -p1 -b .sctp
|
||||
%patch19 -p1 -b .long_iface
|
||||
%patch20 -p1 -b .strncpy
|
||||
%patch21 -p1 -b .clear-flag
|
||||
%patch22 -p1 -b .probe
|
||||
%patch23 -p1 -b .scanf-format
|
||||
%patch24 -p1 -b .ib-warning
|
||||
%patch25 -p1 -b .mii-refactor
|
||||
%patch26 -p1 -b .IA64
|
||||
%patch27 -p1 -b .netstat-leak
|
||||
%patch28 -p1 -b .arbitrary-device-names
|
||||
%patch29 -p1 -b .plipconfig
|
||||
%patch30 -p1 -b .p-basename
|
||||
%patch31 -p1 -b .coverity
|
||||
%patch32 -p1 -b .2digit
|
||||
|
||||
cp %SOURCE1 ./config.h
|
||||
cp %SOURCE2 ./config.make
|
||||
@ -454,15 +257,16 @@ fi
|
||||
/bin/netstat
|
||||
/sbin/*
|
||||
%{_mandir}/man[58]/*
|
||||
%lang(de) %{_mandir}/de/man[58]/*
|
||||
%lang(fr) %{_mandir}/fr/man[58]/*
|
||||
%lang(pt) %{_mandir}/pt/man[58]/*
|
||||
%lang(de) %{_mandir}/de/man[58]/*
|
||||
%lang(fr) %{_mandir}/fr/man[58]/*
|
||||
%lang(pt) %{_mandir}/pt/man[58]/*
|
||||
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
|
||||
|
||||
%changelog
|
||||
* Wed Nov 23 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-129.20111206git
|
||||
- upstream git snapshot
|
||||
- reduced number of patches from 95 to 32
|
||||
- netstat -T/--notrim option is now -W/--wide
|
||||
|
||||
* Tue Oct 25 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-128
|
||||
- Removed HFI support.
|
||||
|
Loading…
Reference in New Issue
Block a user