Commit 6ff46145 authored by Martina Ferrari's avatar Martina Ferrari

Remove even more patches.

parent 24d59ab0
--- a/netstat.c
+++ b/netstat.c
@@ -86,6 +86,8 @@
#include <sys/ioctl.h>
@@ -88,6 +88,7 @@
#include <sys/stat.h>
#include <net/if.h>
#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "net-support.h"
......
Patch by Antonio Galea <ant9000@netwise.it> to solve the socket number overflow
from #345331
--- a/netstat.c
+++ b/netstat.c
@@ -317,8 +317,8 @@
strncpy(inode_str, lname+PRG_SOCKET_PFXl, inode_str_len);
inode_str[inode_str_len] = '\0';
- *inode_p = strtol(inode_str,&serr,0);
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+ *inode_p = strtoul(inode_str,&serr,0);
+ if (!serr || *serr)
return(-1);
}
return(0);
@@ -338,8 +338,8 @@
{
char *serr;
- *inode_p=strtol(lname + PRG_SOCKET_PFX2l,&serr,0);
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+ *inode_p=strtoul(lname + PRG_SOCKET_PFX2l,&serr,0);
+ if (!serr || *serr)
return(-1);
}
return(0);
......@@ -4,7 +4,7 @@ Bug-Debian: http://bugs.debian.org/443075
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -658,14 +658,14 @@
@@ -643,14 +643,14 @@
spp++;
continue;
}
......@@ -12,7 +12,7 @@ Bug-Debian: http://bugs.debian.org/443075
+ if (!strcmp(*spp, "-pointopoint") || !strcmp(*spp, "-pointtopoint")) {
goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
spp++;
if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0)
fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
continue;
}
......
......@@ -4,7 +4,7 @@ Bug-Debian: http://bugs.debian.org/500913
--- a/man/en_US/route.8
+++ b/man/en_US/route.8
@@ -195,6 +195,12 @@
@@ -205,6 +205,12 @@
in the destination field of the current routing table.
.TP
......@@ -14,6 +14,6 @@ Bug-Debian: http://bugs.debian.org/500913
+same as as seen in 'route -n' listing.
+
+.TP
.B route add default gw mango\-gw
.B route add default gw mango
adds a default route (which will be used if no other route matches).
All packets using this route will be gatewayed through "mango\-gw". The
All packets using this route will be gatewayed through the address of a node
Description: Properly initialise sin6 fields. Copied from upstream CVS: http://cvs.berlios.de/cgi-bin/viewvc.cgi/net-tools/net-tools/lib/inet6.c?r1=1.12&r2=1.13
Author: Bernd Eckenfels <net-tools@lina.inka.de>
Bug-Debian: http://bugs.debian.org/508110
Index: net-tools/lib/inet6.c
===================================================================
--- net-tools.orig/lib/inet6.c
+++ net-tools/lib/inet6.c
@@ -3,7 +3,7 @@
* support functions for the net-tools.
* (most of it copied from lib/inet.c 1.26).
*
- * Version: $Id: inet6.c,v 1.12 2002/12/10 01:03:09 ecki Exp $
+ * Version: $Id: inet6.c,v 1.13 2010/07/05 22:52:00 ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* Copyright 1993 MicroWalt Corporation
@@ -157,12 +157,14 @@ static int INET6_getsock(char *bufp, str
sin6 = (struct sockaddr_in6 *) sap;
sin6->sin6_family = AF_INET6;
sin6->sin6_port = 0;
+ sin6->sin6_scope_id = 0;
+ sin6->sin6_flowinfo = 0;
if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
return (-1);
- p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
+ p = fix_v4_address(bufp, &sin6->sin6_addr);
+ if (p != bufp)
+ memcpy(bufp, p, strlen(p)+1);
return 16; /* ?;) */
}
Author: Olaf <olaf.westrik@gmx.net>
Description: mii-tool: scan all ethernet devices instead of eth[0-7].
Bug-Debian: http://bugs.debian.org/532879
--- a/Makefile
+++ b/Makefile
@@ -218,7 +218,7 @@
$(CC) $(LDFLAGS) -o ipmaddr ipmaddr.o $(NLIB) $(RESLIB)
mii-tool: mii-tool.o
- $(CC) $(LDFLAGS) -o mii-tool mii-tool.o
+ $(CC) $(LDFLAGS) -o mii-tool mii-tool.o $(NLIB)
installbin:
install -m 0755 -d ${BASEDIR}/sbin
--- a/mii-tool.c
+++ b/mii-tool.c
@@ -31,6 +31,8 @@
static char Version[] = "$Id: mii-tool.c,v 1.9 2006/09/27 20:59:18 ecki Exp $\n(Author: David Hinds based on Donald Becker's mii-diag)";
+#include "config.h"
+
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -45,6 +47,7 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <linux/sockios.h>
#ifndef __GLIBC__
@@ -54,6 +57,9 @@
#include "mii.h"
#include "version.h"
+#include "interface.h"
+#include "sockets.h"
+
#define MAX_ETH 8 /* Maximum # of interfaces */
/* Table of known MII's */
@@ -109,8 +115,6 @@
static int nway_advertise = 0;
static int fixed_speed = 0;
static int override_phy = -1;
-
-static int skfd = -1; /* AF_INET socket for ioctl() calls. */
static struct ifreq ifr;
/*--------------------------------------------------------------------*/
@@ -409,6 +413,19 @@
/*--------------------------------------------------------------------*/
+int do_mii_print(struct interface *ife, void *cookie)
+{
+ int res;
+
+ res = do_if_fetch(ife);
+ if ((res >= 0) && (ife->type == ARPHRD_ETHER)) {
+ do_one_xcvr(skfd, ife->name, 1);
+ }
+ return res;
+}
+
+/*--------------------------------------------------------------------*/
+
const char *usage =
"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
" -V, --version display version information\n"
@@ -477,11 +494,16 @@
/* No remaining args means show all interfaces. */
if (optind == argc) {
+ int opt_a = 1;
ret = 1;
- for (i = 0; i < MAX_ETH; i++) {
- sprintf(s, "eth%d", i);
- ret &= do_one_xcvr(skfd, s, 1);
+ /* Create a channel to the NET kernel. */
+ if ((skfd = sockets_open(0)) < 0) {
+ perror("socket");
+ exit(1);
}
+ ret = for_all_interfaces(do_mii_print, &opt_a);
+ (void) close(skfd);
+
if (ret)
fprintf(stderr, "no MII interfaces found\n");
} else {
--- a/netstat.c
+++ b/netstat.c
@@ -1742,6 +1742,7 @@
parsesnmp(flag_raw, flag_tcp, flag_udp);
@@ -2201,12 +2201,14 @@
parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
#else
ENOSUPP("netstat", "AF INET");
+ exit(1);
#endif
} else if(!strcmp(afname, "inet6")) {
#if HAVE_AFINET6
@@ -1749,6 +1750,7 @@
parsesnmp6(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET6");
......
Author: Mats Erik Andersson <mats.andersson@gisladisker.se>, Bjørn Mork <bjorn@mork.no>
Description: Combined patches to fix handling of 64bit integers in netstat -s.
Bug-Debian: http://bugs.debian.org/561161
Index: net-tools/statistics.c
===================================================================
--- net-tools.orig/statistics.c
+++ net-tools/statistics.c
@@ -64,115 +64,115 @@ static enum State state;
struct entry Iptab[] =
{
{"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC},
- {"DefaultTTL", N_("Default TTL is %u"), number | I_STATIC},
- {"InReceives", N_("%u total packets received"), number},
- {"InHdrErrors", N_("%u with invalid headers"), opt_number},
- {"InAddrErrors", N_("%u with invalid addresses"), opt_number},
- {"ForwDatagrams", N_("%u forwarded"), number},
- {"InUnknownProtos", N_("%u with unknown protocol"), opt_number},
- {"InDiscards", N_("%u incoming packets discarded"), number},
- {"InDelivers", N_("%u incoming packets delivered"), number},
- {"OutRequests", N_("%u requests sent out"), number}, /*? */
- {"OutDiscards", N_("%u outgoing packets dropped"), opt_number},
- {"OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
- {"ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
- {"ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
- {"ReasmOKs", N_("%u packets reassembled ok"), opt_number},
- {"ReasmFails", N_("%u packet reassembles failed"), opt_number},
- {"FragOKs", N_("%u fragments received ok"), opt_number},
- {"FragFails", N_("%u fragments failed"), opt_number},
- {"FragCreates", N_("%u fragments created"), opt_number}
+ {"DefaultTTL", N_("Default TTL is %llu"), number | I_STATIC},
+ {"InReceives", N_("%llu total packets received"), number},
+ {"InHdrErrors", N_("%llu with invalid headers"), opt_number},
+ {"InAddrErrors", N_("%llu with invalid addresses"), opt_number},
+ {"ForwDatagrams", N_("%llu forwarded"), number},
+ {"InUnknownProtos", N_("%llu with unknown protocol"), opt_number},
+ {"InDiscards", N_("%llu incoming packets discarded"), number},
+ {"InDelivers", N_("%llu incoming packets delivered"), number},
+ {"OutRequests", N_("%llu requests sent out"), number}, /*? */
+ {"OutDiscards", N_("%llu outgoing packets dropped"), opt_number},
+ {"OutNoRoutes", N_("%llu dropped because of missing route"), opt_number},
+ {"ReasmTimeout", N_("%llu fragments dropped after timeout"), opt_number},
+ {"ReasmReqds", N_("%llu reassemblies required"), opt_number}, /* ? */
+ {"ReasmOKs", N_("%llu packets reassembled ok"), opt_number},
+ {"ReasmFails", N_("%llu packet reassembles failed"), opt_number},
+ {"FragOKs", N_("%llu fragments received ok"), opt_number},
+ {"FragFails", N_("%llu fragments failed"), opt_number},
+ {"FragCreates", N_("%llu fragments created"), opt_number}
};
struct entry Ip6tab[] =
{
- {"Ip6InReceives", N_("%u total packets received"), number},
- {"Ip6InHdrErrors", N_("%u with invalid headers"), opt_number},
- {"Ip6InTooBigErrors", N_("%u with packets too big"), opt_number},
- {"Ip6InNoRoutes", N_("%u incoming packets with no route"), opt_number},
- {"Ip6InAddrErrors", N_("%u with invalid addresses"), opt_number},
- {"Ip6InUnknownProtos", N_("%u with unknown protocol"), opt_number},
- {"Ip6InTruncatedPkts", N_("%u with truncated packets"), opt_number},
- {"Ip6InDiscards", N_("%u incoming packets discarded"), number},
- {"Ip6InDelivers", N_("%u incoming packets delivered"), number},
- {"Ip6OutForwDatagrams", N_("%u forwarded"), number},
- {"Ip6OutRequests", N_("%u requests sent out"), number}, /*? */
- {"Ip6OutDiscards", N_("%u outgoing packets dropped"), opt_number},
- {"Ip6OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
- {"Ip6ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
- {"Ip6ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
- {"Ip6ReasmOKs", N_("%u packets reassembled ok"), opt_number},
- {"Ip6ReasmFails", N_("%u packet reassembles failed"), opt_number},
- {"Ip6FragOKs", N_("%u fragments received ok"), opt_number},
- {"Ip6FragFails", N_("%u fragments failed"), opt_number},
- {"Ip6FragCreates", N_("%u fragments created"), opt_number},
- {"Ip6InMcastPkts", N_("%u incoming multicast packets"), opt_number},
- {"Ip6OutMcastPkts", N_("%u outgoing multicast packets"), opt_number}
+ {"Ip6InReceives", N_("%llu total packets received"), number},
+ {"Ip6InHdrErrors", N_("%llu with invalid headers"), opt_number},
+ {"Ip6InTooBigErrors", N_("%llu with packets too big"), opt_number},
+ {"Ip6InNoRoutes", N_("%llu incoming packets with no route"), opt_number},
+ {"Ip6InAddrErrors", N_("%llu with invalid addresses"), opt_number},
+ {"Ip6InUnknownProtos", N_("%llu with unknown protocol"), opt_number},
+ {"Ip6InTruncatedPkts", N_("%llu with truncated packets"), opt_number},
+ {"Ip6InDiscards", N_("%llu incoming packets discarded"), number},
+ {"Ip6InDelivers", N_("%llu incoming packets delivered"), number},
+ {"Ip6OutForwDatagrams", N_("%llu forwarded"), number},
+ {"Ip6OutRequests", N_("%llu requests sent out"), number}, /*? */
+ {"Ip6OutDiscards", N_("%llu outgoing packets dropped"), opt_number},
+ {"Ip6OutNoRoutes", N_("%llu dropped because of missing route"), opt_number},
+ {"Ip6ReasmTimeout", N_("%llu fragments dropped after timeout"), opt_number},
+ {"Ip6ReasmReqds", N_("%llu reassemblies required"), opt_number}, /* ? */
+ {"Ip6ReasmOKs", N_("%llu packets reassembled ok"), opt_number},
+ {"Ip6ReasmFails", N_("%llu packet reassembles failed"), opt_number},
+ {"Ip6FragOKs", N_("%llu fragments received ok"), opt_number},
+ {"Ip6FragFails", N_("%llu fragments failed"), opt_number},
+ {"Ip6FragCreates", N_("%llu fragments created"), opt_number},
+ {"Ip6InMcastPkts", N_("%llu incoming multicast packets"), opt_number},
+ {"Ip6OutMcastPkts", N_("%llu outgoing multicast packets"), opt_number}
};
struct entry Icmptab[] =
{
- {"InMsgs", N_("%u ICMP messages received"), number},
- {"InErrors", N_("%u input ICMP message failed."), number},
- {"InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
- {"InTimeExcds", N_("timeout in transit: %u"), i_inp_icmp | I_TITLE},
- {"InParmProbs", N_("wrong parameters: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InSrcQuenchs", N_("source quenches: %u"), i_inp_icmp | I_TITLE},
- {"InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
- {"InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
- {"InEchoReps", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
- {"InTimestamps", N_("timestamp request: %u"), i_inp_icmp | I_TITLE},
- {"InTimestampReps", N_("timestamp reply: %u"), i_inp_icmp | I_TITLE},
- {"InAddrMasks", N_("address mask request: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"InAddrMaskReps", N_("address mask replies: %u"), i_inp_icmp | I_TITLE}, /*? */
- {"OutMsgs", N_("%u ICMP messages sent"), number},
- {"OutErrors", N_("%u ICMP messages failed"), number},
- {"OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
- {"OutTimeExcds", N_("time exceeded: %u"), i_outp_icmp | I_TITLE},
- {"OutParmProbs", N_("wrong parameters: %u"), i_outp_icmp | I_TITLE}, /*? */
- {"OutSrcQuenchs", N_("source quench: %u"), i_outp_icmp | I_TITLE},
- {"OutRedirects", N_("redirect: %u"), i_outp_icmp | I_TITLE},
- {"OutEchos", N_("echo request: %u"), i_outp_icmp | I_TITLE},
- {"OutEchoReps", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestamps", N_("timestamp requests: %u"), i_outp_icmp | I_TITLE},
- {"OutTimestampReps", N_("timestamp replies: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMasks", N_("address mask requests: %u"), i_outp_icmp | I_TITLE},
- {"OutAddrMaskReps", N_("address mask replies: %u"), i_outp_icmp | I_TITLE},
+ {"InMsgs", N_("%llu ICMP messages received"), number},
+ {"InErrors", N_("%llu input ICMP message failed."), number},
+ {"InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
+ {"InTimeExcds", N_("timeout in transit: %llu"), i_inp_icmp | I_TITLE},
+ {"InParmProbs", N_("wrong parameters: %llu"), i_inp_icmp | I_TITLE}, /*? */
+ {"InSrcQuenchs", N_("source quenches: %llu"), i_inp_icmp | I_TITLE},
+ {"InRedirects", N_("redirects: %llu"), i_inp_icmp | I_TITLE},
+ {"InEchos", N_("echo requests: %llu"), i_inp_icmp | I_TITLE},
+ {"InEchoReps", N_("echo replies: %llu"), i_inp_icmp | I_TITLE},
+ {"InTimestamps", N_("timestamp request: %llu"), i_inp_icmp | I_TITLE},
+ {"InTimestampReps", N_("timestamp reply: %llu"), i_inp_icmp | I_TITLE},
+ {"InAddrMasks", N_("address mask request: %llu"), i_inp_icmp | I_TITLE}, /*? */
+ {"InAddrMaskReps", N_("address mask replies: %llu"), i_inp_icmp | I_TITLE}, /*? */
+ {"OutMsgs", N_("%llu ICMP messages sent"), number},
+ {"OutErrors", N_("%llu ICMP messages failed"), number},
+ {"OutDestUnreachs", N_("destination unreachable: %llu"), i_outp_icmp | I_TITLE},
+ {"OutTimeExcds", N_("time exceeded: %llu"), i_outp_icmp | I_TITLE},
+ {"OutParmProbs", N_("wrong parameters: %llu"), i_outp_icmp | I_TITLE}, /*? */
+ {"OutSrcQuenchs", N_("source quench: %llu"), i_outp_icmp | I_TITLE},
+ {"OutRedirects", N_("redirect: %llu"), i_outp_icmp | I_TITLE},
+ {"OutEchos", N_("echo request: %llu"), i_outp_icmp | I_TITLE},
+ {"OutEchoReps", N_("echo replies: %llu"), i_outp_icmp | I_TITLE},
+ {"OutTimestamps", N_("timestamp requests: %llu"), i_outp_icmp | I_TITLE},
+ {"OutTimestampReps", N_("timestamp replies: %llu"), i_outp_icmp | I_TITLE},
+ {"OutAddrMasks", N_("address mask requests: %llu"), i_outp_icmp | I_TITLE},
+ {"OutAddrMaskReps", N_("address mask replies: %llu"), i_outp_icmp | I_TITLE},
};
struct entry Icmp6tab[] =
{
- {"Icmp6InMsgs", N_("%u ICMP messages received"), number},
- {"Icmp6InErrors", N_("%u input ICMP message failed."), number},
- {"Icmp6InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InPktTooBigs", N_("packets too big: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InTimeExcds", N_("received ICMPv6 time exceeded: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InParmProblems", N_("parameter problem: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InEchoReplies", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembQueries", N_("group member queries: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembResponses", N_("group member responses: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InGroupMembReductions", N_("group member reductions: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRouterSolicits", N_("router solicits: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRouterAdvertisements", N_("router advertisement: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InNeighborSolicits", N_("neighbour solicits: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InNeighborAdvertisements", N_("neighbour advertisement: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
- {"Icmp6OutMsgs", N_("%u ICMP messages sent"), number},
- {"Icmp6OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutPktTooBigs", N_("packets too big: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutTimeExcds", N_("sent ICMPv6 time exceeded: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutParmProblems", N_("parameter problem: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutEchos", N_("echo requests: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutEchoReplies", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembQueries", N_("group member queries: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembResponses", N_("group member responses: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutGroupMembReductions", N_("group member reductions: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRouterSolicits", N_("router solicits: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRouterAdvertisements ", N_("router advertisement: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutNeighborSolicits", N_("neighbor solicits: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutNeighborAdvertisements", N_("neighbor advertisements: %u"), i_outp_icmp | I_TITLE},
- {"Icmp6OutRedirects", N_("redirects: %u"), i_outp_icmp | I_TITLE},
+ {"Icmp6InMsgs", N_("%llu ICMP messages received"), number},
+ {"Icmp6InErrors", N_("%llu input ICMP message failed."), number},
+ {"Icmp6InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InPktTooBigs", N_("packets too big: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InTimeExcds", N_("received ICMPv6 time exceeded: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InParmProblems", N_("parameter problem: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InEchos", N_("echo requests: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InEchoReplies", N_("echo replies: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembQueries", N_("group member queries: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembResponses", N_("group member responses: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InGroupMembReductions", N_("group member reductions: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRouterSolicits", N_("router solicits: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRouterAdvertisements", N_("router advertisement: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InNeighborSolicits", N_("neighbour solicits: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InNeighborAdvertisements", N_("neighbour advertisement: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6InRedirects", N_("redirects: %llu"), i_inp_icmp | I_TITLE},
+ {"Icmp6OutMsgs", N_("%llu ICMP messages sent"), number},
+ {"Icmp6OutDestUnreachs", N_("destination unreachable: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutPktTooBigs", N_("packets too big: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutTimeExcds", N_("sent ICMPv6 time exceeded: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutParmProblems", N_("parameter problem: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutEchos", N_("echo requests: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutEchoReplies", N_("echo replies: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembQueries", N_("group member queries: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembResponses", N_("group member responses: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutGroupMembReductions", N_("group member reductions: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRouterSolicits", N_("router solicits: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRouterAdvertisements ", N_("router advertisement: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutNeighborSolicits", N_("neighbor solicits: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutNeighborAdvertisements", N_("neighbor advertisements: %llu"), i_outp_icmp | I_TITLE},
+ {"Icmp6OutRedirects", N_("redirects: %llu"), i_outp_icmp | I_TITLE},
};
struct entry Tcptab[] =
@@ -181,120 +181,120 @@ struct entry Tcptab[] =
{"RtoMin", "", number},
{"RtoMax", "", number},
{"MaxConn", "", number},
- {"ActiveOpens", N_("%u active connections openings"), number},
- {"PassiveOpens", N_("%u passive connection openings"), number},
- {"AttemptFails", N_("%u failed connection attempts"), number},
- {"EstabResets", N_("%u connection resets received"), number},
- {"CurrEstab", N_("%u connections established"), number},
- {"InSegs", N_("%u segments received"), number},
- {"OutSegs", N_("%u segments send out"), number},
- {"RetransSegs", N_("%u segments retransmited"), number},
- {"InErrs", N_("%u bad segments received."), number},
- {"OutRsts", N_("%u resets sent"), number},
+ {"ActiveOpens", N_("%llu active connections openings"), number},
+ {"PassiveOpens", N_("%llu passive connection openings"), number},
+ {"AttemptFails", N_("%llu failed connection attempts"), number},
+ {"EstabResets", N_("%llu connection resets received"), number},
+ {"CurrEstab", N_("%llu connections established"), number},
+ {"InSegs", N_("%llu segments received"), number},
+ {"OutSegs", N_("%llu segments send out"), number},
+ {"RetransSegs", N_("%llu segments retransmited"), number},
+ {"InErrs", N_("%llu bad segments received."), number},
+ {"OutRsts", N_("%llu resets sent"), number},
};
struct entry Udptab[] =
{
- {"InDatagrams", N_("%u packets received"), number},
- {"NoPorts", N_("%u packets to unknown port received."), number},
- {"InErrors", N_("%u packet receive errors"), number},
- {"OutDatagrams", N_("%u packets sent"), number},
+ {"InDatagrams", N_("%llu packets received"), number},
+ {"NoPorts", N_("%llu packets to unknown port received."), number},
+ {"InErrors", N_("%llu packet receive errors"), number},
+ {"OutDatagrams", N_("%llu packets sent"), number},
};
struct entry Udp6tab[] =
{
- {"Udp6InDatagrams", N_("%u packets received"), number},
- {"Udp6NoPorts", N_("%u packets to unknown port received."), number},
- {"Udp6InErrors", N_("%u packet receive errors"), number},
- {"Udp6OutDatagrams", N_("%u packets sent"), number},
+ {"Udp6InDatagrams", N_("%llu packets received"), number},
+ {"Udp6NoPorts", N_("%llu packets to unknown port received."), number},
+ {"Udp6InErrors", N_("%llu packet receive errors"), number},
+ {"Udp6OutDatagrams", N_("%llu packets sent"), number},
};
struct entry Tcpexttab[] =
{
- {"SyncookiesSent", N_("%u SYN cookies sent"), opt_number},
- {"SyncookiesRecv", N_("%u SYN cookies received"), opt_number},
- {"SyncookiesFailed", N_("%u invalid SYN cookies received"), opt_number},
+ {"SyncookiesSent", N_("%llu SYN cookies sent"), opt_number},
+ {"SyncookiesRecv", N_("%llu SYN cookies received"), opt_number},
+ {"SyncookiesFailed", N_("%llu invalid SYN cookies received"), opt_number},
- { "EmbryonicRsts", N_("%u resets received for embryonic SYN_RECV sockets"),
+ { "EmbryonicRsts", N_("%llu resets received for embryonic SYN_RECV sockets"),
opt_number },
- { "PruneCalled", N_("%u packets pruned from receive queue because of socket"
+ { "PruneCalled", N_("%llu packets pruned from receive queue because of socket"
" buffer overrun"), opt_number },
/* obsolete: 2.2.0 doesn't do that anymore */
- { "RcvPruned", N_("%u packets pruned from receive queue"), opt_number },
- { "OfoPruned", N_("%u packets dropped from out-of-order queue because of"
+ { "RcvPruned", N_("%llu packets pruned from receive queue"), opt_number },
+ { "OfoPruned", N_("%llu packets dropped from out-of-order queue because of"
" socket buffer overrun"), opt_number },
- { "OutOfWindowIcmps", N_("%u ICMP packets dropped because they were "
+ { "OutOfWindowIcmps", N_("%llu ICMP packets dropped because they were "
"out-of-window"), opt_number },
- { "LockDroppedIcmps", N_("%u ICMP packets dropped because"
+ { "LockDroppedIcmps", N_("%llu ICMP packets dropped because"
" socket was locked"), opt_number },
- { "TW", N_("%u TCP sockets finished time wait in fast timer"), opt_number },
- { "TWRecycled", N_("%u time wait sockets recycled by time stamp"), opt_number },
- { "TWKilled", N_("%u TCP sockets finished time wait in slow timer"), opt_number },
- { "PAWSPassive", N_("%u passive connections rejected because of"
+ { "TW", N_("%llu TCP sockets finished time wait in fast timer"), opt_number },
+ { "TWRecycled", N_("%llu time wait sockets recycled by time stamp"), opt_number },
+ { "TWKilled", N_("%llu TCP sockets finished time wait in slow timer"), opt_number },
+ { "PAWSPassive", N_("%llu passive connections rejected because of"
" time stamp"), opt_number },
- { "PAWSActive", N_("%u active connections rejected because of "
+ { "PAWSActive", N_("%llu active connections rejected because of "
"time stamp"), opt_number },
- { "PAWSEstab", N_("%u packets rejects in established connections because of"
+ { "PAWSEstab", N_("%llu packets rejects in established connections because of"
" timestamp"), opt_number },
- { "DelayedACKs", N_("%u delayed acks sent"), opt_number },
- { "DelayedACKLocked", N_("%u delayed acks further delayed because of"
+ { "DelayedACKs", N_("%llu delayed acks sent"), opt_number },
+ { "DelayedACKLocked", N_("%llu delayed acks further delayed because of"
" locked socket"), opt_number },
- { "DelayedACKLost", N_("Quick ack mode was activated %u times"), opt_number },
- { "ListenOverflows", N_("%u times the listen queue of a socket overflowed"),
+ { "DelayedACKLost", N_("Quick ack mode was activated %llu times"), opt_number },
+ { "ListenOverflows", N_("%llu times the listen queue of a socket overflowed"),
opt_number },
- { "ListenDrops", N_("%u SYNs to LISTEN sockets dropped"), opt_number },
- { "TCPPrequeued", N_("%u packets directly queued to recvmsg prequeue."),
+ { "ListenDrops", N_("%llu SYNs to LISTEN sockets dropped"), opt_number },
+ { "TCPPrequeued", N_("%llu packets directly queued to recvmsg prequeue."),
opt_number },
- { "TCPDirectCopyFromBacklog", N_("%u bytes directly in process context from backlog"), opt_number },
- { "TCPDirectCopyFromPrequeue", N_("%u bytes directly received in process context from prequeue"),
+ { "TCPDirectCopyFromBacklog", N_("%llu bytes directly in process context from backlog"), opt_number },
+ { "TCPDirectCopyFromPrequeue", N_("%llu bytes directly received in process context from prequeue"),
opt_number },
- { "TCPPrequeueDropped", N_("%u packets dropped from prequeue"), opt_number },
- { "TCPHPHits", N_("%u packet headers predicted"), number },
- { "TCPHPHitsToUser", N_("%u packets header predicted and "
+ { "TCPPrequeueDropped", N_("%llu packets dropped from prequeue"), opt_number },
+ { "TCPHPHits", N_("%llu packet headers predicted"), number },
+ { "TCPHPHitsToUser", N_("%llu packets header predicted and "
"directly queued to user"), opt_number },
- { "SockMallocOOM", N_("Ran %u times out of system memory during "
- "packet sending"), opt_number },
- { "TCPPureAcks", N_("%u acknowledgments not containing data payload received"), opt_number },
- { "TCPHPAcks", N_("%u predicted acknowledgments"), opt_number },
- { "TCPRenoRecovery", N_("%u times recovered from packet loss due to fast retransmit"), opt_number },
- { "TCPSackRecovery", N_("%u times recovered from packet loss by selective acknowledgements"), opt_number },
- { "TCPSACKReneging", N_("%u bad SACK blocks received"), opt_number },
- { "TCPFACKReorder", N_("Detected reordering %u times using FACK"), opt_number },
- { "TCPSACKReorder", N_("Detected reordering %u times using SACK"), opt_number },
- { "TCPTSReorder", N_("Detected reordering %u times using time stamp"), opt_number },
- { "TCPRenoReorder", N_("Detected reordering %u times using reno fast retransmit"), opt_number },
- { "TCPFullUndo", N_("%u congestion windows fully recovered without slow start"), opt_number },
- { "TCPPartialUndo", N_("%u congestion windows partially recovered using Hoe heuristic"), opt_number },
- { "TCPDSackUndo", N_("%u congestion window recovered without slow start using DSACK"), opt_number },
- { "TCPLossUndo", N_("%u congestion windows recovered without slow start after partial ack"), opt_number },
- { "TCPLostRetransmits", N_("%u retransmits lost"), opt_number },
- { "TCPRenoFailures", N_("%u timeouts after reno fast retransmit"), opt_number },
- { "TCPSackFailures", N_("%u timeouts after SACK recovery"), opt_number },
- { "TCPLossFailures", N_("%u timeouts in loss state"), opt_number },
- { "TCPFastRetrans", N_("%u fast retransmits"), opt_number },
- { "TCPForwardRetrans", N_("%u forward retransmits"), opt_number },
- { "TCPSlowStartRetrans", N_("%u retransmits in slow start"), opt_number },
- { "TCPTimeouts", N_("%u other TCP timeouts"), opt_number },
- { "TCPRenoRecoveryFailed", N_("%u reno fast retransmits failed"), opt_number },
- { "TCPSackRecoveryFail", N_("%u SACK retransmits failed"), opt_number },
- { "TCPSchedulerFailed", N_("%u times receiver scheduled too late for direct processing"), opt_number },
- { "TCPRcvCollapsed", N_("%u packets collapsed in receive queue due to low socket buffer"), opt_number },
- { "TCPDSACKOldSent", N_("%u DSACKs sent for old packets"), opt_number },
- { "TCPDSACKOfoSent", N_("%u DSACKs sent for out of order packets"), opt_number },
- { "TCPDSACKRecv", N_("%u DSACKs received"), opt_number },
- { "TCPDSACKOfoRecv", N_("%u DSACKs for out of order packets received"), opt_number },
- { "TCPAbortOnSyn", N_("%u connections reset due to unexpected SYN"), opt_number },
- { "TCPAbortOnData", N_("%u connections reset due to unexpected data"), opt_number },
- { "TCPAbortOnClose", N_("%u connections reset due to early user close"), opt_number },
- { "TCPAbortOnMemory", N_("%u connections aborted due to memory pressure"), opt_number },
- { "TCPAbortOnTimeout", N_("%u connections aborted due to timeout"), opt_number },
- { "TCPAbortOnLinger", N_("%u connections aborted after user close in linger timeout"), opt_number },
- { "TCPAbortFailed", N_("%u times unabled to send RST due to no memory"), opt_number },
- { "TCPMemoryPressures", N_("TCP ran low on memory %u times"), opt_number },
- { "TCPLoss", N_("%u TCP data loss events"), opt_number },
- { "TCPDSACKUndo", N_("%u congestion windows recovered without slow start by DSACK"),
+ { "SockMallocOOM", N_("Ran %llu times out of system memory during "
+ "packet sending"), opt_number },
+ { "TCPPureAcks", N_("%llu acknowledgments not containing data payload received"), opt_number },
+ { "TCPHPAcks", N_("%llu predicted acknowledgments"), opt_number },
+ { "TCPRenoRecovery", N_("%llu times recovered from packet loss due to fast retransmit"), opt_number },
+ { "TCPSackRecovery", N_("%llu times recovered from packet loss by selective acknowledgements"), opt_number },
+ { "TCPSACKReneging", N_("%llu bad SACK blocks received"), opt_number },
+ { "TCPFACKReorder", N_("Detected reordering %llu times using FACK"), opt_number },
+ { "TCPSACKReorder", N_("Detected reordering %llu times using SACK"), opt_number },
+ { "TCPTSReorder", N_("Detected reordering %llu times using time stamp"), opt_number },
+ { "TCPRenoReorder", N_("Detected reordering %llu times using reno fast retransmit"), opt_number },
+ { "TCPFullUndo", N_("%llu congestion windows fully recovered without slow start"), opt_number },
+ { "TCPPartialUndo", N_("%llu congestion windows partially recovered using Hoe heuristic"), opt_number },
+ { "TCPDSackUndo", N_("%llu congestion window recovered without slow start using DSACK"), opt_number },
+ { "TCPLossUndo", N_("%llu congestion windows recovered without slow start after partial ack"), opt_number },
+ { "TCPLostRetransmits", N_("%llu retransmits lost"), opt_number },
+ { "TCPRenoFailures", N_("%llu timeouts after reno fast retransmit"), opt_number },
+ { "TCPSackFailures", N_("%llu timeouts after SACK recovery"), opt_number },
+ { "TCPLossFailures", N_("%llu timeouts in loss state"), opt_number },
+ { "TCPFastRetrans", N_("%llu fast retransmits"), opt_number },
+ { "TCPForwardRetrans", N_("%llu forward retransmits"), opt_number },
+ { "TCPSlowStartRetrans", N_("%llu retransmits in slow start"), opt_number },
+ { "TCPTimeouts", N_("%llu other TCP timeouts"), opt_number },
+ { "TCPRenoRecoveryFailed", N_("%llu reno fast retransmits failed"), opt_number },
+ { "TCPSackRecoveryFail", N_("%llu SACK retransmits failed"), opt_number },
+ { "TCPSchedulerFailed", N_("%llu times receiver scheduled too late for direct processing"), opt_number },
+ { "TCPRcvCollapsed", N_("%llu packets collapsed in receive queue due to low socket buffer"), opt_number },
+ { "TCPDSACKOldSent", N_("%llu DSACKs sent for old packets"), opt_number },
+ { "TCPDSACKOfoSent", N_("%llu DSACKs sent for out of order packets"), opt_number },
+ { "TCPDSACKRecv", N_("%llu DSACKs received"), opt_number },
+ { "TCPDSACKOfoRecv", N_("%llu DSACKs for out of order packets received"), opt_number },
+ { "TCPAbortOnSyn", N_("%llu connections reset due to unexpected SYN"), opt_number },
+ { "TCPAbortOnData", N_("%llu connections reset due to unexpected data"), opt_number },
+ { "TCPAbortOnClose", N_("%llu connections reset due to early user close"), opt_number },
+ { "TCPAbortOnMemory", N_("%llu connections aborted due to memory pressure"), opt_number },
+ { "TCPAbortOnTimeout", N_("%llu connections aborted due to timeout"), opt_number },
+ { "TCPAbortOnLinger", N_("%llu connections aborted after user close in linger timeout"), opt_number },
+ { "TCPAbortFailed", N_("%llu times unabled to send RST due to no memory"), opt_number },
+ { "TCPMemoryPressures", N_("TCP ran low on memory %llu times"), opt_number },
+ { "TCPLoss", N_("%llu TCP data loss events"), opt_number },
+ { "TCPDSACKUndo", N_("%llu congestion windows recovered without slow start by DSACK"),
opt_number },
- { "TCPRenoRecoveryFail", N_("%u classic Reno fast retransmits failed"), opt_number },
+ { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
};
struct tabtab {
@@ -330,7 +330,7 @@ int cmpentries(const void *a, const void
return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title);
}
-void printval(struct tabtab *tab, char *title, int val)
+void printval(struct tabtab *tab, char *title, unsigned long long int val)
{
struct entry *ent = NULL, key;
int type;
@@ -342,7 +342,7 @@ void printval(struct tabtab *tab, char *
sizeof(struct entry), cmpentries);
if (!ent) { /* try our best */
if (val)
- printf("%*s%s: %d\n", states[state].indent, "", title, val);
+ printf("%*s%s: %llu\n", states[state].indent, "", title, val);
return;
}
type = ent->type;
@@ -452,7 +452,7 @@ int process_fd(FILE *f, int all, char *f
*p = '\0';
if (*sp != '\0' && *(tab->flag))
- printval(tab, sp, strtoul(np, &np, 10));
+ printval(tab, sp, strtoull(np, &np, 10));
sp = p + 1;
}
@@ -479,12 +479,12 @@ void cpytitle(char *original, char *new)
void process6_fd(FILE *f)
{
char buf1[1024],buf2[50],buf3[1024];
- unsigned long val;
+ unsigned long long val;
struct tabtab *tab = NULL;
int cpflg = 0;
while (fgets(buf1, sizeof buf1, f)) {
- sscanf(buf1, "%s %lu", buf2, &val);
+ sscanf(buf1, "%s %llu", buf2, &val);
if(!cpflg) {
cpytitle(buf2, buf3);
tab = newtable(snmp6tabs, buf3);
Description: do not crash if an inappropriately long argument is used for -D.
Author: Kees Cook <kees@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/net-tools/+bug/515010
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569509
--- a/arp.c
+++ b/arp.c
@@ -243,7 +243,8 @@
struct ifreq ifr;
struct hwtype *xhw;
- strcpy(ifr.ifr_name, ifname);
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ ifr.ifr_name[IFNAMSIZ-1]='\0';
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
fprintf(stderr, _("arp: cant get HW-Address for `%s': %s.\n"), ifname, strerror(errno));
return (-1);
Description: Prevent buffer overflows from the cmdline by using strncpy.
Author: Martín Ferrari <tincho@debian.org>
Bug-Debian: http://bugs.debian.org/747006
--- a/lib/inet6_sr.c
+++ b/lib/inet6_sr.c
@@ -63,7 +63,8 @@
if (*args == NULL)