Browse Source

net-tools package update

Signed-off-by: basebuilder_pel7x64builder0 <basebuilder@powerel.org>
master
basebuilder_pel7x64builder0 6 years ago
parent
commit
07f660e083
  1. 14
      SOURCES/arp-ethers.service
  2. 139
      SOURCES/ether-wake-interfaces.patch
  3. 81
      SOURCES/ether-wake.8
  4. 392
      SOURCES/ether-wake.c
  5. 34
      SOURCES/ipmaddr.8
  6. 41
      SOURCES/iptunnel.8
  7. 160
      SOURCES/mii-diag.8
  8. 653
      SOURCES/mii-diag.c
  9. 78
      SOURCES/net-tools-config.h
  10. 39
      SOURCES/net-tools-config.make
  11. 605
      SOURCES/net-tools-correct-exit-code.patch
  12. 375
      SOURCES/net-tools-cycle.patch
  13. 146
      SOURCES/net-tools-duplicate-tcp.patch
  14. 28
      SOURCES/net-tools-ifconfig-EiB.patch
  15. 36
      SOURCES/net-tools-ifconfig-long-iface-crasher.patch
  16. 102
      SOURCES/net-tools-interface.patch
  17. 129
      SOURCES/net-tools-interface_stack.patch
  18. 31
      SOURCES/net-tools-ipx.patch
  19. 147
      SOURCES/net-tools-man.patch
  20. 15
      SOURCES/net-tools-netstat-probe.patch
  21. 74
      SOURCES/net-tools-netstat-sctp-man.patch
  22. 33
      SOURCES/net-tools-sctp-quiet.patch
  23. 534
      SOURCES/net-tools-sctp-statistics.patch
  24. 16
      SOURCES/net-tools-statalias.patch
  25. 902
      SPECS/net-tools.spec

14
SOURCES/arp-ethers.service

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
[Unit]
Description=Load static arp entries
Documentation=man:arp(8) man:ethers(5)
ConditionPathExists=/etc/ethers
After=network.service
Before=network.target

[Service]
Type=oneshot
ExecStart=/sbin/arp -f /etc/ethers
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

139
SOURCES/ether-wake-interfaces.patch

@ -0,0 +1,139 @@ @@ -0,0 +1,139 @@
--- a/ether-wake.c 2013-09-03 18:15:13.000000000 +0200
+++ b/ether-wake.c 2013-09-03 17:39:02.000000000 +0200
@@ -22,7 +22,7 @@
" Options:\n"
" -b Send wake-up packet to the broadcast address.\n"
" -D Increase the debug level.\n"
-" -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
+" -i ifname Use interface ifname instead of sending a wake packet to all interfaces.\n"
" -p <pw> Append the four or six byte password PW to the packet.\n"
" A password is only required for a few adapter types.\n"
" The password may be specified in ethernet hex format\n"
@@ -89,6 +89,9 @@
#include <netdb.h>
#include <netinet/ether.h>
+#include "interface.h"
+#include "sockets.h"
+
/* Grrr, no consistency between include versions.
Enable this if setsockopt() isn't declared with your library. */
#if 0
@@ -110,20 +113,29 @@
static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
static int get_wol_pw(const char *optarg);
+typedef struct {
+ int s;
+ int verbose;
+ int pktsize;
+} if_info;
+
+static int send_wol_packet(char *ifname, int s, int verbose, int pktsize);
+
+static int do_wake(struct interface *ife, void *cookie) {
+ if_info *info = (if_info *)cookie;
+ send_wol_packet(ife->name, info->s, info->verbose, info->pktsize);
+ return 0;
+}
+
int main(int argc, char *argv[])
{
- char *ifname = "eth0";
- int one = 1; /* True, for socket options. */
+ char *ifname = NULL;
int s; /* Raw socket */
int errflag = 0, verbose = 0, do_version = 0;
int perm_failure = 0;
- int i, c, pktsize;
-#if defined(PF_PACKET)
- struct sockaddr_ll whereto;
-#else
- struct sockaddr whereto; /* who to wake up */
-#endif
+ int c, pktsize;
struct ether_addr eaddr;
+ if_info info;
while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
switch (c) {
@@ -177,13 +189,45 @@
pktsize = get_fill(outpack, &eaddr);
+ if (ifname == NULL) {
+ info.s = s;
+ info.verbose = verbose;
+ info.pktsize = pktsize;
+
+ /* Create a channel to the NET kernel. */
+ if ((sockets_open(0)) < 0) {
+ perror("socket");
+ exit(1);
+ }
+
+ return for_all_interfaces(do_wake, &info);
+ }
+
+ return send_wol_packet(ifname, s, verbose, pktsize);
+}
+
+/* Send a Wake-On-LAN (WOL) "Magic Packet" to Interface IFNAME using
+ Socket S with a packet size PKTSIZE. VERBOSE implies
+ verbosity. */
+
+static int send_wol_packet(char *ifname, int s, int verbose, int pktsize)
+{
+ int i;
+ int one = 1; /* True, for socket options. */
+#if defined(PF_PACKET)
+ struct sockaddr_ll whereto;
+#else
+ struct sockaddr whereto; /* who to wake up */
+#endif
+
/* Fill in the source address, if possible.
The code to retrieve the local station address is Linux specific. */
if (! opt_no_src_addr) {
struct ifreq if_hwaddr;
- unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
+ char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
- strcpy(if_hwaddr.ifr_name, ifname);
+ strncpy(if_hwaddr.ifr_name, ifname, IFNAMSIZ);
+ if_hwaddr.ifr_name[IFNAMSIZ-1] = '\0';
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
strerror(errno));
@@ -220,7 +264,8 @@
#if defined(PF_PACKET)
{
struct ifreq ifr;
- strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ ifr.ifr_name[IFNAMSIZ-1] = '\0';
if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
strerror(errno));
--- a/Makefile 2013-09-03 13:15:22.531951613 +0100
+++ b/Makefile 2013-09-03 13:24:29.659823455 +0100
@@ -188,6 +188,8 @@
mii-tool: $(NET_LIB) mii-tool.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(RESLIB)
+ether-wake: $(NET_LIB) ether-wake.o
+ $(CC) $(LDFLAGS) -o ether-wake ether-wake.o $(NLIB)
installbin:
@echo
@echo "######################################################"
--- a/man/en_US/ether-wake.8 2013-09-03 13:15:22.576952098 +0100
+++ b/man/en_US/ether-wake.8 2013-09-03 13:14:55.270657575 +0100
@@ -49,7 +49,7 @@
Increase the Debug Level.
.TP
.B \-i ifname
-Use interface ifname instead of the default "eth0".
+Use interface ifname instead of sending a wake packet to all interfaces.
.TP
.B \-p passwd
Append a four or six byte password to the packet. Only a few adapters

81
SOURCES/ether-wake.8

@ -0,0 +1,81 @@ @@ -0,0 +1,81 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH ETHER-WAKE 8 "March 31, 2003" "Scyld"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
ether-wake \- A tool to send a Wake-On-LAN "Magic Packet"
.SH SYNOPSIS
.B ether-wake
.RI [ options ] " Host-ID"
.SH DESCRIPTION
This manual page documents the usage of the
.B ether-wake
command.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
\fBether-wake\fP is a program that generates and transmits a Wake-On-LAN
(WOL) "Magic Packet", used for restarting machines that have been
soft-powered-down (ACPI D3-warm state). It generates the standard
AMD Magic Packet format, optionally with a password included. The
single required parameter is a station (MAC) address or a host ID that can
be translated to a MAC address by an
.BR ethers (5)
database specified in
.BR nsswitch.conf (5)
.
.SH OPTIONS
\fBether-wake\fP needs a single dash (´-´) in front of options.
A summary of options is included below.
.TP
.B \-b
Send the wake-up packet to the broadcast address.
.TP
.B \-D
Increase the Debug Level.
.TP
.B \-i ifname
Use interface ifname instead of the default "eth0".
.TP
.B \-p passwd
Append a four or six byte password to the packet. Only a few adapters
need or support this. A six byte password may be specified in Ethernet hex
format (00:22:44:66:88:aa) or four byte dotted decimal (192.168.1.1) format.
A four byte password must use the dotted decimal format.

.TP
.B \-V
Show the program version information.

.SH EXIT STATUS
This program returns 0 on success.
A permission failures (e.g. run as a non-root user) results in an exit
status of 2. Unrecognized or invalid parameters result in an exit
status of 3. Failure to retrieve network interface information or send
a packet will result in an exit status of 1.

.SH SEE ALSO
.BR arp (8).
.br
.SH SECURITY
On some non-Linux systems dropping root capability allows the process to be
dumped, traced or debugged.
If someone traces this program, they get control of a raw socket.
Linux handles this safely, but beware when porting this program.
.SH AUTHOR
The ether-wake program was written by Donald Becker at Scyld Computing
Corporation for use with the Scyld(\*(Tm) Beowulf System.

392
SOURCES/ether-wake.c

@ -0,0 +1,392 @@ @@ -0,0 +1,392 @@
/* ether-wake.c: Send a magic packet to wake up sleeping machines. */

static char version_msg[] =
"ether-wake.c: v1.09 11/12/2003 Donald Becker, http://www.scyld.com/";
static char brief_usage_msg[] =
"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
" Use '-u' to see the complete set of options.\n";
static char usage_msg[] =
"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
"\n"
" This program generates and transmits a Wake-On-LAN (WOL)\n"
" \"Magic Packet\", used for restarting machines that have been\n"
" soft-powered-down (ACPI D3-warm state).\n"
" It currently generates the standard AMD Magic Packet format, with\n"
" an optional password appended.\n"
"\n"
" The single required parameter is the Ethernet MAC (station) address\n"
" of the machine to wake or a host ID with known NSS 'ethers' entry.\n"
" The MAC address may be found with the 'arp' program while the target\n"
" machine is awake.\n"
"\n"
" Options:\n"
" -b Send wake-up packet to the broadcast address.\n"
" -D Increase the debug level.\n"
" -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
" -p <pw> Append the four or six byte password PW to the packet.\n"
" A password is only required for a few adapter types.\n"
" The password may be specified in ethernet hex format\n"
" or dotted decimal (Internet address)\n"
" -p 00:22:44:66:88:aa\n"
" -p 192.168.1.1\n";

/*
This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet",
used for restarting machines that have been soft-powered-down
(ACPI D3-warm state). It currently generates the standard AMD Magic Packet
format, with an optional password appended.

This software may be used and distributed according to the terms
of the GNU Public License, incorporated herein by reference.
Contact the author for use under other terms.

This source file was originally part of the network tricks package, and
is now distributed to support the Scyld Beowulf system.
Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.

The author may be reached as becker@scyld, or C/O
Scyld Computing Corporation
914 Bay Ridge Road, Suite 220
Annapolis MD 21403

Notes:
On some systems dropping root capability allows the process to be
dumped, traced or debugged.
If someone traces this program, they get control of a raw socket.
Linux handles this safely, but beware when porting this program.

An alternative to needing 'root' is using a UDP broadcast socket, however
doing so only works with adapters configured for unicast+broadcast Rx
filter. That configuration consumes more power.
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>

#if 0 /* Only exists on some versions. */
#include <ioctls.h>
#endif

#include <sys/socket.h>

#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/if.h>

#include <features.h>
#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
#include <netpacket/packet.h>
#include <net/ethernet.h>
#else
#include <asm/types.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#endif
#include <netdb.h>
#include <netinet/ether.h>

/* Grrr, no consistency between include versions.
Enable this if setsockopt() isn't declared with your library. */
#if 0
extern int setsockopt __P ((int __fd, int __level, int __optname,
__ptr_t __optval, int __optlen));
#else /* New, correct head files. */
#include <sys/socket.h>
#endif

u_char outpack[1000];
int outpack_sz = 0;
int debug = 0;
u_char wol_passwd[6];
int wol_passwd_sz = 0;

static int opt_no_src_addr = 0, opt_broadcast = 0;

static int get_dest_addr(const char *arg, struct ether_addr *eaddr);
static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
static int get_wol_pw(const char *optarg);

int main(int argc, char *argv[])
{
char *ifname = "eth0";
int one = 1; /* True, for socket options. */
int s; /* Raw socket */
int errflag = 0, verbose = 0, do_version = 0;
int perm_failure = 0;
int i, c, pktsize;
#if defined(PF_PACKET)
struct sockaddr_ll whereto;
#else
struct sockaddr whereto; /* who to wake up */
#endif
struct ether_addr eaddr;

while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
switch (c) {
case 'b': opt_broadcast++; break;
case 'D': debug++; break;
case 'i': ifname = optarg; break;
case 'p': get_wol_pw(optarg); break;
case 'u': printf(usage_msg); return 0;
case 'v': verbose++; break;
case 'V': do_version++; break;
case '?':
errflag++;
}
if (verbose || do_version)
printf("%s\n", version_msg);
if (errflag) {
fprintf(stderr, brief_usage_msg);
return 3;
}

if (optind == argc) {
fprintf(stderr, "Specify the Ethernet address as 00:11:22:33:44:55.\n");
return 3;
}

/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
work as non-root, but we need SOCK_PACKET to specify the Ethernet
destination address. */
#if defined(PF_PACKET)
s = socket(PF_PACKET, SOCK_RAW, 0);
#else
s = socket(AF_INET, SOCK_PACKET, SOCK_PACKET);
#endif
if (s < 0) {
if (errno == EPERM)
fprintf(stderr, "ether-wake: This program must be run as root.\n");
else
perror("ether-wake: socket");
perm_failure++;
}
/* Don't revert if debugging allows a normal user to get the raw socket. */
setuid(getuid());

/* We look up the station address before reporting failure so that
errors may be reported even when run as a normal user.
*/
if (get_dest_addr(argv[optind], &eaddr) != 0)
return 3;
if (perm_failure && ! debug)
return 2;

pktsize = get_fill(outpack, &eaddr);

/* Fill in the source address, if possible.
The code to retrieve the local station address is Linux specific. */
if (! opt_no_src_addr) {
struct ifreq if_hwaddr;
unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;

strcpy(if_hwaddr.ifr_name, ifname);
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
strerror(errno));
/* Magic packets still work if our source address is bogus, but
we fail just to be anal. */
return 1;
}
memcpy(outpack+6, if_hwaddr.ifr_hwaddr.sa_data, 6);

if (verbose) {
printf("The hardware address (SIOCGIFHWADDR) of %s is type %d "
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n", ifname,
if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
}
}

if (wol_passwd_sz > 0) {
memcpy(outpack+pktsize, wol_passwd, wol_passwd_sz);
pktsize += wol_passwd_sz;
}

if (verbose > 1) {
printf("The final packet is: ");
for (i = 0; i < pktsize; i++)
printf(" %2.2x", outpack[i]);
printf(".\n");
}

/* This is necessary for broadcasts to work */
if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&one, sizeof(one)) < 0)
perror("setsockopt: SO_BROADCAST");

#if defined(PF_PACKET)
{
struct ifreq ifr;
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
strerror(errno));
return 1;
}
memset(&whereto, 0, sizeof(whereto));
whereto.sll_family = AF_PACKET;
whereto.sll_ifindex = ifr.ifr_ifindex;
/* The manual page incorrectly claims the address must be filled.
We do so because the code may change to match the docs. */
whereto.sll_halen = ETH_ALEN;
memcpy(whereto.sll_addr, outpack, ETH_ALEN);

}
#else
whereto.sa_family = 0;
strcpy(whereto.sa_data, ifname);
#endif

if ((i = sendto(s, outpack, pktsize, 0, (struct sockaddr *)&whereto,
sizeof(whereto))) < 0)
perror("sendto");
else if (debug)
printf("Sendto worked ! %d.\n", i);

#ifdef USE_SEND
if (bind(s, (struct sockaddr *)&whereto, sizeof(whereto)) < 0)
perror("bind");
else if (send(s, outpack, 100, 0) < 0)
perror("send");
#endif
#ifdef USE_SENDMSG
{
struct msghdr msghdr = { 0,};
struct iovec iovector[1];
msghdr.msg_name = &whereto;
msghdr.msg_namelen = sizeof(whereto);
msghdr.msg_iov = iovector;
msghdr.msg_iovlen = 1;
iovector[0].iov_base = outpack;
iovector[0].iov_len = pktsize;
if ((i = sendmsg(s, &msghdr, 0)) < 0)
perror("sendmsg");
else if (debug)
printf("sendmsg worked, %d (%d).\n", i, errno);
}
#endif

return 0;
}

/* Convert the host ID string to a MAC address.
The string may be a
Host name
IP address string
MAC address string
*/

static int get_dest_addr(const char *hostid, struct ether_addr *eaddr)
{
struct ether_addr *eap;

eap = ether_aton(hostid);
if (eap) {
*eaddr = *eap;
if (debug)
fprintf(stderr, "The target station address is %s.\n",
ether_ntoa(eaddr));
} else if (ether_hostton(hostid, eaddr) == 0) {
if (debug)
fprintf(stderr, "Station address for hostname %s is %s.\n",
hostid, ether_ntoa(eaddr));
} else {
(void)fprintf(stderr,
"ether-wake: The Magic Packet host address must be "
"specified as\n"
" - a station address, 00:11:22:33:44:55, or\n"
" - a hostname with a known 'ethers' entry.\n");
return -1;
}
return 0;
}


static int get_fill(unsigned char *pkt, struct ether_addr *eaddr)
{
int offset, i;
unsigned char *station_addr = eaddr->ether_addr_octet;

if (opt_broadcast)
memset(pkt+0, 0xff, 6);
else
memcpy(pkt, station_addr, 6);
memcpy(pkt+6, station_addr, 6);
pkt[12] = 0x08; /* Or 0x0806 for ARP, 0x8035 for RARP */
pkt[13] = 0x42;
offset = 14;

memset(pkt+offset, 0xff, 6);
offset += 6;

for (i = 0; i < 16; i++) {
memcpy(pkt+offset, station_addr, 6);
offset += 6;
}
if (debug) {
fprintf(stderr, "Packet is ");
for (i = 0; i < offset; i++)
fprintf(stderr, " %2.2x", pkt[i]);
fprintf(stderr, ".\n");
}
return offset;
}

static int get_wol_pw(const char *optarg)
{
int passwd[6];
int byte_cnt;
int i;

byte_cnt = sscanf(optarg, "%2x:%2x:%2x:%2x:%2x:%2x",
&passwd[0], &passwd[1], &passwd[2],
&passwd[3], &passwd[4], &passwd[5]);
if (byte_cnt < 4)
byte_cnt = sscanf(optarg, "%d.%d.%d.%d",
&passwd[0], &passwd[1], &passwd[2], &passwd[3]);
if (byte_cnt < 4) {
fprintf(stderr, "Unable to read the Wake-On-LAN password.\n");
return 0;
}
printf(" The Magic packet password is %2.2x %2.2x %2.2x %2.2x (%d).\n",
passwd[0], passwd[1], passwd[2], passwd[3], byte_cnt);
for (i = 0; i < byte_cnt; i++)
wol_passwd[i] = passwd[i];
return wol_passwd_sz = byte_cnt;
}

#if 0
{
to = (struct sockaddr_in *)&whereto;
to->sin_family = AF_INET;
if (inet_aton(target, &to->sin_addr)) {
hostname = target;
}
memset (&sa, 0, sizeof sa);
sa.sa_family = AF_INET;
strncpy (sa.sa_data, interface, sizeof sa.sa_data);
sendto (sock, buf, bufix + len, 0, &sa, sizeof sa);
strncpy (sa.sa_data, interface, sizeof sa.sa_data);
#if 1
sendto (sock, buf, bufix + len, 0, &sa, sizeof sa);
#else
bind (sock, &sa, sizeof sa);
connect();
send (sock, buf, bufix + len, 0);
#endif
}
#endif

/*
* Local variables:
* compile-command: "gcc -O -Wall -o ether-wake ether-wake.c"
* c-indent-level: 4
* c-basic-offset: 4
* c-indent-level: 4
* tab-width: 4
* End:
*/

34
SOURCES/ipmaddr.8

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
.\" Process this file with
.\" groff -man -Tascii ipmaddr.8
.\"
.TH IPMADDR 8 "SEPTEMBER 2009" "" ""
.\"
.\" Man page written by Jiri Popelka <jpopelka AT redhat DOT com>
.\"
.SH NAME
.B ipmaddr
\- adds, deletes, and displays multicast addresses
.SH SYNOPSIS
.B /usr/sbin/ipmaddr
.RB [< operation >]
.RB [< args >]

.SH NOTE
.P
This program is obsolete. For replacement check \fBip maddr\fR.

.SH DESCRIPTION
The \fBipmaddr\fR command can perform one of the following operations:

.B add
\- add a multicast address

.B del
\- delete a multicast address

.B show
\- list multicast addresses

.SH SEE ALSO
.BR ip (8).

41
SOURCES/iptunnel.8

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
.\" Process this file with
.\" groff -man -Tascii iptunnel.8
.\"
.TH IPTUNNEL 8 "SEPTEMBER 2009" "" ""
.\"
.\" Man page written by Jiri Popelka <jpopelka AT redhat DOT com>
.\"
.SH NAME
.B iptunnel
\- creates, deletes, and displays configured tunnels

.SH SYNOPSIS
.B /usr/sbin/iptunnel
.RB [< operation >]
.RB [< args >]

.SH NOTE
.P
This program is obsolete. For replacement check \fBip tunnel\fR.

.SH DESCRIPTION
The \fBiptunnel\fR
command creates configured tunnels for sending and receiving
IPV6 or IPV4 packets that are encapsulated as the payload of an IPV4
datagram.

The
.B iptunnel
command can perform one of the following operations:

.B create
\- create a tunnel interface, which you must subsequently configure.

.B delete
\- delete a tunnel interface. You must disable the tunnel before you can delete it.

.B show
\- show the tunnel attributes (name, tunnel end points, next hop for tunneled packets).

.SH SEE ALSO
.BR ip (8).

160
SOURCES/mii-diag.8

@ -0,0 +1,160 @@ @@ -0,0 +1,160 @@
.\" Hey, EMACS: -*- nroff -*-
.\" $Revision: 1.1 $ $Date: 2003/09/06 17:20:17 $
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH MII-DIAG 8 "September 9, 2003" "Scyld Beowulf\[tm]"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
mii-diag \- Network adapter control and monitoring
.SH SYNOPSIS
.B mii-diag
.RI [ options ] <interface>
.SH DESCRIPTION
This manual page documents briefly the
.B mii-diag
network adapter control and monitoring command.
Addition documentation is available from http://scyld.com/diag/index.html.

.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
.PP
This \fBmii-diag\fP command configures, controls and monitors the
transceiver management registers for network interfaces, and configures
driver operational parameters. For transceiver control \fBmii-diag\fP
uses the Media Independent Interface (MII) standard (thus the command name).
It also has additional Linux-specific controls to communicate parameters
such as message enable settings and buffer sizes to the underlying device
driver.
.PP
The MII standard defines registers that control and report network
transceiver capabilities, link settings and errors. Examples are link
speed, duplex, capabilities advertised to the link partner, status LED
indications and link error counters.

.SH OPTIONS
The \fBmii-diag\fP command supports both single character and long
option names. Short options use a single dash (´-´) in front of the option
character. For options without parameters, multiple options may be
concatenated after a single dash. Long options are prefixed by two
dashes (´--´), and may be abbreviated with a unique prefix.
A long option may take a parameter of the form --arg=param or --arg param.

.PP
A summary of options is as follows.

.TP
.B \-A, --advertise <speed|setting>
.BR
.B \-F, --fixed-speed <speed|setting>

Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD, 10baseT,
10baseT-FD, 10baseT-HD. For more precise control an explicit numeric
register setting is also allowed.


.TP
.B \-a, \--all-interfaces
Show the status of all interfaces. This option is not recommended with
any other option, especially ones that change settings.

.TP
.B \-s,\--status
Return exit status 2 if there is no link beat.

.TP
.B \-D
Increase the debugging level. This may be used to understand the
actions the command is taking.

.TP
.B \-g, \--read-parameters
Show driver-specific parameters.

.TP
.B \-G, \--set-parameters value[,value...]
Set driver-specific parameters.
Set a adapter-specific parameters.
Parameters are comma separated, with missing elements retaining the
existing value.

.TP
.B \-v
Increase the verbosity level. Additional "-v" options increase the
level further.

.TP
.B \-V
Show the program version information.

.TP
.B \-w, \--watch
Continuously monitor the transceiver and report changes.

.TP
.B \-?
Emit usage information.

.SH DESCRIPTION

.PP
Calling the command with just the interface name
produces extensive output describing the transceiver
capabilities, configuration and current status.

.PP
The '--monitor' option allows scripting link beat changes.
.PP
This option is similar to --watch, but with lower overhead and simplified
output. It polls the interface only once a second and the output format
is a single line per link change with three fixed words
<unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
.PP
Example output: mii-diag --monitor eth0
down 0x7809 0x0000
negotiating 0x7829 0x45e1
up 0x782d 0x45e1
down 0x7809 0x0000

.PP
This may be used as
mii-diag --monitor eth0 |
while read linkstatus bmsr linkpar; do
case $linkstatus in
up) ifup eth0 ;;
down) ifdown eth0 ;;
esac
done

.PP
It may be useful to shorten the DHCP client daemon timeout if it does
not receive an address by adding the following setting to
/etc/sysconfig/network:
DHCPCDARGS="-t 3"

.SH SEE ALSO
.BR ether-wake (8), net-diag (8), mii-tool (8).
.br
Addition documentation is available from http://scyld.com/diag/index.html.

.SH KNOWN BUGS
The --all-interfaces option is quirky. There are very few settings that
are usefully applied to all interfaces.

.SH AUTHOR
The manual pages, diagnostic commands, and many of the underlying Linux
network drivers were written by Donald Becker for the Scyld
Beowulf(\*(Tm) cluster system.

653
SOURCES/mii-diag.c

@ -0,0 +1,653 @@ @@ -0,0 +1,653 @@
/* Mode: C;
* mii-diag.c: Examine and set the MII registers of a network interfaces.

Usage: mii-diag [-vw] interface.

This program reads and writes the Media Independent Interface (MII)
management registers on network transceivers. The registers control
and report network link settings and errors. Examples are link speed,
duplex, capabilities advertised to the link partner, status LED
indications and link error counters.

Notes:
The compile-command is at the end of this source file.
This program works with drivers that implement MII ioctl() calls.

Written/copyright 1997-2003 by Donald Becker <becker@scyld.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.

The author may be reached as becker@scyld.com, or C/O
Scyld Computing Corporation
914 Bay Ridge Road, Suite 220
Annapolis MD 21403

References
http://scyld.com/expert/mii-status.html
http://scyld.com/expert/NWay.html
http://www.national.com/pf/DP/DP83840.html
*/

static char version[] =
"mii-diag.c:v2.11 3/21/2005 Donald Becker (becker@scyld.com)\n"
" http://www.scyld.com/diag/index.html\n";

static const char usage_msg[] =
"Usage: %s [--help] [-aDfrRvVw] [-AF <speed+duplex>] [--watch] <interface>\n";
static const char long_usage_msg[] =
"Usage: %s [-aDfrRvVw] [-AF <speed+duplex>] [--watch] <interface>\n\
\n\
This program configures and monitors the transceiver management registers\n\
for network interfaces. It uses the Media Independent Interface (MII)\n\
standard with additional Linux-specific controls to communicate with the\n\
underlying device driver. The MII registers control and report network\n\
link settings and errors. Examples are link speed, duplex, capabilities\n\
advertised to the link partner, status LED indications and link error\n\
counters.\n\
\n\
The common usage is\n\
mii-diag eth0\n\
\n\
Frequently used options are\n\
-A --advertise <speed|setting>\n\
-F --fixed-speed <speed>\n\
Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD,\n\
10baseT, 10baseT-FD, 10baseT-HD\n\
-s --status Return exit status 2 if there is no link beat.\n\
\n\
Less frequently used options are\n\
-a --all-interfaces Show the status all interfaces\n\
(Not recommended with options that change settings.)\n\
-D --debug\n\
-g --read-parameters Get driver-specific parameters.\n\
-G --set-parameters PARMS Set driver-specific parameters.\n\
Parameters are comma separated, missing parameters retain\n\
their previous values.\n\
-M --msg-level LEVEL Set the driver message bit map.\n\
-p --phy ADDR Set the PHY (MII address) to report.\n\
-r --restart Restart the link autonegotiation.\n\
-R --reset Reset the transceiver.\n\
-v --verbose Report each action taken.\n\
-V --version Emit version information.\n\
-w --watch Continuously monitor the transceiver and report changes.\n\
\n\
This command returns success (zero) if the interface information can be\n\
read. If the --status option is passed, a zero return means that the\n\
interface has link beat.\n\
";

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#ifdef use_linux_libc5
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#endif

typedef u_int32_t u32;
typedef u_int16_t u16;
typedef u_int8_t u8;

#if defined(SIOCGPARAMS) && SIOCGPARAMS != SIOCDEVPRIVATE+3
#error Changed definition for SIOCGPARAMS
#else
#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters. */
#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters. */
#endif

const char shortopts[] = "aA:C:DfF:gG:hmM:p:rRsvVw?";
struct option longopts[] = {
/* { name has_arg *flag val } */
{"all-interfaces", 0, 0, 'a'}, /* Show all interfaces. */
{"advertise", 1, 0, 'A'}, /* Change the capabilities advertised. */
{"BMCR", 1, 0, 'C'}, /* Set the control register. */
{"debug", 0, 0, 'D'}, /* Increase the debug level. */
{"force", 0, 0, 'f'}, /* Force the operation. */
{"fixed-speed", 1, 0, 'F'}, /* Fixed speed name. */
{"read-parameters", 0, 0, 'g'}, /* Show general settings values. */
{"set-parameters", 1, 0, 'G'}, /* Write general settings values. */
{"help", 0, 0, 'h'}, /* Print a long usage message. */
{"monitor", 0, 0, 'm'}, /* Monitor status register. */
{"msg-level", 1, 0, 'M'}, /* Set the driver message level. */
{"phy", 1, 0, 'p'}, /* Set the PHY (MII address) to report. */
{"restart", 0, 0, 'r'}, /* Restart the link negotiation */
{"reset", 0, 0, 'R'}, /* Reset the transceiver. */
{"status", 0, 0, 's'}, /* Non-zero exit status w/ no link beat. */
{"verbose", 0, 0, 'v'}, /* Report each action taken. */
{"version", 0, 0, 'V'}, /* Emit version information. */
{"watch", 0, 0, 'w'}, /* Constantly monitor the port. */
{"error", 0, 0, '?'}, /* Return the error message. */
{ 0, 0, 0, 0 }
};

/* Usually in libmii.c, but trivial substitions are below. */
extern int show_mii_details(long ioaddr, int phy_id);
extern void monitor_mii(long ioaddr, int phy_id);
int show_mii_details(long ioaddr, int phy_id) __attribute__((weak));
void monitor_mii(long ioaddr, int phy_id) __attribute__((weak));


/* Command-line flags. */
unsigned int opt_a = 0, /* Show-all-interfaces flag. */
opt_f = 0, /* Force the operation. */
opt_g = 0,
opt_G = 0,
verbose = 0, /* Verbose flag. */
debug = 0,
opt_version = 0,
opt_restart = 0,
opt_reset = 0,
opt_status = 0,
opt_watch = 0;
static int msg_level = -1;
static int set_BMCR = -1;
static int nway_advertise = 0;
static int fixed_speed = -1;
static int override_phy = -1;
char *opt_G_string = NULL;

/* Internal values. */
int new_ioctl_nums;
int skfd = -1; /* AF_INET socket for ioctl() calls. */
struct ifreq ifr;

int do_one_xcvr(int skfd);
int show_basic_mii(long ioaddr, int phy_id);
int mdio_read(int skfd, int phy_id, int location);
void mdio_write(int skfd, int phy_id, int location, int value);
static int parse_advertise(const char *capabilities);
static void monitor_status(long ioaddr, int phy_id);


int
main(int argc, char **argv)
{
int c, errflag = 0;
char **spp, *ifname;
char *progname = rindex(argv[0], '/') ? rindex(argv[0], '/')+1 : argv[0];

while ((c = getopt_long(argc, argv, shortopts, longopts, 0)) != EOF)
switch (c) {
case 'a': opt_a++; break;
case 'A': nway_advertise |= parse_advertise(optarg);
if (nway_advertise == -1) errflag++;
break;
case 'C': set_BMCR = strtoul(optarg, NULL, 16); break;
case 'D': debug++; break;
case 'f': opt_f++; break;
case 'F': fixed_speed = parse_advertise(optarg);
if (fixed_speed == -1) errflag++;
break;
case 'g': opt_g++; break;
case 'G': opt_G++; opt_G_string = strdup(optarg); break;
case 'm': opt_watch++; opt_status++; break;
case 'M': msg_level = strtoul(optarg, NULL, 0); break;
case 'h': fprintf(stderr, long_usage_msg, progname); return 0;
case 'p': override_phy = atoi(optarg); break;
case 'r': opt_restart++; break;
case 'R': opt_reset++; break;
case 's': opt_status++; break;
case 'v': verbose++; break;
case 'V': opt_version++; break;
case 'w': opt_watch++; break;
case '?': errflag++; break;
}
if (errflag) {
fprintf(stderr, usage_msg, progname);
return 2;
}

if (verbose || opt_version)
printf(version);

/* Open a basic socket. */
if ((skfd = socket(AF_INET, SOCK_DGRAM,0)) < 0) {
perror("socket");
return 1;
}

if (debug)
fprintf(stderr, "DEBUG: argc=%d, optind=%d and argv[optind] is %s.\n",
argc, optind, argv[optind]);

/* No remaining args means interface wasn't specified. */
if (optind == argc) {
fprintf(stderr, "No interface specified.\n");
fprintf(stderr, usage_msg, progname);
(void) close(skfd);
return 2;
} else {
/* Copy the interface name. */
spp = argv + optind;
ifname = *spp++;
}

if (ifname == NULL) {
fprintf(stderr, "No ifname.\n");
(void) close(skfd);
return -1;
}

/* Verify that the interface supports the ioctl(), and if
it is using the new or old SIOCGMIIPHY value (grrr...).
*/
{
u16 *data = (u16 *)(&ifr.ifr_data);

strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ-1] = '\0';
data[0] = 0;

if (ioctl(skfd, 0x8947, &ifr) >= 0) {
new_ioctl_nums = 1;
} else if (ioctl(skfd, SIOCDEVPRIVATE, &ifr) >= 0) {
new_ioctl_nums = 0;
} else {
fprintf(stderr, "SIOCGMIIPHY on %s failed: %s\n", ifname,
strerror(errno));
(void) close(skfd);
return 1;
}
if (verbose)
printf(" Using the %s SIOCGMIIPHY value on PHY %d "
"(BMCR 0x%4.4x).\n",
new_ioctl_nums ? "new" : "old", data[0], data[3]);
}

do_one_xcvr(skfd);

(void) close(skfd);
return 0;
}

int do_one_xcvr(int skfd)
{
u16 *data = (u16 *)(&ifr.ifr_data);
u32 *data32 = (u32 *)(&ifr.ifr_data);
unsigned phy_id = data[0];

if (override_phy >= 0) {
printf("Using the specified MII PHY index %d.\n", override_phy);
phy_id = override_phy;
}

if (opt_g || opt_G || msg_level >= 0) {
if (ioctl(skfd, SIOCGPARAMS, &ifr) < 0) {
fprintf(stderr, "SIOCGPARAMS on %s failed: %s\n", ifr.ifr_name,
strerror(errno));
return -1;
}
}
if (opt_g) {
int i;
printf("Driver general parameter settings:");
for (i = 0; i*sizeof(u32) < sizeof(ifr.ifr_ifru); i++) {
printf(" %d", data32[i]);
}
printf(".\n");
}
if (opt_G) {
/* Set up to four arbitrary driver parameters from the -G parameter.
The format is comma separated integers, with a missing element
retaining the previous value.
*/
char *str = opt_G_string;
int i;
for (i = 0; str && i < 4; i++) {
char *endstr;
u32 newval = strtol(str, &endstr, 0);
if (debug)
printf(" parse string '%s' value %d end '%s'.\n",
str, newval, endstr);
if (str == endstr) {
if (endstr[0] == ',') /* No parameter */
str = endstr+1;
else {
fprintf(stderr, "Invalid driver parameter '%s'.\n", str);
str = index(str, ',');
}
} else if (endstr[0] == ',') {
data32[i] = newval;
str = endstr + 1;
} else if (endstr[0] == 0) {
data32[i] = newval;
break;
}
}
printf("Setting new driver general parameters:");
for (i = 0; i*sizeof(u32) < sizeof(ifr.ifr_ifru); i++) {
printf(" %d", data32[i]);
}
printf(".\n");
if (ioctl(skfd, SIOCSPARAMS, &ifr) < 0) {
fprintf(stderr, "SIOCSPARAMS on %s failed: %s\n", ifr.ifr_name,
strerror(errno));
return -1;
}
}
if (msg_level >= 0) {
data32[0] = msg_level;
if (ioctl(skfd, SIOCSPARAMS, &ifr) < 0) {
fprintf(stderr, "SIOCSPARAMS on %s failed: %s\n", ifr.ifr_name,
strerror(errno));
return -1;
}
}

if (opt_reset) {
printf("Resetting the transceiver...\n");
mdio_write(skfd, phy_id, 0, 0x8000);
}
/* Note: PHY addresses > 32 are pseudo-MII devices, usually built-in. */
if (phy_id < 64 && nway_advertise > 0) {
printf(" Setting the media capability advertisement register of "
"PHY #%d to 0x%4.4x.\n", phy_id, nway_advertise | 1);
mdio_write(skfd, phy_id, 4, nway_advertise | 1);
mdio_write(skfd, phy_id, 0, 0x1000);
}

if (opt_restart) {
printf("Restarting negotiation...\n");
mdio_write(skfd, phy_id, 0, 0x0000);
mdio_write(skfd, phy_id, 0, 0x1200);
}
/* To force 100baseTx-HD do mdio_write(skfd, phy_id, 0, 0x2000); */
if (fixed_speed >= 0) {
int reg0_val = 0;
if (fixed_speed & 0x0180) /* 100mpbs */
reg0_val |= 0x2000;
if ((fixed_speed & 0x0140) && /* A full duplex type and */
! (fixed_speed & 0x0820)) /* no half duplex types. */
reg0_val |= 0x0100;
printf("Setting the speed to \"fixed\", Control register %4.4x.\n",
reg0_val);
mdio_write(skfd, phy_id, 0, reg0_val);
}
if (set_BMCR >= 0) {
printf("Setting the Basic Mode Control Register to 0x%4.4x.\n",
set_BMCR);
mdio_write(skfd, phy_id, 0, set_BMCR);
}

if (opt_watch && opt_status)
monitor_status(skfd, phy_id);

show_basic_mii(skfd, phy_id);
#ifdef LIBMII
if (verbose)
show_mii_details(skfd, phy_id);
#else
if (verbose || debug) {
int mii_reg, mii_val;
printf(" MII PHY #%d transceiver registers:", phy_id);
for (mii_reg = 0; mii_reg < 32; mii_reg++) {
mii_val = mdio_read(skfd, phy_id, mii_reg);
printf("%s %4.4x", (mii_reg % 8) == 0 ? "\n " : "",
mii_val);
}
printf("\n");
}
#endif

if (opt_watch)
monitor_mii(skfd, phy_id);
if (opt_status &&
(mdio_read(skfd, phy_id, 1) & 0x0004) == 0)
exit(2);
return 0;
}

int mdio_read(int skfd, int phy_id, int location)
{
u16 *data = (u16 *)(&ifr.ifr_data);

data[0] = phy_id;
data[1] = location;

if (ioctl(skfd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) < 0) {
fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno));
return -1;
}
return data[3];
}

void mdio_write(int skfd, int phy_id, int location, int value)
{
u16 *data = (u16 *)(&ifr.ifr_data);

data[0] = phy_id;
data[1] = location;
data[2] = value;

if (ioctl(skfd, new_ioctl_nums ? 0x8949 : SIOCDEVPRIVATE+2, &ifr) < 0) {
fprintf(stderr, "SIOCSMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno));
}
}

/* Parse the command line argument for advertised capabilities. */
static int parse_advertise(const char *capabilities)
{
const char *mtypes[] = {
"100baseT4", "100baseTx", "100baseTx-FD", "100baseTx-HD",
"10baseT", "10baseT-FD", "10baseT-HD", 0,
};
char *endptr;
int cap_map[] = { 0x0200, 0x0180, 0x0100, 0x0080, 0x0060, 0x0040, 0x0020,};
int i;
if ( ! capabilities) {
fprintf(stderr, "You passed -A 'NULL'. You must provide a media"
" list to advertise!\n");
return -1;
}
if (debug)
fprintf(stderr, "Advertise string is '%s'.\n", capabilities);
for (i = 0; mtypes[i]; i++)
if (strcasecmp(mtypes[i], capabilities) == 0)
return cap_map[i];
if ((i = strtol(capabilities, &endptr, 16)) <= 0xffff && endptr[0] == 0)
return i;
fprintf(stderr, "Invalid media advertisement value '%s'.\n"
" Either pass a numeric value or one of the following names:\n",
capabilities);
for (i = 0; mtypes[i]; i++)
fprintf(stderr, " %-14s %3.3x\n", mtypes[i], cap_map[i]);
return -1;
}

/* Trivial versions if we don't link against libmii.c */
static const char *media_names[] = {
"10baseT", "10baseT-FD", "100baseTx", "100baseTx-FD", "100baseT4",
"Flow-control", 0,
};
/* Various non-good bits in the command register. */
static const char *bmcr_bits[] = {
" Internal Collision-Test enabled!\n", "", /* 0x0080,0x0100 */
" Restarted auto-negotiation in progress!\n",
" Transceiver isolated from the MII!\n",
" Transceiver powered down!\n", "", "",
" Transceiver in loopback mode!\n",
" Transceiver currently being reset!\n",
};

int show_basic_mii(long ioaddr, int phy_id)
{
int mii_reg, i;
u16 mii_val[32];
u16 bmcr, bmsr, new_bmsr, nway_advert, lkpar;

for (mii_reg = 0; mii_reg < 8; mii_reg++)
mii_val[mii_reg] = mdio_read(ioaddr, phy_id, mii_reg);
if ( ! verbose) {
printf("Basic registers of MII PHY #%d: ", phy_id);
for (mii_reg = 0; mii_reg < 8; mii_reg++)
printf(" %4.4x", mii_val[mii_reg]);
printf(".\n");
}

if (mii_val[0] == 0xffff || mii_val[1] == 0x0000) {
printf(" No MII transceiver present!.\n");
if (! opt_f) {
printf(" Use '--force' to view the information anyway.\n");
return -1;
}
}
/* Descriptive rename. */
bmcr = mii_val[0];
bmsr = mii_val[1];
nway_advert = mii_val[4];
lkpar = mii_val[5];

if (lkpar & 0x4000) {
int negotiated = nway_advert & lkpar & 0x3e0;
int max_capability = 0;
/* Scan for the highest negotiated capability, highest priority
(100baseTx-FDX) to lowest (10baseT-HDX). */
int media_priority[] = {8, 9, 7, 6, 5}; /* media_names[i-5] */
printf(" The autonegotiated capability is %4.4x.\n", negotiated);
for (i = 0; media_priority[i]; i++)
if (negotiated & (1 << media_priority[i])) {
max_capability = media_priority[i];
break;
}
if (max_capability)
printf("The autonegotiated media type is %s.\n",
media_names[max_capability - 5]);
else
printf("No common media type was autonegotiated!\n"
"This is extremely unusual and typically indicates a "
"configuration error.\n" "Perhaps the advertised "
"capability set was intentionally limited.\n");
}
printf(" Basic mode control register 0x%4.4x:", bmcr);
if (bmcr & 0x1000)
printf(" Auto-negotiation enabled.\n");
else
printf(" Auto-negotiation disabled, with\n"
" Speed fixed at 10%s mbps, %s-duplex.\n",
bmcr & 0x2000 ? "0" : "",
bmcr & 0x0100 ? "full":"half");
for (i = 0; i < 9; i++)
if (bmcr & (0x0080<<i))
printf(bmcr_bits[i]);

new_bmsr = mdio_read(ioaddr, phy_id, 1);
if ((bmsr & 0x0016) == 0x0004)
printf( " You have link beat, and everything is working OK.\n");
else
printf(" Basic mode status register 0x%4.4x ... %4.4x.\n"
" Link status: %sestablished.\n",
bmsr, new_bmsr,
bmsr & 0x0004 ? "" :
(new_bmsr & 0x0004) ? "previously broken, but now re" : "not ");
if (verbose) {
printf(" This transceiver is capable of ");
if (bmsr & 0xF800) {
for (i = 15; i >= 11; i--)
if (bmsr & (1<<i))
printf(" %s", media_names[i-11]);
} else
printf("<Warning! No media capabilities>");
printf(".\n");
printf(" %s to perform Auto-negotiation, negotiation %scomplete.\n",
bmsr & 0x0008 ? "Able" : "Unable",
bmsr & 0x0020 ? "" : "not ");
}

if (bmsr & 0x0010)
printf(" Remote fault detected!\n");
if (bmsr & 0x0002)
printf(" *** Link Jabber! ***\n");

if (lkpar & 0x4000) {
printf(" Your link partner advertised %4.4x:",
lkpar);
for (i = 5; i >= 0; i--)
if (lkpar & (0x20<<i))
printf(" %s", media_names[i]);
printf("%s.\n", lkpar & 0x0400 ? ", w/ 802.3X flow control" : "");
} else if (lkpar & 0x00A0)
printf(" Your link partner is generating %s link beat (no"
" autonegotiation).\n",
lkpar & 0x0080 ? "100baseTx" : "10baseT");
else if ( ! (bmcr & 0x1000))
printf(" Link partner information is not exchanged when in"
" fixed speed mode.\n");
else if ( ! (new_bmsr & 0x004))
; /* If no partner, do not report status. */
else if (lkpar == 0x0001 || lkpar == 0x0000) {
printf(" Your link partner does not do autonegotiation, and this "
"transceiver type\n does not report the sensed link "
"speed.\n");
} else
printf(" Your link partner is strange, status %4.4x.\n", lkpar);

printf(" End of basic transceiver information.\n\n");
return 0;
}

static void monitor_status(long ioaddr, int phy_id)
{
unsigned int baseline_1 = 0x55555555; /* Always show initial status. */

while (1) {
unsigned int new_1 = mdio_read(ioaddr, phy_id, 1);
if (new_1 != baseline_1) {
printf("%-12s 0x%4.4x 0x%4.4x\n",
new_1 & 0x04 ? (new_1==0xffff ? "unknown" : "up") :
new_1 & 0x20 ? "negotiating" : "down",
new_1, mdio_read(ioaddr, phy_id, 5));
fflush(stdout);
baseline_1 = new_1;
}
sleep(1);
}
}

int show_mii_details(long ioaddr, int phy_id)
{
int mii_reg, mii_val;
printf(" MII PHY #%d transceiver registers:", phy_id);
for (mii_reg = 0; mii_reg < 32; mii_reg++) {
mii_val = mdio_read(skfd, phy_id, mii_reg);
printf("%s %4.4x", (mii_reg % 8) == 0 ? "\n " : "",
mii_val);
}
printf("\nThis version of 'mii-diag' has not been linked with "
"the libmii.c library.\n"
" That library provides extended transceiver status reports.\n");
return 0;
}

void monitor_mii(long ioaddr, int phy_id)
{
fprintf(stderr, "\nThis version of 'mii-diag' has not been linked with "
"the libmii.c library \n"
" required for the media monitor option.\n");
}


/*
* Local variables:
* version-control: t
* kept-new-versions: 5
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* compile-command: "gcc -Wall -Wstrict-prototypes -O mii-diag.c -DLIBMII libmii.c -o mii-diag"
* simple-compile-command: "gcc mii-diag.c -o mii-diag"
* End:
*/

78
SOURCES/net-tools-config.h

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
/*
* config.h Automatically generated configuration includefile
*
* NET-TOOLS A collection of programs that form the base set of the
* NET-3 Networking Distribution for the LINUX operating
* system.
*
* DO NOT EDIT DIRECTLY
*
*/

/*
*
* Internationalization
*
* The net-tools package has currently been translated to French,
* German and Brazilian Portugese. Other translations are, of
* course, welcome. Answer `n' here if you have no support for
* internationalization on your system.
*
*/
#define I18N 1

/*
*
* Protocol Families.
*
*/
#define HAVE_AFUNIX 1
#define HAVE_AFINET 1
#define HAVE_AFINET6 1
#define HAVE_AFIPX 1
#define HAVE_AFATALK 1
#define HAVE_AFAX25 1
#define HAVE_AFNETROM 1
#define HAVE_AFROSE 1
#define HAVE_AFX25 1
#define HAVE_AFECONET 1
#define HAVE_AFDECnet 0
#define HAVE_AFASH 1
#define HAVE_AFBLUETOOTH 0

/*
*
* Device Hardware types.
*
*/
#define HAVE_HWETHER 1
#define HAVE_HWARC 1
#define HAVE_HWSLIP 1
#define HAVE_HWPPP 1
#define HAVE_HWTUNNEL 1
#define HAVE_HWSTRIP 0
#define HAVE_HWTR 0
#define HAVE_HWAX25 1
#define HAVE_HWROSE 1
#define HAVE_HWNETROM 1
#define HAVE_HWX25 1
#define HAVE_HWFR 1
#define HAVE_HWSIT 1
#define HAVE_HWFDDI 1
#define HAVE_HWHIPPI 1
#define HAVE_HWASH 1
#define HAVE_HWHDLCLAPB 1
#define HAVE_HWIRDA 1
#define HAVE_HWEC 1
#define HAVE_HWEUI64 1
#define HAVE_HWIB 1

/*
*
* Other Features.
*
*/
#define HAVE_FW_MASQUERADE 1
#define HAVE_IP_TOOLS 1
#define HAVE_MII 1
#define HAVE_SELINUX 1

39
SOURCES/net-tools-config.make

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
I18N=1
HAVE_AFUNIX=1
HAVE_AFINET=1
HAVE_AFINET6=1
HAVE_AFIPX=1
HAVE_AFATALK=1
HAVE_AFAX25=1
HAVE_AFNETROM=1
HAVE_AFROSE=1
HAVE_AFX25=1
HAVE_AFECONET=1
# HAVE_AFDECnet=0
HAVE_AFASH=1
# HAVE_AFBLUETOOTH=0
HAVE_HWETHER=1
HAVE_HWARC=1
HAVE_HWSLIP=1
HAVE_HWPPP=1
HAVE_HWTUNNEL=1
HAVE_HWSTRIP=0
HAVE_HWTR=0
HAVE_HWAX25=1
HAVE_HWROSE=1
HAVE_HWNETROM=1
HAVE_HWX25=1
HAVE_HWFR=1
HAVE_HWSIT=1
HAVE_HWFDDI=1
HAVE_HWHIPPI=1
HAVE_HWASH=1
HAVE_HWHDLCLAPB=1
HAVE_HWIRDA=1
HAVE_HWEC=1
HAVE_HWEUI64=1
HAVE_HWIB=1
HAVE_FW_MASQUERADE=1
HAVE_IP_TOOLS=1
HAVE_MII=1
HAVE_SELINUX=1

605
SOURCES/net-tools-correct-exit-code.patch

@ -0,0 +1,605 @@ @@ -0,0 +1,605 @@
diff --git a/netstat.c b/netstat.c
index 847c0dc..8dd2f29 100644
--- a/netstat.c
+++ b/netstat.c
@@ -2061,7 +2061,7 @@ static void version(void)
}
-static void usage(void)
+static void usage(int rc)
{
fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
@@ -2100,7 +2100,7 @@ static void usage(void)
fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
fprintf(stderr, _(" List of possible address families (which support routing):\n"));
print_aflist(1); /* 1 = routeable */
- exit(E_USAGE);
+ exit(rc);
}
@@ -2292,20 +2292,21 @@ int main
break;
case '?':
+ usage(E_OPTERR);
case 'h':
- usage();
+ usage(E_USAGE);
case 's':
flag_sta++;
}
if(argc == optind + 1) {
if((reptimer = atoi(argv[optind])) <= 0)
- usage();
+ usage(E_OPTERR);
flag_cnt++;
}
if (flag_int + flag_rou + flag_mas + flag_sta > 1)
- usage();
+ usage(E_OPTERR);
if ((flag_inet || flag_inet6 || flag_sta) &&
!(flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw))
diff --git a/arp.c b/arp.c
index 5db71a7..30dd56d 100644
--- a/arp.c
+++ b/arp.c
@@ -93,7 +93,7 @@ struct hwtype *hw; /* current hardware type */
int sockfd = 0; /* active socket descriptor */
int hw_set = 0; /* flag if hw-type was set (-H) */
char device[16] = ""; /* current device */
-static void usage(void);
+static void usage(int rc);
/* Delete an entry from the ARP cache. */
static int arp_del(char **args)
@@ -169,14 +169,14 @@ static int arp_del(char **args)
}
if (!strcmp(*args, "dev")) {
if (*++args == NULL)
- usage();
+ usage(E_OPTERR);
safe_strncpy(device, *args, sizeof(device));
args++;
continue;
}
if (!strcmp(*args, "netmask")) {
if (*++args == NULL)
- usage();
+ usage(E_OPTERR);
if (strcmp(*args, "255.255.255.255") != 0) {
safe_strncpy(host, *args, (sizeof host));
if (ap->input(0, host, sa) < 0) {
@@ -190,7 +190,7 @@ static int arp_del(char **args)
args++;
continue;
}
- usage();
+ usage(E_OPTERR);
}
// if neighter priv nor pub is given, work on both
@@ -346,14 +346,14 @@ static int arp_set(char **args)
}
if (!strcmp(*args, "dev")) {
if (*++args == NULL)
- usage();
+ usage(E_OPTERR);
safe_strncpy(device, *args, sizeof(device));
args++;
continue;
}
if (!strcmp(*args, "netmask")) {
if (*++args == NULL)
- usage();
+ usage(E_OPTERR);
if (strcmp(*args, "255.255.255.255") != 0) {
safe_strncpy(host, *args, (sizeof host));
if (ap->input(0, host, sa) < 0) {
@@ -367,7 +367,7 @@ static int arp_set(char **args)
args++;
continue;
}
- usage();
+ usage(E_OPTERR);
}
/* Fill in the remainder of the request. */
@@ -621,7 +621,7 @@ static void version(void)
exit(E_VERSION);
}
-static void usage(void)
+static void usage(int rc)
{
fprintf(stderr, _("Usage:\n arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP cache\n"));
fprintf(stderr, _(" arp [-v] [-i <if>] -d <host> [pub] <-Delete ARP entry\n"));
@@ -643,7 +643,7 @@ static void usage(void)
fprintf(stderr, _(" <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"), DFLT_HW);
fprintf(stderr, _(" List of possible hardware types (which support ARP):\n"));
print_hwlist(1); /* 1 = ARPable */
- exit(E_USAGE);
+ exit(rc);
}
int main(int argc, char **argv)
@@ -745,10 +745,11 @@ int main(int argc, char **argv)
case 'V':
version();
- case '?':
case 'h':
+ usage(E_USAGE);
+ case '?':
default:
- usage();
+ usage(E_OPTERR);
}
if (ap->af != AF_INET) {
@@ -797,7 +798,7 @@ int main(int argc, char **argv)
break;
default:
- usage();
+ usage(E_OPTERR);
}
exit(what);
diff --git a/ipmaddr.c b/ipmaddr.c
index e4ed41d..c45b62a 100644
--- a/ipmaddr.c
+++ b/ipmaddr.c
@@ -53,14 +53,14 @@ static void version(void)
exit(E_VERSION);
}
-static void usage(void) __attribute__((noreturn));
+static void usage(int rc) __attribute__((noreturn));
-static void usage(void)
+static void usage(int rc)
{
fprintf(stderr, _("Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n"));
fprintf(stderr, _(" ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"));
fprintf(stderr, _(" ipmaddr -V | -version\n"));
- exit(E_USAGE);
+ exit(rc);
}
static void print_lla(FILE *fp, int len, unsigned char *addr)
@@ -294,7 +294,7 @@ static int multiaddr_list(int argc, char **argv)
NEXT_ARG();
l = strlen(*argv);
if (l <= 0 || l >= sizeof(filter_dev))
- usage();
+ usage(E_OPTERR);
strncpy(filter_dev, *argv, sizeof (filter_dev));
} else if (strcmp(*argv, "all") == 0) {
filter_family = AF_UNSPEC;
@@ -307,7 +307,7 @@ static int multiaddr_list(int argc, char **argv)
} else {
l = strlen(*argv);
if (l <= 0 || l >= sizeof(filter_dev))
- usage();
+ usage(E_OPTERR);
strncpy(filter_dev, *argv, sizeof (filter_dev));
}
argv++; argc--;
@@ -339,18 +339,18 @@ int multiaddr_modify(int cmd, int argc, char **argv)
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
if (ifr.ifr_name[0])
- usage();
+ usage(E_OPTERR);
strncpy(ifr.ifr_name, *argv, IFNAMSIZ);
} else {
if (ifr.ifr_hwaddr.sa_data[0])
- usage();
+ usage(E_OPTERR);
if (parse_lla(*argv, ifr.ifr_hwaddr.sa_data) < 0)
- usage();
+ usage(E_OPTERR);
}
argc--; argv++;
}
if (ifr.ifr_name[0] == 0)
- usage();
+ usage(E_OPTERR);
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0) {
@@ -378,7 +378,7 @@ int do_multiaddr(int argc, char **argv)
if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0
|| matches(*argv, "lst") == 0)
return multiaddr_list(argc-1, argv+1);
- usage();
+ usage(E_OPTERR);
}
int preferred_family = AF_UNSPEC;
@@ -408,13 +408,13 @@ int main(int argc, char **argv)
argc--;
argv++;
if (argc <= 1)
- usage();
+ usage(E_OPTERR);
if (strcmp(argv[1], "inet") == 0)
preferred_family = AF_INET;
else if (strcmp(argv[1], "inet6") == 0)
preferred_family = AF_INET6;
else
- usage();
+ usage(E_OPTERR);
} else if (matches(argv[1], "-stats") == 0 ||
matches(argv[1], "-statistics") == 0) {
++show_stats;
@@ -423,7 +423,7 @@ int main(int argc, char **argv)
} else if ((matches(argv[1], "-V") == 0) || matches(argv[1], "--version") == 0) {
version();
} else
- usage();
+ usage(E_OPTERR);
argc--; argv++;
}
diff --git a/include/util-ank.h b/include/util-ank.h
index c8fcd08..c78604a 100644
--- a/include/util-ank.h
+++ b/include/util-ank.h
@@ -23,7 +23,7 @@ extern int resolve_hosts;
#define NEXT_ARG() \
argv++; \
if (--argc <= 0) \
- usage();
+ usage(E_OPTERR);
typedef struct
{
diff --git a/iptunnel.c b/iptunnel.c
index 2215d68..42b2a9e 100644
--- a/iptunnel.c
+++ b/iptunnel.c
@@ -76,9 +76,9 @@ static void version(void)
exit(E_VERSION);
}
-static void usage(void) __attribute__((noreturn));
+static void usage(int rc) __attribute__((noreturn));
-static void usage(void)
+static void usage(int rc)
{
fprintf(stderr, _("Usage: iptunnel { add | change | del | show } [ NAME ]\n"));
fprintf(stderr, _(" [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n"));
@@ -90,7 +90,7 @@ static void usage(void)
fprintf(stderr, _(" TOS := { NUMBER | inherit }\n"));
fprintf(stderr, _(" TTL := { 1..255 | inherit }\n"));
fprintf(stderr, _(" KEY := { DOTTED_QUAD | NUMBER }\n"));
- exit(E_USAGE);
+ exit(rc);
}
static int do_ioctl_get_ifindex(char *dev)
@@ -217,18 +217,18 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
NEXT_ARG();
if (strcmp(*argv, "ipip") == 0) {
if (p->iph.protocol)
- usage();
+ usage(E_OPTERR);
p->iph.protocol = IPPROTO_IPIP;
} else if (strcmp(*argv, "gre") == 0) {
if (p->iph.protocol)
- usage();
+ usage(E_OPTERR);
p->iph.protocol = IPPROTO_GRE;
} else if (strcmp(*argv, "sit") == 0) {
if (p->iph.protocol)
- usage();
+ usage(E_OPTERR);
p->iph.protocol = IPPROTO_IPV6;
} else
- usage();
+ usage(E_OPTERR);
} else if (strcmp(*argv, "key") == 0) {
unsigned uval;
NEXT_ARG();
@@ -238,7 +238,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
p->i_key = p->o_key = get_addr32(*argv);
else {
if (scan_number(*argv, &uval)<0)
- usage();
+ usage(E_OPTERR);
p->i_key = p->o_key = htonl(uval);
}
} else if (strcmp(*argv, "ikey") == 0) {
@@ -249,7 +249,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
p->o_key = get_addr32(*argv);
else {
if (scan_number(*argv, &uval)<0)
- usage();
+ usage(E_OPTERR);
p->i_key = htonl(uval);
}
} else if (strcmp(*argv, "okey") == 0) {
@@ -260,7 +260,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
p->o_key = get_addr32(*argv);
else {
if (scan_number(*argv, &uval)<0)
- usage();
+ usage(E_OPTERR);
p->o_key = htonl(uval);
}
} else if (strcmp(*argv, "seq") == 0) {
@@ -295,9 +295,9 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
NEXT_ARG();
if (strcmp(*argv, "inherit") != 0) {
if (scan_number(*argv, &uval)<0)
- usage();
+ usage(E_OPTERR);
if (uval > 255)
- usage();
+ usage(E_OPTERR);
p->iph.ttl = uval;
}
} else if (strcmp(*argv, "tos") == 0) {
@@ -305,15 +305,15 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p)
NEXT_ARG();
if (strcmp(*argv, "inherit") != 0) {
if (scan_number(*argv, &uval)<0)
- usage();
+ usage(E_OPTERR);
if (uval > 255)
- usage();
+ usage(E_OPTERR);
p->iph.tos = uval;
} else
p->iph.tos = 1;
} else {
if (p->name[0])
- usage();
+ usage(E_OPTERR);
safe_strncpy(p->name, *argv, IFNAMSIZ);
}
argc--; argv++;
@@ -574,7 +574,7 @@ int do_iptunnel(int argc, char **argv)
} else
return do_show(0, NULL);
- usage();
+ usage(E_OPTERR);
}
@@ -605,13 +605,13 @@ int main(int argc, char **argv)
argc--;
argv++;
if (argc <= 1)
- usage();
+ usage(E_OPTERR);
if (strcmp(argv[1], "inet") == 0)
preferred_family = AF_INET;
else if (strcmp(argv[1], "inet6") == 0)
preferred_family = AF_INET6;
else
- usage();
+ usage(E_OPTERR);
} else if (matches(argv[1], "-stats") == 0 ||
matches(argv[1], "-statistics") == 0) {
++show_stats;
@@ -620,7 +620,7 @@ int main(int argc, char **argv)
} else if ((matches(argv[1], "-V") == 0) || (matches(argv[1], "--version") == 0)) {
version();
} else
- usage();
+ usage(E_OPTERR);
argc--; argv++;
}
diff --git a/nameif.c b/nameif.c
index b280e59..13e3033 100644
--- a/nameif.c
+++ b/nameif.c
@@ -192,10 +192,10 @@ struct option lopt[] = {
{NULL},
};
-void usage(void)
+void usage(int rc)
{
fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
- exit(E_USAGE);
+ exit(rc);
}
int main(int ac, char **av)
@@ -214,7 +214,7 @@ int main(int ac, char **av)
switch (c) {
default:
case '?':
- usage();
+ usage(E_OPTERR);
case 'c':
fname = optarg;
break;
@@ -232,7 +232,7 @@ int main(int ac, char **av)
char pos[30];
if ((ac-optind) & 1)
- usage();
+ usage(E_OPTERR);
if (strlen(av[optind])+1>IFNAMSIZ)
complain(_("interface name `%s' too long"), av[optind]);
safe_strncpy(ch->ifname, av[optind], sizeof(ch->ifname));
diff --git a/plipconfig.c b/plipconfig.c
index 86fa890..1caeed3 100644
--- a/plipconfig.c
+++ b/plipconfig.c
@@ -57,12 +57,12 @@ static void version(void)
exit(E_VERSION);
}
-void usage(void)
+void usage(int rc)
{
fprintf(stderr, _("Usage: plipconfig interface [nibble NN] [trigger NN]\n"));
fprintf(stderr, _(" plipconfig -V | --version\n"));
fprintf(stderr, _(" plipconfig -h | --help\n"));
- exit(E_USAGE);
+ exit(rc);
}
void print_plip(void)
@@ -89,16 +89,18 @@ int main(int argc, char **argv)
argc--;
argv++;
while (argv[0] && *argv[0] == '-') {
- if (!strcmp(*argv, "-V") || !strcmp(*argv, "--version"))
+ if ((!strcmp(*argv, "-V") || !strcmp(*argv, "--version")) && argc==1)
version();
+ if ((!strcmp(*argv, "-h") || !strcmp(*argv, "--help")) && argc==1)
+ usage(E_USAGE);
else
- usage();
+ usage(E_OPTERR);
argv++;
argc--;
}
if (argc == 0)
- usage();
+ usage(E_OPTERR);
spp = argv;
safe_strncpy(ifr.ifr_name, *spp++, IFNAMSIZ);
@@ -117,19 +119,19 @@ int main(int argc, char **argv)
while (*spp != (char *) NULL) {
if (!strcmp(*spp, "nibble")) {
if (*++spp == NULL)
- usage();
+ usage(E_OPTERR);
plip->nibble = atoi(*spp);
spp++;
continue;
}
if (!strcmp(*spp, "trigger")) {
if (*++spp == NULL)
- usage();
+ usage(E_OPTERR);
plip->trigger = atoi(*spp);
spp++;
continue;
}
- usage();
+ usage(E_OPTERR);
}
plip->pcmd = PLIP_SET_TIMEOUT;
diff --git a/route.c b/route.c
index 4eaed49..d5a3039 100644
--- a/route.c
+++ b/route.c
@@ -76,7 +76,7 @@ int opt_fc = 0; // routing cache/FIB
int opt_h = 0; // help selected
struct aftype *ap; // selected address family
-static void usage(void)
+static void usage(int rc)
{
fprintf(stderr, _("Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables\n"));
fprintf(stderr, _(" route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.\n\n"));
@@ -93,7 +93,7 @@ static void usage(void)
fprintf(stderr, _(" <AF>=Use -4, -6, '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
fprintf(stderr, _(" List of possible address families (which support routing):\n"));
print_aflist(1); /* 1 = routeable */
- exit(E_USAGE);
+ exit(rc);
}
@@ -186,11 +186,12 @@ int main(int argc, char **argv)
case 'V':
version();
case 'h':
+ usage(E_USAGE);
case '?':
opt_h++;
break;
default:
- usage();
+ usage(E_OPTERR);
}
argv += optind;
@@ -198,7 +199,7 @@ int main(int argc, char **argv)
if (opt_h) {
if (!afname[0])
- usage();
+ usage(E_OPTERR);
else
what = RTACTION_HELP;
} else {
@@ -217,7 +218,7 @@ int main(int argc, char **argv)
else if (!strcmp(*argv, "flush"))
what = RTACTION_FLUSH;
else
- usage();
+ usage(E_OPTERR);
}
}
@@ -231,7 +232,7 @@ int main(int argc, char **argv)
i = route_edit(what, afname, options, ++argv);
if (i == E_OPTERR)
- usage();
+ usage(E_OPTERR);
return (i);
}
diff --git a/slattach.c b/slattach.c
index 5c81584..dbb2658 100644
--- a/slattach.c
+++ b/slattach.c
@@ -581,7 +581,7 @@ sig_catch(int sig)
static void
-usage(void)
+usage(int rc)
{
char *usage_msg = "Usage: slattach [-ehlLmnqv] "
#ifdef SIOCSKEEPALIVE
@@ -594,7 +594,7 @@ usage(void)
" slattach -V | --version\n";
fputs(usage_msg, stderr);
- exit(E_USAGE);
+ exit(rc);
}
@@ -691,7 +691,7 @@ main(int argc, char *argv[])
/*NOTREACHED*/
default:
- usage();
+ usage(E_OPTERR);
/*NOTREACHED*/
}
@@ -707,7 +707,7 @@ main(int argc, char *argv[])
opt_m++;
/* Is a terminal given? */
- if (optind != (argc - 1)) usage();
+ if (optind != (argc - 1)) usage(E_OPTERR);
safe_strncpy(path_buf, argv[optind], sizeof(path_buf));
if (!strcmp(path_buf, "-")) {
opt_e = 1;

375
SOURCES/net-tools-cycle.patch

@ -0,0 +1,375 @@ @@ -0,0 +1,375 @@
diff -up net-tools-2.0/lib/interface.c.cycle net-tools-2.0/lib/interface.c
--- net-tools-2.0/lib/interface.c.cycle 2013-08-30 14:30:25.000000000 +0200
+++ net-tools-2.0/lib/interface.c 2013-09-10 12:31:03.930309225 +0200
@@ -93,6 +93,7 @@ int if_list_all = 0; /* do we have reque
static struct interface *int_list, *int_last;
static int if_readlist_proc(char *);
+static int if_readlist_rep(char *, struct interface *);
static struct interface *if_cache_add(char *name)
{
@@ -138,11 +139,14 @@ struct interface *lookup_interface(char
int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
{
struct interface *ife;
+ int err;
if (!if_list_all && (if_readlist() < 0))
return -1;
for (ife = int_list; ife; ife = ife->next) {
- int err = doit(ife, cookie);
+ if_readlist_rep(ife->name, ife);
+ err = doit(ife, cookie);
+
if (err)
return err;
}
@@ -378,6 +382,41 @@ static int if_readlist_proc(char *target
fclose(fh);
return err;
}
+
+static int if_readlist_rep(char *target, struct interface *ife)
+{
+ FILE *fh;
+ char buf[512];
+ int err;
+
+ fh = fopen(_PATH_PROCNET_DEV, "r");
+ if (!fh) {
+ fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
+ _PATH_PROCNET_DEV, strerror(errno));
+ return if_readconf();
+ }
+ fgets(buf, sizeof buf, fh); /* eat line */
+ fgets(buf, sizeof buf, fh);
+
+ procnetdev_vsn = procnetdev_version(buf);
+
+ err = 0;
+ while (fgets(buf, sizeof buf, fh)) {
+ char *s, name[IFNAMSIZ];
+ s = get_name(name, buf);
+ get_dev_fields(s, ife);
+ ife->statistics_valid = 1;
+ if (target && !strcmp(target,name))
+ break;
+ }
+ if (ferror(fh)) {
+ perror(_PATH_PROCNET_DEV);
+ err = -1;
+ }
+
+ fclose(fh);
+ return err;
+}
int if_readlist(void)
{
diff -up net-tools-2.0/man/en_US/netstat.8.cycle net-tools-2.0/man/en_US/netstat.8
--- net-tools-2.0/man/en_US/netstat.8.cycle 2013-08-30 14:30:25.000000000 +0200
+++ net-tools-2.0/man/en_US/netstat.8 2013-09-10 12:31:03.930309225 +0200
@@ -33,6 +33,7 @@ netstat \- Print network connections, ro
.RB [ \-\-verbose | \-v ]
.RB [ \-\-continuous | \-c]
.RB [ \-\-wide | \-W]
+.RB [delay]
.P
.B netstat
.RB { \-\-route | \-r }
@@ -42,6 +43,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-interfaces | \-i }
@@ -52,12 +54,14 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric-hosts "] [" \-\-numeric-ports "] [" \-\-numeric-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-groups | \-g }
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-masquerade | \-M }
@@ -65,6 +69,7 @@ netstat \- Print network connections, ro
.RB [ \-\-numeric | \-n ]
.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
.RB [ \-\-continuous | \-c]
+.RB [delay]
.P
.B netstat
.RB { \-\-statistics | -s }
@@ -72,6 +77,7 @@ netstat \- Print network connections, ro
.RB [ \-\-udp | \-u ]
.RB [ \-\-udplite | \-U ]
.RB [ \-\-raw | \-w ]
+.RB [delay]
.P
.B netstat
.RB { \-\-version | \-V }
@@ -197,6 +203,10 @@ option, show interfaces that are not up
Print routing information from the FIB. (This is the default.)
.SS "\-C"
Print routing information from the route cache.
+.SS delay
+Netstat will cycle printing through statistics every
+.B delay
+seconds.
.P
.SH OUTPUT
.P
diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.cycle 2013-08-30 14:30:25.000000000 +0200
+++ net-tools-2.0/netstat.c 2013-09-10 12:32:32.460124531 +0200
@@ -115,9 +115,9 @@
#endif
/* prototypes for statistics.c */
-void parsesnmp(int, int, int);
+int parsesnmp(int, int, int);
void inittab(void);
-void parsesnmp6(int, int, int);
+int parsesnmp6(int, int, int);
void inittab6(void);
typedef enum {
@@ -341,10 +341,10 @@ static void prg_cache_clear(void)
prg_cache_loaded = 0;
}
-static void wait_continous(void)
+static void wait_continous(int reptimer)
{
fflush(stdout);
- sleep(1);
+ sleep(reptimer);
}
static int extract_type_1_socket_inode(const char lname[], unsigned long * inode_p) {
@@ -1781,6 +1781,8 @@ static int rfcomm_info(void)
static int iface_info(void)
{
+ static int count=0;
+
if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) {
perror("socket");
@@ -1790,20 +1792,21 @@ static int iface_info(void)
}
if (flag_exp < 2) {
ife_short = 1;
- printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
+ if(!(count % 8))
+ printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
}
if (for_all_interfaces(do_if_print, &flag_all) < 0) {
perror(_("missing interface information"));
exit(1);
}
- if (flag_cnt)
+ if (!flag_cnt) {
if_cache_free();
- else {
close(skfd);
skfd = -1;
}
+ count++;
return 0;
}
@@ -1819,7 +1822,7 @@ static void usage(void)
{
fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
- fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
+ fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
fprintf(stderr, _(" -r, --route display routing table\n"));
fprintf(stderr, _(" -i, --interfaces display interface table\n"));
@@ -1861,6 +1864,7 @@ int main
(int argc, char *argv[]) {
int i;
int lop;
+ int reptimer = 1;
static struct option longopts[] =
{
AFTRANS_OPTS,
@@ -2043,6 +2047,12 @@ int main
flag_sta++;
}
+ if(argc == optind + 1) {
+ if((reptimer = atoi(argv[optind])) <= 0)
+ usage();
+ flag_cnt++;
+ }
+
if (flag_int + flag_rou + flag_mas + flag_sta > 1)
usage();
@@ -2072,7 +2082,7 @@ int main
flag_not & FLAG_NUM_PORT, flag_exp);
if (i || !flag_cnt)
break;
- wait_continous();
+ wait_continous(reptimer);
}
#else
ENOSUPP("netstat", "FW_MASQUERADE");
@@ -2085,17 +2095,18 @@ int main
if (!afname[0])
safe_strncpy(afname, DFLT_AF, sizeof(afname));
+ for (;;) {
if (!strcmp(afname, "inet")) {
#if HAVE_AFINET
inittab();
- parsesnmp(flag_raw, flag_tcp, flag_udp);
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET");
#endif
} else if(!strcmp(afname, "inet6")) {
#if HAVE_AFINET6
inittab6();
- parsesnmp6(flag_raw, flag_tcp, flag_udp);
+ i = parsesnmp6(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET6");
#endif
@@ -2103,7 +2114,11 @@ int main
printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
exit(1);
}
- exit(0);
+ if(i || !flag_cnt)
+ break;
+ sleep(reptimer);
+ }
+ return (i);
}
if (flag_rou) {
@@ -2125,7 +2140,7 @@ int main
i = route_info(afname, options);
if (i || !flag_cnt)
break;
- wait_continous();
+ wait_continous(reptimer);
}
return (i);
}
@@ -2134,7 +2149,7 @@ int main
i = iface_info();
if (!flag_cnt || i)
break;
- wait_continous();
+ wait_continous(reptimer);
}
return (i);
}
@@ -2321,7 +2336,7 @@ int main
if (!flag_cnt || i)
break;
- wait_continous();
+ wait_continous(reptimer);
prg_cache_clear();
}
return (i);
diff -up net-tools-2.0/statistics.c.cycle net-tools-2.0/statistics.c
--- net-tools-2.0/statistics.c.cycle 2013-08-30 14:30:25.000000000 +0200
+++ net-tools-2.0/statistics.c 2013-09-10 12:31:03.932309198 +0200
@@ -502,7 +502,7 @@ void process6_fd(FILE *f)
}
-void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
+int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
{
FILE *f;
@@ -511,14 +511,17 @@ void parsesnmp(int flag_raw, int flag_tc
f = proc_fopen("/proc/net/snmp");
if (!f) {
perror(_("cannot open /proc/net/snmp"));
- return;
+ return(1);
}
if (process_fd(f, 1, NULL) < 0)
fprintf(stderr, _("Problem while parsing /proc/net/snmp\n"));
- if (ferror(f))
+ if (ferror(f)) {
perror("/proc/net/snmp");
+ fclose(f);
+ return(1);
+ }
fclose(f);
@@ -528,15 +531,18 @@ void parsesnmp(int flag_raw, int flag_tc
if (process_fd(f, 1, NULL) <0)
fprintf(stderr, _("Problem while parsing /proc/net/netstat\n"));
- if (ferror(f))
- perror("/proc/net/netstat");
+ if (ferror(f)) {
+ perror("/proc/net/netstat");
+ fclose(f);
+ return(1);
+ }
fclose(f);
}
- return;
+ return(0);
}
-void parsesnmp6(int flag_raw, int flag_tcp, int flag_udp)
+int parsesnmp6(int flag_raw, int flag_tcp, int flag_udp)
{
FILE *f;
@@ -545,7 +551,7 @@ void parsesnmp6(int flag_raw, int flag_t
f = fopen("/proc/net/snmp6", "r");
if (!f) {
perror(_("cannot open /proc/net/snmp6"));
- return;
+ return(1);
}
process6_fd(f);
if (ferror(f))
@@ -555,13 +561,16 @@ void parsesnmp6(int flag_raw, int flag_t
f = fopen("/proc/net/snmp", "r");
if (!f) {
perror(_("cannot open /proc/net/snmp"));
- return;
+ return(1);
}
process_fd(f, 0, "Tcp");
- if (ferror(f))
+ if (ferror(f)) {
perror("/proc/net/snmp");
+ return(1);
+ }
fclose(f);
+ return(0);
}
void inittab(void)

146
SOURCES/net-tools-duplicate-tcp.patch

@ -0,0 +1,146 @@ @@ -0,0 +1,146 @@
diff -up net-tools-2.0/netstat.c.dup-tcp net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.dup-tcp 2012-10-04 11:32:01.437729086 +0200
+++ net-tools-2.0/netstat.c 2012-10-04 11:32:01.441729032 +0200
@@ -502,6 +502,121 @@ static void prg_cache_load(void)
" will not be shown, you would have to be root to see it all.)\n"));
}
+#define TCP_HASH_SIZE 1009
+
+static struct tcp_node {
+ struct tcp_node *next;
+ char *socket_pair;
+} *tcp_node_hash[TCP_HASH_SIZE];
+
+static unsigned int tcp_node_compute_string_hash(const char *p)
+{
+ unsigned int h = *p;
+
+ if (h)
+ for (p += 1; *p != '\0'; p++)
+ h = (h << 5) - h + *p;
+
+ return h;
+}
+
+#define TCP_NODE_HASH_STRING(x) \
+ (tcp_node_compute_string_hash(x) % TCP_HASH_SIZE)
+
+static void tcp_node_hash_clear(void)
+{
+ int i;
+ struct tcp_node *next_node;
+ struct tcp_node *tmp_node;
+ for (i=0; i < TCP_HASH_SIZE; i++) {
+ if (tcp_node_hash[i]) {
+ /* free the children of this hash bucket */
+ next_node = tcp_node_hash[i]->next;
+ while (next_node) {
+ tmp_node = next_node;
+ next_node = next_node->next;
+ free(tmp_node->socket_pair);
+ free(tmp_node);
+ }
+
+ /* free the bucket itself */
+ free(tcp_node_hash[i]->socket_pair);
+ free(tcp_node_hash[i]);
+ tcp_node_hash[i] = NULL;
+ }
+ }
+}
+
+/* This function takes a socket pair string. If it already exists in
+ the hash it returns -1, otherwise it returns 0. */
+
+static int tcp_node_hash_check_and_append(const char *local_addr,
+ int local_port,
+ const char *rem_addr,
+ int rem_port)
+{
+ unsigned int hash_val;
+ struct tcp_node *tmp_node;
+ int tmp_string_len;
+ char *tmp_string;;
+
+ /* Size of the string is the size of the two lengths of the address
+ strings plus enough sizes for the colons and the ports. */
+ tmp_string_len = strlen(local_addr) + strlen(rem_addr) + 32;
+ tmp_string = malloc(tmp_string_len);
+ if (!tmp_string)
+ return 0;
+
+ if (snprintf(tmp_string, tmp_string_len - 1, "%s:%d:%s:%d",
+ local_addr, local_port, rem_addr, rem_port) < 0) {
+ free(tmp_string);
+ return 0;
+ }
+
+ hash_val = TCP_NODE_HASH_STRING(tmp_string);
+
+ /* See if we have to allocate this node */
+ if (!tcp_node_hash[hash_val]) {
+ tcp_node_hash[hash_val] = malloc(sizeof(struct tcp_node));
+ if (!tcp_node_hash[hash_val]) {
+ free(tmp_string);
+ return 0;
+ }
+
+ memset(tcp_node_hash[hash_val], 0, sizeof(struct tcp_node));
+
+ /* Stuff this new value into the hash bucket and return early */
+ tcp_node_hash[hash_val]->socket_pair = tmp_string;
+ return 0;
+ }
+
+ /* Try to find the value in the hash bucket. */
+ tmp_node = tcp_node_hash[hash_val];
+ while (tmp_node) {
+ if (!strcmp(tmp_node->socket_pair, tmp_string)) {
+ free(tmp_string);
+ return -1;
+ }
+ tmp_node = tmp_node->next;
+ }
+
+ /* If we got this far it means that it isn't in the hash bucket.
+ Add it to the front since it's faster that way. */
+ tmp_node = tcp_node_hash[hash_val];
+
+ tcp_node_hash[hash_val] = malloc(sizeof(struct tcp_node));
+ if (!tcp_node_hash[hash_val]) {
+ free(tmp_string);
+ tcp_node_hash[hash_val] = tmp_node;
+ return 0;
+ }
+
+ tcp_node_hash[hash_val]->socket_pair = tmp_string;
+ tcp_node_hash[hash_val]->next = tmp_node;
+
+ return 0;
+}
+
#if HAVE_AFNETROM
static const char *netrom_state[] =
{
@@ -1018,6 +1133,12 @@ static void tcp_do_one(int lnr, const ch
return;
}
+ /* make sure that we haven't seen this socket pair before */
+ if (tcp_node_hash_check_and_append(local_addr, local_port, rem_addr, rem_port) < 0) {
+ /* fprintf(stderr, _("warning, got duplicate tcp line.\n")); */
+ return;
+ }
+
addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "tcp");
addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "tcp");
@@ -2355,6 +2476,7 @@ int main
break;
wait_continous(reptimer);
prg_cache_clear();
+ tcp_node_hash_clear();
}
return (i);
}

28
SOURCES/net-tools-ifconfig-EiB.patch

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
diff --git a/lib/interface.c.old b/lib/interface.c
index 13017ae..3bd999f 100644
--- a/lib/interface.c.old
+++ b/lib/interface.c
@@ -927,7 +927,10 @@ void ife_print_long(struct interface *ptr)
*/
rx = ptr->stats.rx_bytes;
short_rx = rx * 10;
- if (rx > 1125899906842624ull) {
+ if (rx > 1152921504606846976ull) {
+ short_rx = rx / 115292150460684697ull;
+ Rext = "EiB";
+ } else if (rx > 1125899906842624ull) {
short_rx /= 1125899906842624ull;
Rext = "PiB";
} else if (rx > 1099511627776ull) {
@@ -945,7 +948,10 @@ void ife_print_long(struct interface *ptr)
}
tx = ptr->stats.tx_bytes;
short_tx = tx * 10;
- if (tx > 1125899906842624ull) {
+ if (tx > 1152921504606846976ull) {
+ short_tx = tx / 115292150460684697ull;
+ Text = "EiB";
+ } else if (tx > 1125899906842624ull) {
short_tx /= 1125899906842624ull;
Text = "PiB";
} else if (tx > 1099511627776ull) {

36
SOURCES/net-tools-ifconfig-long-iface-crasher.patch

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
diff -up net-tools-2.0/lib/interface.c.long_iface net-tools-2.0/lib/interface.c
--- net-tools-2.0/lib/interface.c.long_iface 2012-10-04 11:35:27.983694933 +0200
+++ net-tools-2.0/lib/interface.c 2012-10-04 11:35:27.991694805 +0200
@@ -216,6 +216,7 @@ out:
char *get_name(char **namep, char *p)
{
+ int count = 0;
while (isspace(*p))
p++;
char *name = *namep = p;
@@ -224,7 +225,13 @@ char *get_name(char **namep, char *p)
break;
if (*p == ':') { /* could be an alias */
char *dot = p++;
- while (*p && isdigit(*p)) p++;
+ count++;
+ while (*p && isdigit(*p)) {
+ p++;
+ count++;
+ if (count == (IFNAMSIZ-1))
+ break;
+ }
if (*p == ':') {
/* Yes it is, backup and copy it. */
p = dot;
@@ -240,6 +247,9 @@ char *get_name(char **namep, char *p)
break;
}
*name++ = *p++;
+ count++;
+ if (count == (IFNAMSIZ-1))
+ break;
}
*name++ = '\0';
return p;

102
SOURCES/net-tools-interface.patch

@ -0,0 +1,102 @@ @@ -0,0 +1,102 @@
diff -up net-tools-2.0/man/en_US/netstat.8.interface net-tools-2.0/man/en_US/netstat.8
--- net-tools-2.0/man/en_US/netstat.8.interface 2012-10-04 11:31:00.753513633 +0200
+++ net-tools-2.0/man/en_US/netstat.8 2012-10-04 11:31:00.755513607 +0200
@@ -46,9 +46,9 @@ netstat \- Print network connections, ro
.RB [delay]
.P
.B netstat
-.RB { \-\-interfaces | \-i }
+.RB { \-\-interfaces | \-I | \-i }
.RB [ \-\-all | \-a ]
-.RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
+.RB [ \-\-extend | \-e ]
.RB [ \-\-verbose | \-v ]
.RB [ \-\-program | \-p ]
.RB [ \-\-numeric | \-n ]
@@ -129,8 +129,8 @@ and
produce the same output.
.SS "\-\-groups , \-g"
Display multicast group membership information for IPv4 and IPv6.
-.SS "\-\-interfaces, \-i"
-Display a table of all network interfaces.
+.SS "\-\-interfaces=\fIiface \fR, \fB\-I=\fIiface \fR, \fB\-i"
+Display a table of all network interfaces, or the specified \fIiface\fR.
.SS "\-\-masquerade , \-M"
Display a list of masqueraded connections.
.SS "\-\-statistics , \-s"
diff -up net-tools-2.0/netstat.c.interface net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.interface 2012-10-04 11:31:00.745513734 +0200
+++ net-tools-2.0/netstat.c 2012-10-04 11:31:00.756513594 +0200
@@ -143,6 +143,7 @@ char *Release = RELEASE, *Version = "net
#define E_IOCTL -3
int flag_int = 0;
+char *flag_int_name = NULL;
int flag_rou = 0;
int flag_mas = 0;
int flag_sta = 0;
@@ -1786,6 +1787,7 @@ static int rfcomm_info(void)
static int iface_info(void)
{
static int count=0;
+ struct interface *ife = NULL;
if (skfd < 0) {
if ((skfd = sockets_open(0)) < 0) {
@@ -1800,7 +1802,11 @@ static int iface_info(void)
printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
}
- if (for_all_interfaces(do_if_print, &flag_all) < 0) {
+ if (flag_int_name) {
+ ife = lookup_interface(flag_int_name);
+ do_if_print(ife, &flag_all);
+ }
+ else if (for_all_interfaces(do_if_print, &flag_all) < 0) {
perror(_("missing interface information"));
exit(1);
}
@@ -1826,9 +1832,10 @@ static void usage(void)
{
fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
- fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
+ fprintf(stderr, _(" netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
fprintf(stderr, _(" -r, --route display routing table\n"));
+ fprintf(stderr, _(" -I, --interfaces=<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"));
@@ -1873,7 +1880,7 @@ int main
{
AFTRANS_OPTS,
{"version", 0, 0, 'V'},
- {"interfaces", 0, 0, 'i'},
+ {"interfaces", 2, 0, 'I'},
{"help", 0, 0, 'h'},
{"route", 0, 0, 'r'},
#if HAVE_FW_MASQUERADE
@@ -1917,7 +1924,7 @@ int main
getroute_init(); /* Set up AF routing support */
afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "A:CFMacdeghilnNoprsStuUvVWwx64?Z", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWwx64?Z", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
@@ -1958,6 +1965,13 @@ int main
case 'p':
flag_prg++;
break;
+ case 'I':
+ if (optarg && strcmp(optarg, "(null)"))
+ if (optarg[0] == '=') optarg++;
+ if (optarg && strcmp(optarg, "(null)"))
+ flag_int_name = strdup(optarg);
+ flag_int++;
+ break;
case 'i':
flag_int++;
break;

129
SOURCES/net-tools-interface_stack.patch

@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
diff -up net-tools-2.0/include/interface.h.stack net-tools-2.0/include/interface.h
--- net-tools-2.0/include/interface.h.stack 2013-05-23 05:27:34.000000000 +0200
+++ net-tools-2.0/include/interface.h 2013-06-07 11:58:25.474623871 +0200
@@ -72,7 +72,7 @@ extern int do_if_print(struct interface
extern int procnetdev_version(char *buf);
extern int get_dev_fields(char *bp, struct interface *ife);
-extern char * get_name(char *name, char *p);
+extern char * get_name(char **namep, char *p);
extern void ife_print(struct interface *ptr);
diff -up net-tools-2.0/lib/interface.c.stack net-tools-2.0/lib/interface.c
--- net-tools-2.0/lib/interface.c.stack 2013-06-07 11:58:25.471623910 +0200
+++ net-tools-2.0/lib/interface.c 2013-06-07 12:00:13.901191277 +0200
@@ -214,10 +214,11 @@ out:
return err;
}
-char *get_name(char *name, char *p)
+char *get_name(char **namep, char *p)
{
while (isspace(*p))
p++;
+ char *name = *namep = p;
while (*p) {
if (isspace(*p))
break;
@@ -320,9 +321,10 @@ int get_dev_fields(char *bp, struct inte
static int if_readlist_proc(char *target)
{
FILE *fh;
- char buf[512];
struct interface *ife;
int err;
+ char *line = NULL;
+ size_t linelen = 0;
fh = fopen(_PATH_PROCNET_DEV, "r");
if (!fh) {
@@ -330,10 +332,11 @@ static int if_readlist_proc(char *target
_PATH_PROCNET_DEV, strerror(errno));
return -2;
}
- if (fgets(buf, sizeof buf, fh))
- /* eat line */;
- if (fgets(buf, sizeof buf, fh))
- /* eat line */;
+ if (getline(&line, &linelen, fh) == -1 /* eat line */
+ || getline(&line, &linelen, fh) == -1) { /* eat line */
+ err = -1;
+ goto out;
+ }
#if 0 /* pretty, but can't cope with missing fields */
fmt = proc_gen_fmt(_PATH_PROCNET_DEV, 1, fh,
@@ -358,13 +361,13 @@ static int if_readlist_proc(char *target
if (!fmt)
return -1;
#else
- procnetdev_vsn = procnetdev_version(buf);
+ procnetdev_vsn = procnetdev_version(line);
#endif
err = 0;
- while (fgets(buf, sizeof buf, fh)) {
- char *s, name[IFNAMSIZ];
- s = get_name(name, buf);
+ while (getline(&line, &linelen, fh) != -1) {
+ char *s, *name;
+ s = get_name(&name, line);
ife = if_cache_add(name);
get_dev_fields(s, ife);
ife->statistics_valid = 1;
@@ -379,6 +382,8 @@ static int if_readlist_proc(char *target
#if 0
free(fmt);
#endif
+ out:
+ free(line);
fclose(fh);
return err;
}
@@ -386,24 +391,28 @@ static int if_readlist_proc(char *target
static int if_readlist_rep(char *target, struct interface *ife)
{
FILE *fh;
- char buf[512];
int err;
+ char *line = NULL;
+ size_t linelen = 0;
fh = fopen(_PATH_PROCNET_DEV, "r");
if (!fh) {
fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
_PATH_PROCNET_DEV, strerror(errno));
return if_readconf();
- }
- fgets(buf, sizeof buf, fh); /* eat line */
- fgets(buf, sizeof buf, fh);
+ }
+ if (getline(&line, &linelen, fh) == -1 /* eat line */
+ || getline(&line, &linelen, fh) == -1) { /* eat line */
+ err = -1;
+ goto out;
+ }
- procnetdev_vsn = procnetdev_version(buf);
+ procnetdev_vsn = procnetdev_version(line);
err = 0;
- while (fgets(buf, sizeof buf, fh)) {
- char *s, name[IFNAMSIZ];
- s = get_name(name, buf);
+ while (getline(&line, &linelen, fh) != -1) {
+ char *s, *name;
+ s = get_name(&name, line);
get_dev_fields(s, ife);
if (target && !strcmp(target,name))
{
@@ -416,6 +425,8 @@ static int if_readlist_rep(char *target,
err = -1;
}
+ out:
+ free(line);
fclose(fh);
return err;
}

31
SOURCES/net-tools-ipx.patch

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
diff -up net-tools-2.0/lib/ipx_gr.c.ipx net-tools-2.0/lib/ipx_gr.c
--- net-tools-2.0/lib/ipx_gr.c.ipx 2013-09-10 12:33:52.494047907 +0200
+++ net-tools-2.0/lib/ipx_gr.c 2013-09-10 12:34:28.531561603 +0200
@@ -72,7 +72,7 @@ int IPX_rprint(int options)
continue;
/* Fetch and resolve the Destination */
- (void) ap->input(5, net, &sa);
+ (void) ap->input(1, net, &sa);
safe_strncpy(net, ap->sprint(&sa, numeric), sizeof(net));
/* Fetch and resolve the Router Net */
diff -up net-tools-2.0/netstat.c.ipx net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.ipx 2013-09-10 12:33:52.491047948 +0200
+++ net-tools-2.0/netstat.c 2013-09-10 12:33:52.495047894 +0200
@@ -1643,13 +1643,13 @@ static int ipx_info(void)
}
/* Fetch and resolve the Source */
- (void) ap->input(4, sad, &sa);
+ (void) ap->input(0, sad, &sa);
safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
snprintf(sad, sizeof(sad), "%s:%04X", buf, sport);
if (!nc) {
/* Fetch and resolve the Destination */
- (void) ap->input(4, dad, &sa);
+ (void) ap->input(0, dad, &sa);
safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
} else

147
SOURCES/net-tools-man.patch

@ -0,0 +1,147 @@ @@ -0,0 +1,147 @@
diff -up net-tools-2.0/man/en_US/arp.8.man net-tools-2.0/man/en_US/arp.8
--- net-tools-2.0/man/en_US/arp.8.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/arp.8 2013-04-25 10:52:01.704114832 +0200
@@ -63,6 +63,10 @@ arp \- manipulate the system ARP cache
.B \-f
.RI [ filename ]
+.SH NOTE
+.P
+This program is obsolete. For replacement check \fBip neigh\fR.
+
.SH DESCRIPTION
.B Arp
manipulates or displays the kernel's IPv4 network neighbour cache. It can add
@@ -219,6 +223,6 @@ published proxy ARP entries and permanen
.br
.I /etc/ethers
.SH SEE ALSO
-rarp(8), route(8), ifconfig(8), netstat(8)
+.BR ip(8)
.SH AUTHORS
Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net\-tools@lina.inka.de>.
diff -up net-tools-2.0/man/en_US/ethers.5.man net-tools-2.0/man/en_US/ethers.5
--- net-tools-2.0/man/en_US/ethers.5.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/ethers.5 2013-04-25 10:52:01.704114832 +0200
@@ -26,6 +26,3 @@ can be resolved by DNS or a dot separate
.SH FILES \"{{{
/etc/ethers
.\"}}}
-.SH "SEE ALSO" \"{{{
-rarp(8)
-.\"}}}
diff -up net-tools-2.0/man/en_US/ifconfig.8.man net-tools-2.0/man/en_US/ifconfig.8
--- net-tools-2.0/man/en_US/ifconfig.8.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/ifconfig.8 2013-04-25 10:52:01.704114832 +0200
@@ -5,6 +5,13 @@ ifconfig \- configure a network interfac
.B "ifconfig [-v] [-a] [-s] [interface]"
.br
.B "ifconfig [-v] interface [aftype] options | address ..."
+
+.SH NOTE
+.P
+This program is obsolete!
+For replacement check \fBip addr\fR and \fBip link\fR.
+For statistics use \fBip -s link\fR.
+
.SH DESCRIPTION
.B Ifconfig
is used to configure the kernel-resident network interfaces. It is
@@ -222,7 +229,8 @@ package to display link layer informatio
While appletalk DDP and IPX addresses will be displayed they cannot be
altered by this command.
.SH SEE ALSO
-route(8), netstat(8), arp(8), rarp(8), iptables(8), ifup(8), interfaces(5).
+.BR ip(8),
+.BR iptables(8)
.br
http://physics.nist.gov/cuu/Units/binary.html - Prefixes for binary multiples
.SH AUTHORS
diff -up net-tools-2.0/man/en_US/mii-tool.8.man net-tools-2.0/man/en_US/mii-tool.8
--- net-tools-2.0/man/en_US/mii-tool.8.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/mii-tool.8 2013-04-25 10:52:52.198414912 +0200
@@ -18,6 +18,10 @@ mii\-tool \- view, manipulate media-inde
[\fB\-p\fR, \fB\-\-phy=\fIaddr\fR]
.RI "interface\ ..."
+.SH NOTE
+.P
+This program is obsolete. For replacement check \fBethtool\fB.
+
.SH DESCRIPTION
This utility checks or sets the status of a network interface's Media
Independent Interface (MII) unit. Most fast ethernet adapters use an
@@ -93,6 +97,9 @@ SIOCGMIIPHY on 'eth?' failed: Operation
The interface in question does not support MII queries. Most likely, it does not have
MII transceivers, at all.
+.SH SEE ALSO
+ethtool(8)
+
.SH AUTHORS
David Hinds \- dhinds@pcmcia.sourceforge.org
.br
diff -up net-tools-2.0/man/en_US/nameif.8.man net-tools-2.0/man/en_US/nameif.8
--- net-tools-2.0/man/en_US/nameif.8.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/nameif.8 2013-04-25 10:52:01.705114818 +0200
@@ -5,6 +5,12 @@ nameif \- name network interfaces based
.B "nameif [\-c configfile] [\-s]"
.br
.B "nameif [\-c configfile] [\-s] {interface macaddress}"
+
+.SH NOTE
+.P
+This program is obsolete. For replacement check \fBip link\fR.
+This functionality is also much better provided by udev methods.
+
.SH DESCRIPTION
.B nameif
renames network interfaces based on mac addresses. When no arguments are
@@ -31,5 +37,10 @@ should be run before the interface is up
.SH FILES
/etc/mactab
+
+.SH SEE ALSO
+.BR ip(8),
+.BR udev(7)
+
.SH BUGS
Only works for Ethernet currently.
diff -up net-tools-2.0/man/en_US/netstat.8.man net-tools-2.0/man/en_US/netstat.8
--- net-tools-2.0/man/en_US/netstat.8.man 2013-04-25 10:52:01.693114984 +0200
+++ net-tools-2.0/man/en_US/netstat.8 2013-04-25 10:52:01.705114818 +0200
@@ -196,7 +196,8 @@ Show the PID and name of the program to
.SS "\-l, \-\-listening"
Show only listening sockets. (These are omitted by default.)
.SS "\-a, \-\-all"
-Show both listening and non-listening sockets. With the
+Show both listening and non-listening (for TCP this means established
+connections) sockets. With the
.B \-\-interfaces
option, show interfaces that are not up
.SS "\-F"
diff -up net-tools-2.0/man/en_US/route.8.man net-tools-2.0/man/en_US/route.8
--- net-tools-2.0/man/en_US/route.8.man 2013-02-19 10:28:11.000000000 +0100
+++ net-tools-2.0/man/en_US/route.8 2013-04-25 10:52:01.706114804 +0200
@@ -52,6 +52,11 @@ If]
.RB [ \-\-version ]
.RB [ \-h ]
.RB [ \-\-help ]
+
+.SH NOTE
+.P
+This program is obsolete. For replacement check \fBip route\fR.
+
.SH DESCRIPTION
.B Route
manipulates the kernel's IP routing tables. Its primary use is to set
@@ -314,7 +319,7 @@ Whether or not the hardware address for
.I /proc/net/rt_cache
.LP
.SH SEE ALSO
-.I ifconfig(8), netstat(8), arp(8), rarp(8)
+.BR ip(8)
.LP
.SH HISTORY
.B Route

15
SOURCES/net-tools-netstat-probe.patch

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
diff -up net-tools-2.0/netstat.c.probe net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.probe 2012-10-04 11:36:15.085940621 +0200
+++ net-tools-2.0/netstat.c 2012-10-04 11:36:15.092940511 +0200
@@ -1267,6 +1267,11 @@ static void tcp_do_one(int lnr, const ch
(double) time_len / HZ, retr, timeout);
break;
+ case 4:
+ snprintf(timers, sizeof(timers), _("probe (%2.2f/%ld/%d)"),
+ (double) time_len / HZ, retr, timeout);
+ break;
+
default:
snprintf(timers, sizeof(timers), _("unkn-%d (%2.2f/%ld/%d)"),
timer_run, (double) time_len / HZ, retr, timeout);

74
SOURCES/net-tools-netstat-sctp-man.patch

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
diff --git a/man/de_DE/netstat.8 b/man/de_DE/netstat.8
index d6b77ff..fdb76c9 100644
--- a/man/de_DE/netstat.8
+++ b/man/de_DE/netstat.8
@@ -20,6 +20,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
.RB [ \-venaoc ]
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
+.RB [ \-\-udplite | \-U ]
+.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [ \-\-groups | \-g ]
.RB [ \-\-unix | \-x ]
diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8
index 831faf2..7fcd41b 100644
--- a/man/en_US/netstat.8
+++ b/man/en_US/netstat.8
@@ -21,6 +21,7 @@ netstat \- Print network connections, routing tables, interface statistics, masq
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
.RB [ \-\-udplite | \-U ]
+.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [ \-\-listening | \-l ]
.RB [ \-\-all | \-a ]
@@ -76,6 +77,7 @@ netstat \- Print network connections, routing tables, interface statistics, masq
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
.RB [ \-\-udplite | \-U ]
+.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [delay]
.P
diff --git a/man/fr_FR/netstat.8 b/man/fr_FR/netstat.8
index fedbe4f..c65d0be 100644
--- a/man/fr_FR/netstat.8
+++ b/man/fr_FR/netstat.8
@@ -21,6 +21,8 @@ et les membres multicast.
.RB [ \-venaoc ]
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
+.RB [ \-\-udplite | \-U ]
+.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [ \-\-groups | \-g ]
.RB [ \-\-unix | \-x ]
diff --git a/man/pt_BR/netstat.8 b/man/pt_BR/netstat.8
index 1903bbb..d2d04ef 100644
--- a/man/pt_BR/netstat.8
+++ b/man/pt_BR/netstat.8
@@ -19,6 +19,8 @@ mascaradas.
.RB [ \-venaoc ]
.RB [ \-\-tcp | \-t ]
.RB [ \-\-udp | \-u ]
+.RB [ \-\-udplite | \-U ]
+.RB [ \-\-sctp | \-S ]
.RB [ \-\-raw | \-w ]
.RB [ \-\-unix | \-x ]
.RB [ \-\-inet | \-\-ip ]
diff --git a/netstat.c b/netstat.c
index 43bd62f..ca93260 100644
--- a/netstat.c
+++ b/netstat.c
@@ -2094,8 +2095,8 @@ static void usage(void)
fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n"));
#endif
- fprintf(stderr, _("\n <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix}\n"));
- fprintf(stderr, _(" --ax25 --ipx --netrom\n"));
+ fprintf(stderr, _("\n <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}\n"));
+ fprintf(stderr, _(" {-x|--unix} --ax25 --ipx --netrom\n"));
fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
fprintf(stderr, _(" List of possible address families (which support routing):\n"));
print_aflist(1); /* 1 = routeable */

33
SOURCES/net-tools-sctp-quiet.patch

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
diff --git a/netstat.c b/netstat.c
index 911d0c3..d6037a0 100644
--- a/netstat.c
+++ b/netstat.c
@@ -167,6 +167,7 @@ int flag_exp = 1;
int flag_wide= 0;
int flag_prg = 0;
int flag_arg = 0;
+int flag_noprot = 0;
int flag_ver = 0;
int flag_l2cap = 0;
int flag_rfcomm = 0;
@@ -181,9 +182,9 @@ FILE *procinfo;
perror((file)); \
return -1; \
} \
- if (flag_arg || flag_ver) \
+ if (!flag_noprot && (flag_arg || flag_ver)) \
ESYSNOT("netstat", (name)); \
- if (flag_arg) \
+ if (!flag_noprot && flag_arg) \
rc = 1; \
} else { \
do { \
@@ -2308,7 +2309,7 @@ int main
if ((flag_inet || flag_inet6 || flag_sta) &&
!(flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw))
- flag_tcp = flag_sctp = flag_udp = flag_udplite = flag_raw = 1;
+ flag_noprot = flag_tcp = flag_sctp = flag_udp = flag_udplite = flag_raw = 1;
if ((flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw || flag_igmp) &&
!(flag_inet || flag_inet6))

534
SOURCES/net-tools-sctp-statistics.patch

@ -0,0 +1,534 @@ @@ -0,0 +1,534 @@
diff -up net-tools-2.0/netstat.c.sctp net-tools-2.0/netstat.c
--- net-tools-2.0/netstat.c.sctp 2013-09-23 15:14:59.524866201 +0200
+++ net-tools-2.0/netstat.c 2013-09-23 15:24:20.259143969 +0200
@@ -115,7 +115,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);
@@ -888,159 +888,269 @@ static int igmp_info(void)
igmp_do_one, "igmp", "igmp6");
}
-static int ip_parse_dots(uint32_t *addr, char const *src) {
- unsigned a, b, c, d;
- unsigned ret = 4-sscanf(src, "%u.%u.%u.%u", &a, &b, &c, &d);
- *addr = htonl((a << 24)|(b << 16)|(c << 8)|d);
- return ret;
-}
-
-static void print_ip_service(struct sockaddr_in *addr, char const *protname,
- char *buf, unsigned size) {
- struct aftype *ap;
-
- if(size == 0) return;
-
- /* print host */
- if((ap = get_afntype(addr->sin_family)) == NULL) {
- fprintf(stderr, _("netstat: unsupported address family %d !\n"),
- addr->sin_family);
- return;
- }
- safe_strncpy(buf, ap->sprint((struct sockaddr*)addr, flag_not), size);
-
- /* print service */
- if(flag_all || (flag_lst && !addr->sin_port) || (!flag_lst && addr->sin_port)) {
- char bfs[32];
-
- snprintf(bfs, sizeof(bfs), "%s",
- get_sname(addr->sin_port, (char*)protname, flag_not & FLAG_NUM_PORT));
-
- /* check if we must cut on host and/or service name */
- {
- unsigned const bufl = strlen(buf);
- unsigned const bfsl = strlen(bfs);
-
- if(bufl+bfsl+2 > size) {
- unsigned const half = (size-2)>>1;
- if(bufl > half) {
- if(bfsl > half) {
- buf[size-2-half] = '\0';
- bfs[half+1] = '\0';
- }
- else buf[size-2-bfsl] = '\0';
- }
- else bfs[size-2-bufl] = '\0';
- }
+static const char *sctp_socket_state_str(int state)
+{
+ if(state>=0 && state<=10)
+ return tcp_state[state];
+ else {
+ static char state_str_buf[64];
+ sprintf(state_str_buf,"UNKNOWN(%d)",state);
+ return state_str_buf;
}
- strcat(buf, ":");
- strcat(buf, bfs);
- }
}
-/* process single SCTP endpoint */
-static void sctp_do_ept(int lnr, char const *line, const char *prot)
+static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa)
{
- struct sockaddr_in laddr, raddr;
- unsigned uid, inode;
-
- char l_addr[23], r_addr[23];
-
- /* fill sockaddr_in structures */
- {
- unsigned lport;
- unsigned ate;
-
- if(lnr == 0) return;
- if(sscanf(line, "%*X %*X %*u %*u %*u %u %u %u %n",
- &lport, &uid, &inode, &ate) < 3) goto err;
-
- /* decode IP address */
- if(ip_parse_dots(&laddr.sin_addr.s_addr, line+ate)) goto err;
- raddr.sin_addr.s_addr = htonl(0);
- laddr.sin_family = raddr.sin_family = AF_INET;
- laddr.sin_port = htons(lport);
- raddr.sin_port = htons(0);
- }
+ if (strchr(addr_str,':')) {
+#if HAVE_AFINET6
+ extern struct aftype inet6_aftype;
+ /* Demangle what the kernel gives us */
+ struct in6_addr in6;
+ char addr6_str[INET6_ADDRSTRLEN];
+ unsigned u0,u1,u2,u3,u4,u5,u6,u7;
+ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",
+ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7);
+ in6.s6_addr16[0] = htons(u0);
+ in6.s6_addr16[1] = htons(u1);
+ in6.s6_addr16[2] = htons(u2);
+ in6.s6_addr16[3] = htons(u3);
+ in6.s6_addr16[4] = htons(u4);
+ in6.s6_addr16[5] = htons(u5);
+ in6.s6_addr16[6] = htons(u6);
+ in6.s6_addr16[7] = htons(u7);
+
+ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str));
+ inet6_aftype.input(1, addr6_str, sa);
+ sa->sa_family = AF_INET6;
+#endif
+ } else {
+ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str);
+ sa->sa_family = AF_INET;
+ }
+ return get_afntype(sa->sa_family);
+}
- /* print IP:service to l_addr and r_addr */
- print_ip_service(&laddr, prot, l_addr, sizeof(l_addr));
- print_ip_service(&raddr, prot, r_addr, sizeof(r_addr));
-
- /* Print line */
- printf("%-4s %6d %6d %-*s %-*s %-11s",
- prot, 0, 0,
- (int)netmax(23,strlen(l_addr)), l_addr,
- (int)netmax(23,strlen(r_addr)), r_addr,
- _(tcp_state[TCP_LISTEN]));
- finish_this_one(uid, inode, "");
- return;
- err:
- fprintf(stderr, "SCTP error in line: %d\n", lnr);
-}
-
-/* process single SCTP association */
-static void sctp_do_assoc(int lnr, char const *line, const char *prot)
-{
- struct sockaddr_in laddr, raddr;
- unsigned long rxq, txq;
- unsigned uid, inode;
-
- char l_addr[23], r_addr[23];
-
- /* fill sockaddr_in structures */
- {
- unsigned lport, rport;
- unsigned ate;
- char const *addr;
-
- if(lnr == 0) return;
- if(sscanf(line, "%*X %*X %*u %*u %*u %*u %*u %lu %lu %u %u %u %u %n",
- &txq, &rxq, &uid, &inode, &lport, &rport, &ate) < 6) goto err;
-
- /* decode IP addresses */
- addr = strchr(line+ate, '*');
- if(addr == 0) goto err;
- if(ip_parse_dots(&laddr.sin_addr.s_addr, ++addr)) goto err;
- addr = strchr(addr, '*');
- if(addr == 0) goto err;
- if(ip_parse_dots(&raddr.sin_addr.s_addr, ++addr)) goto err;
-
- /* complete sockaddr_in structures */
- laddr.sin_family = raddr.sin_family = AF_INET;
- laddr.sin_port = htons(lport);
- raddr.sin_port = htons(rport);
- }
+static void sctp_eps_do_one(int lnr, char *line, const char *proto)
+{
+ char buffer[1024];
+ int state, port;
+ int uid;
+ unsigned long inode;
+ struct aftype *ap;
+#if HAVE_AFINET6
+ struct sockaddr_in6 localaddr;
+#else
+ struct sockaddr_in localaddr;
+#endif
+ const char *sst_str;
+ const char *lport_str;
+ const char *uid_str;
+ const char *inode_str;
+ char *laddrs_str;
+
+ if(lnr == 0) {
+ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */
+ return;
+ }
+ strtok(line," \t\n"); /*skip endpt*/
+ strtok(0," \t\n"); /*skip sock*/
+ strtok(0," \t\n"); /*skp sty*/
+ 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");
+ laddrs_str=strtok(0,"\t\n");
+
+ if (!sst_str || !lport_str || !uid_str || !inode_str) {
+ fprintf(stderr, _("warning, got bogus sctp eps line.\n"));
+ return;
+ }
+ state = atoi(sst_str);
+ port = atoi(lport_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+
+ const char *this_local_addr;
+ int first=1;
+ char local_port[16];
+ snprintf(local_port, sizeof(local_port), "%s",
+ get_sname(htons(port), proto, 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(" %-11s", first?sctp_socket_state_str(state):"");
+ first = 0;
+ }
+ finish_this_one(uid,inode,"");
+}
+
+static void sctp_assoc_do_one(int lnr, char *line, const char *proto)
+{
+ char buffer[1024];
+ int state, lport,rport;
+ int uid;
+ unsigned rxqueue,txqueue;
+ unsigned long inode;
+
+ struct aftype *ap;
+#if HAVE_AFINET6
+ struct sockaddr_in6 localaddr,remoteaddr;
+#else
+ struct sockaddr_in localaddr,remoteaddr;
+#endif
+ const char *sst_str;
+ const char *txqueue_str;
+ const char *rxqueue_str;
+ const char *lport_str,*rport_str;
+ const char *uid_str;
+ const char *inode_str;
+ char *laddrs_str;
+ char *raddrs_str;
+
+ if(lnr == 0) {
+ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */
+ return;
+ }
+
+ strtok(line," \t\n"); /*skip assoc*/
+ strtok(0," \t\n"); /*skip sock*/
+ strtok(0," \t\n"); /*skp sty*/
+ sst_str = strtok(0," \t\n");
+ 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");
+ laddrs_str = strtok(0,"<->\t\n");
+ raddrs_str = strtok(0,"<->\t\n");
+
+ if (!sst_str || !txqueue_str || !rxqueue_str || !uid_str ||
+ !inode_str || !lport_str || !rport_str) {
+ fprintf(stderr, _("warning, got bogus sctp assoc line.\n"));
+ return;
+ }
+
+ state = atoi(sst_str);
+ txqueue = atoi(txqueue_str);
+ rxqueue = atoi(rxqueue_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+ lport = atoi(lport_str);
+ rport = atoi(rport_str);
+
+ /*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), proto,
+ flag_not & FLAG_NUM_PORT));
+ snprintf(remote_port, sizeof(remote_port), "%s",
+ get_sname(htons(rport), proto,
+ 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(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(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+ }
- /* print IP:service to l_addr and r_addr */
- print_ip_service(&laddr, prot, l_addr, sizeof(l_addr));
- print_ip_service(&raddr, prot, r_addr, sizeof(r_addr));
-
- /* Print line */
- printf("%-4s %6ld %6ld %-*s %-*s %-11s",
- prot, rxq, txq,
- (int)netmax(23,strlen(l_addr)), l_addr,
- (int)netmax(23,strlen(r_addr)), r_addr,
- _(tcp_state[TCP_ESTABLISHED]));
- finish_this_one(uid, inode, "");
- return;
- err:
- fprintf(stderr, "SCTP error in line: %d\n", lnr);
+ if(!first) printf("\n");
+ if(first)
+ printf("sctp %6u %6u ", rxqueue, txqueue);
+ else
+ printf(" ");
+ if(this_local_addr) {
+ if(first)
+ sprintf(buffer,"%s:%s", local_addr, local_port);
+ else
+ sprintf(buffer,"%s", local_addr);
+ printf("%-23s", buffer);
+ } else
+ printf("%-23s", "");
+ printf(" ");
+ if(this_remote_addr) {
+ if(first)
+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
+ else
+ sprintf(buffer,"%s", remote_addr);
+ printf("%-23s", buffer);
+ } else
+ printf("%-23s", "");
+
+ printf(" %-11s", first?sctp_socket_state_str(state):"");
+
+ first = 0;
+ this_local_addr=strtok_r(0," \t\n",&ss1);
+ this_remote_addr=strtok_r(0," \t\n",&ss2);
+ }
+ finish_this_one(uid,inode,"");
}
-static int sctp_info_epts(void) {
+static int sctp_info_eps(void)
+{
INFO_GUTS6(_PATH_PROCNET_SCTPEPTS, _PATH_PROCNET_SCTP6EPTS, "AF INET (sctp)",
- sctp_do_ept, "sctp", "sctp6");
+ sctp_eps_do_one, "sctp", "sctp6");
}
static int sctp_info_assocs(void) {
INFO_GUTS6(_PATH_PROCNET_SCTPASSOCS, _PATH_PROCNET_SCTP6ASSOCS, "AF INET (sctp)",
- sctp_do_assoc, "sctp", "sctp6");
+ sctp_assoc_do_one, "sctp", "sctp6");
}
static int sctp_info(void) {
int res;
- res = sctp_info_epts();
+ res = sctp_info_eps();
if(res) return res;
return sctp_info_assocs();
}
@@ -2234,7 +2344,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-2.0/statistics.c.sctp net-tools-2.0/statistics.c
--- net-tools-2.0/statistics.c.sctp 2013-09-23 15:14:59.501866518 +0200
+++ net-tools-2.0/statistics.c 2013-09-23 15:14:59.534866063 +0200
@@ -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,38 @@ 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 +588,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);
}

16
SOURCES/net-tools-statalias.patch

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
diff -up net-tools-2.0/lib/interface.c.statalias net-tools-2.0/lib/interface.c
--- net-tools-2.0/lib/interface.c.statalias 2012-10-04 11:33:05.490889090 +0200
+++ net-tools-2.0/lib/interface.c 2012-10-04 11:33:05.513888785 +0200
@@ -405,9 +405,11 @@ static int if_readlist_rep(char *target,
char *s, name[IFNAMSIZ];
s = get_name(name, buf);
get_dev_fields(s, ife);
- ife->statistics_valid = 1;
if (target && !strcmp(target,name))
+ {
+ ife->statistics_valid = 1;
break;
+ }
}
if (ferror(fh)) {
perror(_PATH_PROCNET_DEV);

902
SPECS/net-tools.spec

@ -0,0 +1,902 @@ @@ -0,0 +1,902 @@
%global checkout 20131004git

Summary: Basic networking tools
Name: net-tools
Version: 2.0
Release: 0.22.%{checkout}%{?dist}
License: GPLv2+
Group: System Environment/Base
URL: http://sourceforge.net/projects/net-tools/

# git archive --format=tar --remote=git://git.code.sf.net/p/net-tools/code master | xz > net-tools-%%{version}.%%{checkout}.tar.xz
Source0: net-tools-%{version}.%{checkout}.tar.xz
Source1: net-tools-config.h
Source2: net-tools-config.make
Source3: ether-wake.c
Source4: ether-wake.8
Source5: mii-diag.c
Source6: mii-diag.8
Source7: iptunnel.8
Source8: ipmaddr.8
Source9: arp-ethers.service

# adds <delay> option that allows netstat to cycle printing through statistics every delay seconds.
Patch1: net-tools-cycle.patch

# Fixed incorrect address display for ipx (#46434)
Patch2: net-tools-ipx.patch

# various man page fixes merged into one patch
Patch3: net-tools-man.patch

# netstat: interface option now works as described in the man page (#61113, #115987)
Patch4: net-tools-interface.patch

# filter out duplicate tcp entries (#139407)
Patch5: net-tools-duplicate-tcp.patch

# don't report statistics for virtual devices (#143981)
Patch6: net-tools-statalias.patch

# clear static buffers in interface.c by Ulrich Drepper (#176714)
Patch7: net-tools-interface_stack.patch

# statistics for SCTP
Patch8: net-tools-sctp-statistics.patch

# ifconfig crash when interface name is too long (#190703)
Patch9: net-tools-ifconfig-long-iface-crasher.patch

# fixed tcp timers info in netstat (#466845)
Patch10: net-tools-netstat-probe.patch

# use all interfaces instead of default (#1003875)
Patch20: ether-wake-interfaces.patch

# make sctp quiet on systems without sctp (#1063906)
Patch21: net-tools-sctp-quiet.patch

# make net-tools exit with correct exit code when provided with wrong parameters
Patch22: net-tools-correct-exit-code.patch

# make ifconfig accurately round exabytes
Patch23: net-tools-ifconfig-EiB.patch

# sctp was not documented in help and manpage
Patch24: net-tools-netstat-sctp-man.patch

BuildRequires: gettext, libselinux
BuildRequires: libselinux-devel
BuildRequires: systemd-units
Requires(post): systemd-units

%description
The net-tools package contains basic networking tools,
including ifconfig, netstat, route, and others.
Most of them are obsolete. For replacement check iproute package.

%prep
%setup -q -c
%patch1 -p1 -b .cycle
%patch2 -p1 -b .ipx
%patch3 -p1 -b .man
%patch4 -p1 -b .interface
%patch5 -p1 -b .dup-tcp
%patch6 -p1 -b .statalias
%patch7 -p1 -b .stack
%patch8 -p1 -b .sctp
%patch9 -p1 -b .long_iface
%patch10 -p1 -b .probe

cp %SOURCE1 ./config.h
cp %SOURCE2 ./config.make
cp %SOURCE3 .
cp %SOURCE4 ./man/en_US
cp %SOURCE5 .
cp %SOURCE6 ./man/en_US
cp %SOURCE7 ./man/en_US
cp %SOURCE8 ./man/en_US

%patch20 -p1 -b .interfaces
%patch21 -p1 -b .sctp-quiet
%patch22 -p1 -b .exit-code
%patch23 -p1 -b .round-EiB
%patch24 -p1 -b .sctp-man

touch ./config.h

%build
# Sparc and s390 arches need to use -fPIE
%ifarch sparcv9 sparc64 s390 s390x
export CFLAGS="$RPM_OPT_FLAGS $CFLAGS -fPIE"
%else
export CFLAGS="$RPM_OPT_FLAGS $CFLAGS -fpie"
%endif
# RHBZ #853193
export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"

make
make ether-wake
gcc $RPM_OPT_FLAGS -o mii-diag mii-diag.c

%install
mv man/de_DE man/de
mv man/fr_FR man/fr
mv man/pt_BR man/pt

make BASEDIR=%{buildroot} mandir=%{_mandir} install

# ifconfig and route are installed into /bin by default
# mv them back to /sbin for now as I (jpopelka) don't think customers would be happy
mv %{buildroot}/bin/ifconfig %{buildroot}/sbin
mv %{buildroot}/bin/route %{buildroot}/sbin

install -m 755 ether-wake %{buildroot}/sbin
install -m 755 mii-diag %{buildroot}/sbin

rm %{buildroot}/sbin/rarp
rm %{buildroot}%{_mandir}/man8/rarp.8*
rm %{buildroot}%{_mandir}/de/man8/rarp.8*
rm %{buildroot}%{_mandir}/fr/man8/rarp.8*
rm %{buildroot}%{_mandir}/pt/man8/rarp.8*

# remove hostname (has its own package)
rm %{buildroot}/bin/dnsdomainname
rm %{buildroot}/bin/domainname
rm %{buildroot}/bin/hostname
rm %{buildroot}/bin/nisdomainname
rm %{buildroot}/bin/ypdomainname
rm -rf %{buildroot}%{_mandir}/de/man1
rm -rf %{buildroot}%{_mandir}/fr/man1
rm -rf %{buildroot}%{_mandir}/man1
rm -rf %{buildroot}%{_mandir}/pt/man1

# install systemd unit file
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE9} %{buildroot}%{_unitdir}

%find_lang %{name} --all-name --with-man

%post
%systemd_post arp-ethers.service

%files -f %{name}.lang
%doc COPYING
/bin/netstat
/sbin/ifconfig
/sbin/route
/sbin/arp
/sbin/ether-wake
/sbin/ipmaddr
/sbin/iptunnel
/sbin/mii-diag
/sbin/mii-tool
/sbin/nameif
/sbin/plipconfig
/sbin/slattach
%{_mandir}/man[58]/*
%attr(0644,root,root) %{_unitdir}/arp-ethers.service

%changelog
* Wed Mar 29 2017 Michal Ruprich - 2.0-0.22.20131004git
- Resolves: #1167833 - netstat -S/--sctp not documented

* Wed Mar 22 2017 Michal Ruprich - 2.0-0.21.20131004git
- Related: #1427889 - exit code on wrong parameter is zero for many net-tools binaries

* Wed Mar 22 2017 Michal Ruprich - 2.0-0.20.20131004git
- Resolves: #1427889 - exit code on wrong parameter is zero for many net-tools binaries

* Mon Feb 27 2017 Michal Ruprich - 2.0-0.19.20131004git
- Related: #1257549 - netstat tool does not throw correct exit code on wrong parameter

* Wed Jan 18 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.18.20131004git
- Resolves: #1063913 - netstat doesn't list sctp servers in -A mode
- Resolves: #1257549 - netstat tool does not throw correct exit code on wrong parameter
- Resolves: #1392910 - ifconfig inaccurately rounds exabytes

* Fri Feb 14 2014 Jaromír Končický <jkoncick@redhat.com> - 2.0-0.17.20131004git
- remake sctp-quiet.patch (#1063906#c7)

* Tue Feb 11 2014 Jaromír Končický <jkoncick@redhat.com> - 2.0-0.20.20131119git
- make sctp quiet on systems without sctp (#1063906)

* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.0-0.15.20131004git
- Mass rebuild 2014-01-24

* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.0-0.14.20131004git
- Mass rebuild 2013-12-27

* Fri Oct 04 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.13.20131004git
- latest snapshot (#1013530)
- remove %%ifarch alpha condition from %%prep
- improve sctp-statistics.patch (#982638#c10)

* Tue Sep 10 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.12.20130910git
- latest snapshot

* Wed Sep 04 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.11.20130607git
- amend ether-wake-interfaces.patch

* Wed Sep 04 2013 Jaromír Končický <jkoncick@redhat.com> - 2.0-0.10.20130607git
- use all interfaces instead of default (#1003875)
- reverted all changes on ether-wake.c and put original file

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-0.9.20130607git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Jun 07 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.8.20130607git
- latest snapshot

* Thu Apr 25 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.7.20130425git
- latest snapshot

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-0.6.20130109git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 09 2013 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.5.20130109git
- latest snapshot (#579855)

* Fri Nov 30 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.4.20121106git
- fix URL

* Fri Nov 16 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.3.20121106git
- match actual license

* Tue Nov 06 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.2.20121106git
- few man page fixes

* Thu Oct 04 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.1.20121004git
- the git snapshot we ship is actually much more a
2.0 pre-release then 1.60 post-release

* Mon Oct 01 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-145.20120917git
- compile without STRIP (Metricom radio) support

* Mon Sep 17 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-144.20120917git
- upstream git snapshot

* Wed Sep 05 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-143.20120702git
- Sparc and s390 arches need to use -fPIE

* Wed Sep 05 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-142.20120702git
- compile with PIE and full RELRO flags (#853193)

* Wed Aug 22 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-141.20120702git
- fixed building with kernel-3.6

* Wed Aug 22 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-140.20120702git
- use new systemd-rpm macros (#850225)

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.60-139.20120702git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jul 02 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-138.20120702git
- fixes for #834110 and #836258 merged upstream

* Wed Jun 20 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-137.20120509git
- compile without Token ring support (http://lwn.net/Articles/497397/)

* Tue Jun 19 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-136.20120509git
- better SCTP support (#826676)

* Wed May 09 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-135.20120509git
- don't require hostname package

* Fri Jan 27 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-134.20120127git
- Do not show interface metric in 'ifconfig', 'ifconfig -s' and 'netstat -i'.
Spare place is used for interface name so trim_iface.patch is no longer needed.
- No need to convert man pages to utf-8 as upstream ship them in utf-8 now.

* Thu Jan 19 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-133.20120119git
- SELinux patch merged upstream
- several page fixes merged upstream
- mark localized man pages with %%lang

* Wed Jan 11 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-132.20120111git
- 3 patches merged upstream
- removed 2digit.patch (#718610)
- removed fgets.patch (probably not needed anymore)

* Thu Jan 05 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-131.20120105git
- next 11 patches merged upstream
- removed bcast.patch (seems to be fixed upstream)
- removed netstat-p-basename.patch (upstream is not happy with it)
- netstat-leak.patch merged into duplicate-tcp.patch

* Wed Dec 07 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-130.20111207git
- removed virtualname.patch
- added back isofix.patch
- improved mii-registers.patch

* Tue Dec 06 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.
- Improved num-ports.patch

* Thu Oct 20 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-127
- Merge all upstream fixes into net-tools-1.60-upstream.patch

* Tue Oct 18 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-126
- Upstream is migrating to Sourceforge.

* Mon Oct 03 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-125
- Fixed ether-wake(8) and mii-diag(8) man pages (#742629)

* Mon Sep 19 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-124
- Improved arp-ethers.service unit file (#735617)

* Wed Aug 24 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-123
- Improved netstat_stop_trim.patch to not truncate IPV6 UDP sockets (#732984)

* Mon Jul 04 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-122
- Update for 2 digit Linux version numbers (#718610)

* Fri Jun 17 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-121
- Added arp-ethers.service systemd unit file to run 'arp -f /etc/ethers'
on startup of system. Don't ship default /etc/ethers (#713759)

* Wed May 25 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-120
- Do not mention /proc/net/socket in ifconfig(8) (#661905)
- Merge all 'man page only fix' patches into net-tools-1.60-man.patch

* Thu Apr 28 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-119
- Fix possible problems found by static analysis of code.

* Thu Apr 21 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-118
- patch netstat to separate basename of -p only if it is absolute
path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0).

* Thu Apr 14 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-117
- plipconfig man page and usage output fixes. (#694766)

* Mon Mar 07 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-116
- Fix mii-tool/mii-diag/ether-wake to not default to eth0 because
since Fedora 15 network devices can have arbitrary names (#682367)

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.60-115
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Feb 04 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-114
- Improve scanf-format.patch (#668047)

* Fri Jan 21 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-113
- Improve route(8) man page saying that 'route mss' actually sets MTU (#671321)

* Mon Jan 03 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-112
- Fix the handling of some of the HAVE_* flags ifdef vs if. (BerliOS #17812)

* Thu Dec 16 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-111
- fixed mii-diag(8) man page (#663689)
- fixed route(8) man page (#664171)

* Thu Dec 16 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-110
- fixed ifconfig(8) man page (#663469)

* Wed Nov 17 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-109
- improved netstat(8) man page (#614931)

* Mon Nov 01 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-108
- added netstat(8) support for RcvbufErrors, SndbufErrors (BerliOS #17645)

* Wed Sep 29 2010 jkeating - 1.60-107
- Rebuilt for gcc bug 634757

* Thu Sep 16 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-106
- HFI support

* Thu Sep 16 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-105
- fixed memory leak in netstat when run with -c option

* Tue Aug 10 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-104
- improved statistics-doubleword.patch (Bug #579854)

* Mon Jun 14 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-103
- updated mii-tool to support gigabit links (#539575)

* Wed Apr 7 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-102
- fixed statistics.c to use unsigned long long (instead of int) to handle 64 bit integers (Bug #579854, Debian #561161)
- fixed typo in statistics.c (Bug #579855)

* Sat Jan 2 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-101
- fixed overflow patch (#551625)
- ifconfig interface:0 del <IP> will remove the Aliased IP on IA64 (#473211)
- interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways
- interface: fix IPv6 parsing of interfaces with large indexes (> 255) (Debian #433543)

* Mon Dec 21 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-100
- Move hostname to separate package

* Thu Dec 3 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-99
- return defining of BuildRoot even it's no longer necessary
(https://fedoraproject.org/wiki/Packaging:Guidelines#BuildRoot_tag)
to silent rpmlint false warning

* Wed Nov 4 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-98
- in mii-tool.c use <linux/mii.h> instead of "mii.h" and fix Bug #491358

* Thu Oct 29 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-97
- Make "hostname -s" display host name cut at the first dot (no
matter if the host name resolves or not) (bug #531702)

* Wed Sep 30 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-96
- netplug moved to separate package
- #319981 and #322901 - minor man pages changes
- applied changes from berlios cvs, which fix: Berlios #16232, Gentoo #283759 and polish Makefile and slattach

* Tue Sep 1 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-95
- netstat - avoid name resolution for listening or established sockets (-l) by return fast.
- netstat - --continuous should flush stdout
- added missing man pages (iptunnel, ipmaddr, netplug, netplug.d, netplugd.conf)
- added note about obsolete commands to existing man pages
- let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.60-94
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jul 8 2009 Jiri Popelka <jpopelka@redhat.com> - 1.60-93
- scanf format length fix (non exploitable?) from Fabian Hugelshofer <hugelshofer2006@gmx.ch>
- URL tag changed to http://net-tools.berlios.de/

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.60-92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Oct 16 2008 Zdenek Prikryl <zprikryl@redhat.com> - 1.60-91
- fixed tcp timers info in netstat (#466845)

* Thu Sep 25 2008 Zdenek Prikryl <zprikryl@redhat.com> - 1.60-90
- fixed ifconfig's man page (#454271, #432328)

* Tue Jul 15 2008 Zdenek Prikryl <zprikryl@redhat.com> - 1.60-89
- fixed man pages for arp (#446195)
- fixed netstat --interfaces option (#446187)
- fixed clearing flags in ifconfig (#450252)

* Tue Jul 8 2008 Radek Vokál <rvokal@redhat.com> - 1.60-88
- netstat displays correct sctp statistics (#445535) <zprikryl@redhat.com>

* Tue Mar 4 2008 Radek Vokál <rvokal@redhat.com> - 1.60-87
- fix buffer for newer kernels (#435554)

* Mon Feb 25 2008 Radek Vokal <rvokal@redhat.com> - 1.60-86
- fix for GCC 4.3

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.60-85
- Autorebuild for GCC 4.3

* Thu Aug 23 2007 Radek Vokál <rvokal@redhat.com> - 1.60-84
- rebuilt

* Fri Jun 8 2007 Radek Vokál <rvokal@redhat.com> - 1.60-83
- fix netplugd init script (#242919)

* Tue May 22 2007 Radek Vokál <rvokal@redhat.com> - 1.60-82
- better SELinux patch by <dwalsh@redhat.com>

* Tue Mar 27 2007 Radek Vokál <rvokal@redhat.com> - 1.60-81
- fix segfault for empty interface (#234045)

* Thu Mar 15 2007 Radek Vokál <rvokal@redhat.com> - 1.60-80
- we don't have -n/--node option (#225554)

* Thu Feb 22 2007 Radek Vokál <rvokal@redhat.com> - 1.60-79
- quiet sctp (#229232)

* Mon Feb 19 2007 Radek Vokál <rvokal@redhat.com> - 1.60-78
- spec file cleanup (#226193)

* Tue Jan 30 2007 Radek Vokál <rvokal@redhat.com> - 1.60-77
- touch /etc/ethers (#225381)

* Wed Dec 27 2006 Radek Vokál <rvokal@redhat.com> - 1.60-76
- fix arp unaligned access (#220438)

* Wed Oct 4 2006 Radek Vokal <rvokal@redhat.com> - 1.60-75
- fix nameif crash for 16char long interface names (#209120)

* Mon Oct 2 2006 Radek Vokal <rvokal@redhat.com> - 1.60-74
- fix -I option for nestat, works as -I=eth0 again.
- add dist tag

* Mon Aug 7 2006 Radek Vokal <rvokal@redhat.com> - 1.60-73
- directory entries . and .. should be skipped

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.60-72.1
- rebuild

* Wed Jun 7 2006 Radek Vokal <rvokal@redhat.com> - 1.60-72
- switch --trim to --notrim .. make it less confusing

* Fri May 19 2006 Radek Vokal <rvokal@redhat.com> - 1.60-71
- BuildRequires: libselinux-devel (#191737)

* Tue May 09 2006 Radek Vokál <rvokal@redhat.com> - 1.60-70
- add netdevice.h, fix x25
- fix ifconfig crash when interface name is too long (#190703)

* Tue May 02 2006 Radek Vokál <rvokal@redhat.com> - 1.60-69
- fix arp man page to correspond to man ethers (#190425)

* Fri Apr 14 2006 Radek Vokál <rvokal@redhat.com> - 1.60-68
- display sctp connections using netstat -S <jbj@redhat.com>

* Thu Apr 13 2006 Radek Vokál <rvokal@redhat.com> - 1.60-67
- fix wrong definition of _PATH_PROCNET_X25_ROUTE (#188786)

* Thu Apr 06 2006 Radek Vokál <rvokal@redhat.com> - 1.60-66
- add note about -T to netstat

* Thu Mar 30 2006 Radek Vokál <rvokal@redhat.com> - 1.60-65
- add note to ifconfig(8) about supported format for IPv4 addresses (#176661)

* Thu Mar 16 2006 Radek Vokál <rvokal@redhat.com> - 1.60-64
- remove duplicate arp entries (#185604)

* Thu Feb 23 2006 Radek Vokál <rvokal@redhat.com> - 1.60-63
- show inodes in netstat (#180974)

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.60-62.1
- bump again for double-long bug on ppc(64)

* Fri Feb 10 2006 Radek Vokál <rvokal@redhat.com> - 1.60-62
- new option for netstat - -T stops trimming remote and local addresses (#176465)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.60-61.1
- rebuilt for new gcc4.1 snapshot and glibc changes

* Mon Feb 06 2006 Radek Vokál <rvokal@redhat.com> 1.60-61
- mii-tool manpage fixed (#180055)

* Tue Jan 17 2006 Radek Vokal <rvokal@redhat.com> 1.60-60
- forget to enable the new selinux option :( - config.make changed

* Tue Jan 17 2006 Radek Vokal <rvokal@redhat.com> 1.60-59
- new option for nestat, -Z shows selinux context. Patch by <dwalsh@redhat.com>

* Mon Jan 02 2006 Radek Vokal <rvokal@redhat.com> 1.60-58
- clear static buffers in interface.c by <drepper@redhat.com> (#176714)

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Sat Oct 15 2005 Radek Vokal <rvokal@redhat.com> 1.60-57
- add note to hostname man page about gethostbyname() (#166581)
- don't ship any rarp man page (#170537)

* Wed Aug 03 2005 Radek Vokal <rvokal@redhat.com> 1.60-56
- fixed buffer overflow in arp (#164695)

* Wed Jul 20 2005 Radek Vokal <rvokal@redhat.com> 1.60-55
- ifconfig - fixed virtual interface dropping (#162888)

* Wed Jun 22 2005 Radek Vokal <rvokal@redhat.com> 1.60-54
- fr man pages are back (#159702)

* Mon Jun 06 2005 Radek Vokal <rvokal@redhat.com> 1.60-53
- etherwake man page changed to ether-wake (#159156)

* Tue Apr 26 2005 Radek Vokal <rvokal@redhat.com> 1.60-52
- don't show "duplicate line" warning (#143933)
- netstat has new statistcs (#133032)
- /etc/neplug is owned by net-tools (#130621)

* Tue Apr 05 2005 Radek Vokal <rvokal@redhat.com> 1.60-51
- flush output in mii-tool (#152568)

* Wed Mar 30 2005 Radek Vokal <rvokal@redhat.com> 1.60-50
- added mii-diag tool
- added newer ether-wake
- remove useless -i option from ifconfig
- stop trimming interface names (#152457)

* Wed Mar 16 2005 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Mar 01 2005 Radek Vokal <rvokal@redhat.com> 1.60-48
- behaviour of netstat -i option changed (#115987)
- netstat -i shows all interface, -I<Iface> only one

* Mon Feb 28 2005 Radek Vokal <rvokal@redhat.com> 1.60-47
- added RPM_OPT_FLAGS
- execshield patch for netplug <t8m@redhat.com>

* Wed Feb 16 2005 Radek Vokal <rvokal@redhat.com> 1.60-46
- small typo in german translation (#148775)

* Wed Feb 09 2005 Radek Vokal <rvokal@redhat.com> 1.60-45
- included infiniband support (#147396) <tduffy@sun.com>
- added etherwake man page

* Mon Feb 07 2005 Radek Vokal <rvokal@redhat.com> 1.60-44
- net-plug-1.2.9 - no changes, upstream included Red Hat patches
- ether-wake-1.08 - few changes in implementation (#145718)

* Mon Jan 10 2005 Radek Vokal <rvokal@redhat.com> 1.60-43
- don't report statistics for virtual devices (#143981) <kzak@redhat.com>
- fixing translation headers - content type format
- kill bitkeeper warning messages

* Fri Dec 03 2004 Radek Vokal <rvokal@redhat.com> 1.60-42
- filter out duplicate tcp entries (#139407)

* Thu Nov 25 2004 Radek Vokal <rvokal@redhat.com> 1.60-41
- added note to hostname(1) (#140239)
- fixed --num-ports option for netstat (#115100)

* Thu Nov 11 2004 Radek Vokal <rvokal@redhat.com> 1.60-40
- mii-tool(8) fixed, labeled as obsolete, added info (#138687)
- netstat crashing on i64 fixed (#138804) Patch by <Andreas.Hirstius@cern.ch>

* Thu Nov 04 2004 Radek Vokal <rvokal@redhat.com> 1.60-39
- IBM patch for netstat -s returning negative values on 64bit arch (#144064)
- broadcast calulated if only netmask provided (#60509)

* Tue Nov 02 2004 Radek Vokal <rvokal@redhat.com> 1.60-38
- fixed fail to assign the specified netmask before adress is assigned
- patch by Malita, Florin <florin.malita@glenayre.com>

* Wed Sep 29 2004 Radek Vokal <rvokal@redhat.com> 1.60-37
- spec file updated, added conversion for french and portugal man pages to UTF-8

* Mon Sep 06 2004 Radek Vokal <rvokal@redhat.com> 1.60-36
- parse error fixed (#131539)

* Fri Sep 03 2004 Radek Vokal <rvokal@redhat.com> 1.60-35
- The return value of nameif was wrong (#129032) - patch from Fujitsu QA

* Mon Aug 30 2004 Radek Vokal <rvokal@redhat.com> 1.60-34
- Trunc patch added (#128359)

* Mon Aug 30 2004 Radek Vokal <rvokal@redhat.com> 1.60-33
- Added patch for SI units by Tom "spot" Callaway <tcallawa@redhat.com> #118006

* Tue Aug 17 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-32
- Fix installopts for netplug.

* Sun Aug 08 2004 Alan Cox <alan@redhat.com> 1.60-31
- Build requires gettext.

* Mon Aug 02 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-30
- Update to latest netplugd version.

* Mon Jul 12 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-29
- Fixed initscript patch for netplug (#127351)

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri May 14 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-27
- Fixed compiler warning/error in netplug.
- Updated to netplug-1.2.6 for security update and fixes.

* Thu May 06 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-26
- Updated netplugd to latest upstream version.
- Fixed execshield problem in main.c of netplugd.

* Thu Apr 15 2004 Phil Knirsch <pknirsch@redhat.com> 1.60-25
- Fixed several possible buffer overflows (#120343)

* Tue Mar 30 2004 Harald Hoyer <harald@redhat.com> - 1.60-24
- fixed compilation with gcc34

* Tue Mar 23 2004 Karsten Hopp <karsten@redhat.de> 1.60-23
- add chkconfig call in post and preun, fix init script (#116555)

* Thu Feb 19 2004 Phil Knirsch <pknirsch@redhat.com>
- Added netplug-1.2.1 to net-tools (FR #103419).

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1
-rebuilt

* Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20
- interface option now works as described in the man page (#61113).

* Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1
- rebuilt

* Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19
- Fixed trailing blank bug in hostname output (#101263).
- Remove -O2 fir alpha (#78955).
- Updated netstat statistic output, was still broken.

* Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1
- rebuilt

* Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18
- fix ether-wake.c build with gcc 3.3
- rebuilt

* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1
- Bumped release and rebuilt

* Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16
- Fixed ether-wake usage output (#55801).

* Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15
- fix build with gcc 3.3

* Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14
- Fixed wrong manpage (#55473).

* Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com>
- Added inet6-lookup patch from John van Krieken (#84108).
- Fixed outdated link in ifconfig manpage (#91287).

* Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com>
- Fixed incorrect address display for ipx (#46434).
- Fixed wrongly installed manpage dirs (#50664).

* Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13
- Fixed nameif problem (#85748).

* Fri Feb 07 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-12
- Fixed -s parameter.
- Fix /proc statistics for -nic operation.
- Fixed -i operation in general.

* Mon Jan 27 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-11
- Disable smp build.

* Wed Jan 22 2003 Tim Powers <timp@redhat.com> 1.60-10
- rebuilt

* Tue Dec 17 2002 Phil Knirsch <pknirsch@redhat.com> 1.60-9
- Rebuild
- Copyright -> License.

* Thu Dec 05 2002 Elliot Lee <sopwith@redhat.com> 1.60-8
- Rebuild

* Tue Aug 06 2002 Phil Knirsch <pknirsch@redhat.com>
- Added patch from Norm for a corrected output.

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Fri Apr 12 2002 Jeremy Katz <katzj@redhat.com>
- fix nstrcmp() to be correct in the case where there are many devices
of the same type, eg, "eth10" > "eth1" (#61436)

* Tue Jul 31 2001 Bill Nottingham <notting@redhat.com>
- do *not* use SIOCDEVPRIVATE for MII ioctls

* Fri Jun 1 2001 Preston Brown <pbrown@redhat.com>
- include wake-on-lan wakeup utility, ether-wake by Donald Becker

* Wed Apr 18 2001 Crutcher Dunnavant <crutcher@redhat.com>
- itterate to 1.60

* Sun Apr 8 2001 Preston Brown <pbrown@redhat.com>
- use find_lang macro
- less specific locale dirs for man pages

* Mon Apr 2 2001 Preston Brown <pbrown@redhat.com>
- don't use this version of rarp, doesn't work with our 2.4.

* Tue Feb 6 2001 Crutcher Dunnavant <crutcher@redhat.com>
- fixed man page typo, closing bug #25921

* Thu Feb 1 2001 Crutcher Dunnavant <crutcher@redhat.com>
- applied twaugh's patch to close bug #25474
- which was a buffer length bug.

* Wed Dec 27 2000 Jeff Johnson <jbj@redhat.com>
- locales not initialized correctly (#20570).
- arp: document -e option (#22040).

* Sat Oct 7 2000 Jeff Johnson <jbj@redhat.com>
- update to 1.57.
- MTU (and other) option(s) not parsed correctly (#9215).
- allow more granularity iwth --numeric (#9129).

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Tue Jun 6 2000 Jeff Johnson <jbj@redhat.com>
- update to 1.56.
- FHS packaging.

* Sat Apr 15 2000 Jeff Johnson <jbj@redhat.com>
- update to 1.55.

* Tue Mar 7 2000 Jeff Johnson <jbj@redhat.com>
- rebuild for sparc baud rates > 38400.

* Wed Feb 02 2000 Cristian Gafton <gafton@redhat.com>
- fix description

* Fri Jan 14 2000 Jeff Johnson <jbj@redhat.com>
- fix "netstat -ci" (#6904).
- document more netstat options (#7429).

* Thu Jan 13 2000 Jeff Johnson <jbj@redhat.com>
- update to 1.54.
- enable "everything but DECnet" including IPv6.

* Sun Aug 29 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.53.

* Wed Jul 28 1999 Jeff Johnson <jbj@redhat.com>
- plug "netstat -c" fd leak (#3620).

* Thu Jun 17 1999 Jeff Johnson <jbj@redhat.com>
- plug potential buffer overruns.

* Sat Jun 12 1999 John Hardin <jhardin@wolfenet.com>
- patch to recognize ESP and GRE protocols for VPN masquerade

* Fri Apr 23 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.52.

* Thu Mar 25 1999 Jeff Johnson <jbj@redhat.com>
- update interface statistics continuously (#1323)

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 2)

* Fri Mar 19 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.51.
- strip binaries.

* Tue Feb 2 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.50.
- added slattach/plipconfig/ipmaddr/iptunnel commands.
- enabled translated man pages.

* Tue Dec 15 1998 Jakub Jelinek <jj@ultra.linux.cz>
- update to 1.49.

* Sat Dec 5 1998 Jeff Johnson <jbj@redhat.com>
- update to 1.48.

* Thu Nov 12 1998 Jeff Johnson <jbj@redhat.com>
- update to 1.47.

* Wed Sep 2 1998 Jeff Johnson <jbj@redhat.com>
- update to 1.46

* Thu Jul 9 1998 Jeff Johnson <jbj@redhat.com>
- build root
- include ethers.5

* Thu Jun 11 1998 Aron Griffis <agriffis@coat.com>
- upgraded to 1.45
- patched hostname.c to initialize buffer
- patched ax25.c to use kernel headers

* Fri May 01 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Fri Feb 27 1998 Jason Spangler <jasons@usemail.com>
- added config patch

* Fri Feb 27 1998 Jason Spangler <jasons@usemail.com>
- changed to net-tools 1.432
- removed old glibc 2.1 patch
* Wed Oct 22 1997 Erik Troan <ewt@redhat.com>
- added extra patches for glibc 2.1

* Tue Oct 21 1997 Erik Troan <ewt@redhat.com>
- included complete set of network protocols (some were removed for
initial glibc work)

* Wed Sep 03 1997 Erik Troan <ewt@redhat.com>
- updated glibc patch for glibc 2.0.5

* Thu Jun 19 1997 Erik Troan <ewt@redhat.com>
- built against glibc
- updated to 1.33
Loading…
Cancel
Save