Debian Bug report logs -
#254243
netstat: chops IPv6 addresses
Reported by: martin f krafft <madduck@debian.org>
Date: Sun, 13 Jun 2004 20:33:02 UTC
Severity: important
Tags: ipv6, patch, upstream
Found in version 1.60-10
Fixed in version net-tools/1.60-22
Done: Luk Claes <luk@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
martin f krafft <madduck@debian.org>:
New Bug report received and forwarded. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Package: net-tools
Version: 1.60-10
Severity: minor
I could not find a reference to this in the docs, but it's rather
annoying that netstat can't be made to display full IPv6 addresses.
SSH uses tcp6 by default, so IPv4 addresses are shown with the IPv6
counterparts, but the last octet is chopped off:
tcp6 0 1216 ::ffff:130.60.xx.xx:22 ::ffff:217.233.53:36428 ESTABLISHED
^^^^^^^^^^
It would be nice to see the full address!
Thanks for consideration!
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (600, 'testing'), (98, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.6-1-k7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8
Versions of packages net-tools depends on:
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an
-- no debconf information
--
Please do not CC me when replying to lists; I read them!
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, admin, and user
`. `'`
`- Debian - when you have better things to do than fixing a system
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!
[signature.asc (application/pgp-signature, inline)]
Tags added: patch
Request was from
martin f krafft <madduck@debian.org>
to
control@bugs.debian.org.
Full text and
rfc822 format available.
Acknowledgement sent to
martin f krafft <madduck@debian.org>:
Extra info received and filed, but not forwarded.
Full text and
rfc822 format available.
Message #12 received at 254243-quiet@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
tags 254243 + patch
thanks
----- Forwarded message from Omry Yadan <omry_y@inter.net.il> -----
790,791c790,797
< if ((strlen(rem_addr) + strlen(buffer)) > 22)
< rem_addr[22 - strlen(buffer)] = '\0';
---
> // THIS IS VERY WRONG FOR IPV6 ADDRESSES AS IT TRIMS THE END OF
> // THE ADDRESS.
> // COMMENTED OUT TO FIX IT.
> // A MORE SERIOUS FIX IS IN ORDER.
> // Omry Yadan (omry_y@inter.net.il)
> //
> //if ((strlen(rem_addr) + strlen(buffer)) > 22)
> // rem_addr[22 - strlen(buffer)] = '\0';
----- End forwarded message -----
[signature.asc (application/pgp-signature, inline)]
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #17 received at 254243@bugs.debian.org (full text, mbox, reply):
I am about to apply the attached patch to Ubuntu's version of
net-tools. Here is the debian/changelog entry:
net-tools (1.60-15ubuntu1) breezy; urgency=low
* Do not truncate numeric IPv6 addresses in netstat TCP and UDP.
The new output format is not parseable with the same algorithms as
before because it will be flexible about field widths, but it will not
be used unless it is necessary to avoid truncating numeric addresses,
so no existing non-broken netstat-output parsing code will be broken.
(Also: made 4 copies(!) of endpoint formatting code into one
common function. Urgh.) Ubuntu 7294, Debian #254243.
-- Ian Jackson <iwj@ubuntu.com> Tue, 20 Sep 2005 15:28:53 +0100
I think that applying this patch to Debian's net-tools should fix
#254243, and it would probably be useful upstream too.
Looking at the code it looks like some serious overhaul is required.
Unfortunately I don't think that I have time to do this now,
especially at this point in Ubuntu's release cycle.
Thanks,
Ian.
diff -u net-tools-1.60/netstat.c net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c
+++ net-tools-1.60/netstat.c
@@ -85,6 +85,7 @@
#include <sys/ioctl.h>
#include <net/if.h>
#include <dirent.h>
+#include <assert.h>
#include "net-support.h"
#include "pathnames.h"
@@ -704,11 +705,71 @@
igmp_do_one);
}
+static void tcpudp_one_end(char *result_buf, size_t result_buf_size,
+ struct aftype *ap, int end_port,
+ struct sockaddr *endaddr)
+{
+ char buffer[8192];
+
+ snprintf(buffer, sizeof(buffer), "%s",
+ get_sname(htons(end_port), "udp",
+ flag_not & FLAG_NUM_PORT));
+
+ assert(result_buf_size > 23);
+
+ safe_strncpy(result_buf, ap->sprint(endaddr, flag_not), result_buf_size);
+ if ((strlen(result_buf) + strlen(buffer)) > 22 &&
+ !(flag_not & FLAG_NUM_HOST))
+ result_buf[22 - strlen(buffer)] = '\0';
+
+ assert(strlen(result_buf) + strlen(buffer) + 1 < sizeof(buffer));
+ strcat(result_buf, ":");
+ strcat(result_buf, buffer);
+}
+
+static void reduce_deficit(int *deficit, int *spc, int min_spc)
+{
+ int reduction;
+ reduction= netmin(*deficit, *spc - min_spc);
+ if (reduction <= 0) return;
+ *spc -= reduction;
+ *deficit -= reduction;
+}
+
+static void tcpudp_write(const char *protname,
+ unsigned long rxq, unsigned long txq,
+ const char *local_addr, const char *rem_addr,
+ const char *state) {
+ int rxq_spc, txq_spc, local_addr_spc, rem_addr_spc, protname_spc;
+ int local_addr_len, rem_addr_len, deficit;
+
+ protname_spc = 5;
+ rxq_spc = 6;
+ txq_spc = 6;
+ local_addr_spc = 23;
+ local_addr_len = strlen(local_addr);
+ rem_addr_spc = 23;
+ rem_addr_len = strlen(rem_addr);
+ deficit = netmax(local_addr_len - local_addr_spc, 0) +
+ netmax(rem_addr_len - rem_addr_spc, 0);
+
+ reduce_deficit(&deficit, &rem_addr_spc, rem_addr_len);
+ reduce_deficit(&deficit, &local_addr_spc, local_addr_len);
+ reduce_deficit(&deficit, &txq_spc, 1);
+ reduce_deficit(&deficit, &rxq_spc, 1);
+ reduce_deficit(&deficit, &protname_spc, strlen(protname));
+
+ printf("%-*s %*ld %*ld %-*s %-*s %-11s",
+ protname_spc, protname, rxq_spc, rxq, txq_spc, txq,
+ local_addr_spc, local_addr,
+ rem_addr_spc, rem_addr, state);
+}
+
static void tcp_do_one(int lnr, const char *line)
{
unsigned long rxq, txq, time_len, retr, inode;
int num, local_port, rem_port, d, state, uid, timer_run, timeout;
- char rem_addr[128], local_addr[128], timers[64], buffer[1024], more[512];
+ char rem_addr[128], local_addr[128], timers[64], more[512];
char *protname;
struct aftype *ap;
#if HAVE_AFINET6
@@ -775,25 +836,13 @@
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
sizeof(rem_addr));
if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(local_port), "tcp",
- flag_not & FLAG_NUM_PORT));
-
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
-
- strcat(local_addr, ":");
- strcat(local_addr, buffer);
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
+ tcpudp_one_end(local_addr, sizeof(local_addr),
+ ap, local_port, (struct sockaddr *) &localaddr);
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
+ tcpudp_one_end(rem_addr, sizeof(rem_addr),
+ ap, rem_port, (struct sockaddr *) &remaddr);
- strcat(rem_addr, ":");
- strcat(rem_addr, buffer);
timers[0] = '\0';
-
if (flag_opt)
switch (timer_run) {
case 0:
@@ -820,8 +869,11 @@
timer_run, (double) time_len / HZ, retr, timeout);
break;
}
- printf("%-4s %6ld %6ld %-*s %-*s %-11s",
- protname, rxq, txq, netmax(23,strlen(local_addr)), local_addr, netmax(23,strlen(rem_addr)), rem_addr, _(tcp_state[state]));
+
+ tcpudp_write(protname,
+ rxq, txq,
+ local_addr, rem_addr,
+ _(tcp_state[state]));
finish_this_one(uid,inode,timers);
}
@@ -835,7 +887,7 @@
static void udp_do_one(int lnr, const char *line)
{
- char buffer[8192], local_addr[64], rem_addr[64];
+ char local_addr[64], rem_addr[64];
char *udp_state, timers[64], more[512];
int num, local_port, rem_port, d, state, timer_run, uid, timeout;
char *protname;
@@ -927,24 +979,11 @@
if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
{
- safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
- flag_not), sizeof(local_addr));
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(local_port), "udp",
- flag_not & FLAG_NUM_PORT));
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
- strcat(local_addr, ":");
- strcat(local_addr, buffer);
-
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
- flag_not), sizeof(rem_addr));
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
- strcat(rem_addr, ":");
- strcat(rem_addr, buffer);
+ tcpudp_one_end(local_addr, sizeof(local_addr),
+ ap, local_port, (struct sockaddr *) &localaddr);
+
+ tcpudp_one_end(rem_addr, sizeof(rem_addr),
+ ap, rem_port, (struct sockaddr *) &remaddr);
timers[0] = '\0';
if (flag_opt)
@@ -963,8 +1002,11 @@
retr, timeout);
break;
}
- printf("%-4s %6ld %6ld %-23s %-23s %-11s",
- protname, rxq, txq, local_addr, rem_addr, udp_state);
+
+ tcpudp_write(protname,
+ rxq, txq,
+ local_addr, rem_addr,
+ udp_state);
finish_this_one(uid,inode,timers);
}
diff -u net-tools-1.60/debian/changelog net-tools-1.60/debian/changelog
--- net-tools-1.60/debian/changelog
+++ net-tools-1.60/debian/changelog
@@ -1,3 +1,15 @@
+net-tools (1.60-15ubuntu1) breezy; urgency=low
+
+ * Do not truncate numeric IPv6 addresses in netstat TCP and UDP.
+ The new output format is not parseable with the same algorithms as
+ before because it will be flexible about field widths, but it will not
+ be used unless it is necessary to avoid truncating numeric addresses,
+ so no existing non-broken netstat-output parsing code will be broken.
+ (Also: made 4 copies(!) of endpoint formatting code into one
+ common function. Urgh.) Ubuntu 7294, Debian #254243.
+
+ -- Ian Jackson <iwj@ubuntu.com> Tue, 20 Sep 2005 15:28:53 +0100
+
net-tools (1.60-15) unstable; urgency=low
* minor formating fix to ifconfig(8)
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Bernd Eckenfels <be-mail2005@lina.inka.de>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #22 received at 254243@bugs.debian.org (full text, mbox, reply):
Hello Ian,
On Tue, Sep 20, 2005 at 04:05:45PM +0100, Ian Jackson wrote:
> Looking at the code it looks like some serious overhaul is required.
> Unfortunately I don't think that I have time to do this now,
> especially at this point in Ubuntu's release cycle.
yes I agree, and you might want to join upstream berlios project anyway:
https://developer.berlios.de/projects/net-tools/
So you can subscribe to the CVS commit info and even get access to commit.
Currently the net-tools 1.65 tag about to be massaged on the cvs repository
to be the debian source (it is not yet the case). some patches are missing
on the main branch and some patches are in the head but not yet tagged, some
changes on the head are not (yet) part of debian because too invassive. I do
take care of that, however you can work on the head.
Gruss
Bernd
--
(OO) -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
( .. ) ecki@{inka.de,linux.de,debian.org} http://www.eckes.org/
o--o 1024D/E383CD7E eckes@IRCNet v:+497211603874 f:+49721151516129
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #27 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi Ian,
Did you see my related patch at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=222324
It should also solve the truncation issue but I think it's more general.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #32 received at 254243@bugs.debian.org (full text, mbox, reply):
> +static void tcpudp_one_end(char *result_buf, size_t result_buf_size,
> + struct aftype *ap, int end_port,
> + struct sockaddr *endaddr)
> +{
> + char buffer[8192];
> +
> + snprintf(buffer, sizeof(buffer), "%s",
> + get_sname(htons(end_port), "udp",
Are you using "udp" for tcp too?
> + flag_not & FLAG_NUM_PORT));
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #37 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> > +static void tcpudp_one_end(char *result_buf, size_t result_buf_size,
> > + struct aftype *ap, int end_port,
> > + struct sockaddr *endaddr)
> > +{
> > + char buffer[8192];
> > +
> > + snprintf(buffer, sizeof(buffer), "%s",
> > + get_sname(htons(end_port), "udp",
>
> Are you using "udp" for tcp too?
Oops.
Ian.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #42 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> Did you see my related patch at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=222324
>
> It should also solve the truncation issue but I think it's more general.
The thing you sent to the Debian BTS is an ed-format diff ! Looking
at it it seems to just add a new command-line flag for not truncating
the address. That's wrong, IMO.
I think my patch (with the obvious fix to the tcp/udp string) is far
better. It never truncates an IPv6 address when -n is requested,
which I think is necessary to preserve the behaviour that people
(including scripts) rely on.
Ian.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #47 received at 254243@bugs.debian.org (full text, mbox, reply):
On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> > Did you see my related patch at
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=222324
> >
> > It should also solve the truncation issue but I think it's more general.
>
> The thing you sent to the Debian BTS is an ed-format diff ! Looking
There are two patches. The second version is in another format.
> at it it seems to just add a new command-line flag for not truncating
> the address. That's wrong, IMO.
--wide is enabled by default on interactive terminals
Bernd prefered that way to avoid breaking any scripts.
> I think my patch (with the obvious fix to the tcp/udp string) is far
> better. It never truncates an IPv6 address when -n is requested,
> which I think is necessary to preserve the behaviour that people
> (including scripts) rely on.
I haven't looked at it in detail but I guess it just uses wider fields
in one row if necessary?
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #52 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> There are two patches. The second version is in another format.
Ah, yes.
> > at it it seems to just add a new command-line flag for not truncating
> > the address. That's wrong, IMO.
>
> --wide is enabled by default on interactive terminals
> Bernd prefered that way to avoid breaking any scripts.
?
My patch very carefully (a) breaks no scripts that aren't already
broken and nevertheless (b) has a good stab at producing good output.
I don't think inventing a command-line option to switch between one
kind and another kind of unhelpful output is the right answer.
> I haven't looked at it in detail but I guess it just uses wider fields
> in one row if necessary?
Yes, but only if -n is used. Otherwise people are presumably already
used to truncation.
Ian.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #57 received at 254243@bugs.debian.org (full text, mbox, reply):
On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> > > at it it seems to just add a new command-line flag for not truncating
> > > the address. That's wrong, IMO.
> >
> > --wide is enabled by default on interactive terminals
> > Bernd prefered that way to avoid breaking any scripts.
>
> ?
>
> My patch very carefully (a) breaks no scripts that aren't already
> broken and nevertheless (b) has a good stab at producing good output.
Doesn't my patch do both too?
> I don't think inventing a command-line option to switch between one
> kind and another kind of unhelpful output is the right answer.
How is the output of my patch unhelpful?
And the option is only necessary to enable it on non-interactive 'stdout'.
> > I haven't looked at it in detail but I guess it just uses wider fields
> > in one row if necessary?
>
> Yes, but only if -n is used. Otherwise people are presumably already
> used to truncation.
I'm not sure about that.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #62 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> > Yes, but only if -n is used. Otherwise people are presumably already
> > used to truncation.
>
> I'm not sure about that.
Without -n, addresses are turned into domain names, which are often
truncated by the narrow field width.
Ian.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #67 received at 254243@bugs.debian.org (full text, mbox, reply):
On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> > On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> > > Yes, but only if -n is used. Otherwise people are presumably already
> > > used to truncation.
> >
> > I'm not sure about that.
>
> Without -n, addresses are turned into domain names, which are often
> truncated by the narrow field width.
But I think that's not desired by users.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #72 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> > Without -n, addresses are turned into domain names, which are often
> > truncated by the narrow field width.
>
> But I think that's not desired by users.
I agree that it might be useful to have an option which prevents any
field truncation, but that ought not to be the default and we need the
logic in my patch anyway.
Also, -$ as a short option name is rather odd.
Ian.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #77 received at 254243@bugs.debian.org (full text, mbox, reply):
On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> Olaf van der Spek writes ("Re: netstat IPv6 address truncation patch"):
> > On 9/29/05, Ian Jackson <ian@davenant.greenend.org.uk> wrote:
> > > Without -n, addresses are turned into domain names, which are often
> > > truncated by the narrow field width.
> >
> > But I think that's not desired by users.
>
> I agree that it might be useful to have an option which prevents any
> field truncation, but that ought not to be the default and we need the
Why should it not be the default on interactive stdout?
> logic in my patch anyway.
>
> Also, -$ as a short option name is rather odd.
Only the long version is supposed to be used.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Ian Jackson <ian@davenant.greenend.org.uk>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #82 received at 254243@bugs.debian.org (full text, mbox, reply):
Here is an updated version of my patch which fixes the "tcp" vs. "udp"
string in the protocol lookup bit of the unified tcpudp_one_end.
Ian.
diff -Nru /tmp/BEfybKtWqd/net-tools-1.60/debian/changelog /tmp/BQGUuO9HrM/net-tools-1.60/debian/changelog
--- /tmp/BEfybKtWqd/net-tools-1.60/debian/changelog 2005-09-30 14:14:34.000000000 +0100
+++ /tmp/BQGUuO9HrM/net-tools-1.60/debian/changelog 2005-09-29 18:02:28.000000000 +0100
@@ -1,3 +1,23 @@
+net-tools (1.60-15ubuntu2) breezy; urgency=low
+
+ * Look up TCP/UDP protocol numbers using correct protocol, not
+ always UDP. (Bug introduced in 1.60-15ubuntu1.)
+ Ubuntu 7294, Debian #254243.
+
+ -- Ian Jackson <iwj@ubuntu.com> Thu, 29 Sep 2005 18:02:23 +0100
+
+net-tools (1.60-15ubuntu1) breezy; urgency=low
+
+ * Do not truncate numeric IPv6 addresses in netstat TCP and UDP.
+ The new output format is not parseable with the same algorithms as
+ before because it will be flexible about field widths, but it will not
+ be used unless it is necessary to avoid truncating numeric addresses,
+ so no existing non-broken netstat-output parsing code will be broken.
+ (Also: made 4 copies(!) of endpoint formatting code into one
+ common function. Urgh.) Ubuntu 7294, Debian #254243.
+
+ -- Ian Jackson <iwj@ubuntu.com> Tue, 20 Sep 2005 15:28:53 +0100
+
net-tools (1.60-15) unstable; urgency=low
* minor formating fix to ifconfig(8)
diff -Nru /tmp/BEfybKtWqd/net-tools-1.60/netstat.c /tmp/BQGUuO9HrM/net-tools-1.60/netstat.c
--- /tmp/BEfybKtWqd/net-tools-1.60/netstat.c 2005-09-30 14:14:34.000000000 +0100
+++ /tmp/BQGUuO9HrM/net-tools-1.60/netstat.c 2005-09-29 17:59:55.000000000 +0100
@@ -85,6 +85,7 @@
#include <sys/ioctl.h>
#include <net/if.h>
#include <dirent.h>
+#include <assert.h>
#include "net-support.h"
#include "pathnames.h"
@@ -704,11 +705,71 @@
igmp_do_one);
}
+static void tcpudp_one_end(char *result_buf, size_t result_buf_size,
+ struct aftype *ap, int end_port,
+ struct sockaddr *endaddr, const char *protostr)
+{
+ char buffer[8192];
+
+ snprintf(buffer, sizeof(buffer), "%s",
+ get_sname(htons(end_port), protostr,
+ flag_not & FLAG_NUM_PORT));
+
+ assert(result_buf_size > 23);
+
+ safe_strncpy(result_buf, ap->sprint(endaddr, flag_not), result_buf_size);
+ if ((strlen(result_buf) + strlen(buffer)) > 22 &&
+ !(flag_not & FLAG_NUM_HOST))
+ result_buf[22 - strlen(buffer)] = '\0';
+
+ assert(strlen(result_buf) + strlen(buffer) + 1 < sizeof(buffer));
+ strcat(result_buf, ":");
+ strcat(result_buf, buffer);
+}
+
+static void reduce_deficit(int *deficit, int *spc, int min_spc)
+{
+ int reduction;
+ reduction= netmin(*deficit, *spc - min_spc);
+ if (reduction <= 0) return;
+ *spc -= reduction;
+ *deficit -= reduction;
+}
+
+static void tcpudp_write(const char *protname,
+ unsigned long rxq, unsigned long txq,
+ const char *local_addr, const char *rem_addr,
+ const char *state) {
+ int rxq_spc, txq_spc, local_addr_spc, rem_addr_spc, protname_spc;
+ int local_addr_len, rem_addr_len, deficit;
+
+ protname_spc = 5;
+ rxq_spc = 6;
+ txq_spc = 6;
+ local_addr_spc = 23;
+ local_addr_len = strlen(local_addr);
+ rem_addr_spc = 23;
+ rem_addr_len = strlen(rem_addr);
+ deficit = netmax(local_addr_len - local_addr_spc, 0) +
+ netmax(rem_addr_len - rem_addr_spc, 0);
+
+ reduce_deficit(&deficit, &rem_addr_spc, rem_addr_len);
+ reduce_deficit(&deficit, &local_addr_spc, local_addr_len);
+ reduce_deficit(&deficit, &txq_spc, 1);
+ reduce_deficit(&deficit, &rxq_spc, 1);
+ reduce_deficit(&deficit, &protname_spc, strlen(protname));
+
+ printf("%-*s %*ld %*ld %-*s %-*s %-11s",
+ protname_spc, protname, rxq_spc, rxq, txq_spc, txq,
+ local_addr_spc, local_addr,
+ rem_addr_spc, rem_addr, state);
+}
+
static void tcp_do_one(int lnr, const char *line)
{
unsigned long rxq, txq, time_len, retr, inode;
int num, local_port, rem_port, d, state, uid, timer_run, timeout;
- char rem_addr[128], local_addr[128], timers[64], buffer[1024], more[512];
+ char rem_addr[128], local_addr[128], timers[64], more[512];
char *protname;
struct aftype *ap;
#if HAVE_AFINET6
@@ -775,25 +836,15 @@
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
sizeof(rem_addr));
if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(local_port), "tcp",
- flag_not & FLAG_NUM_PORT));
-
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
+ tcpudp_one_end(local_addr, sizeof(local_addr),
+ ap, local_port, (struct sockaddr *) &localaddr,
+ "tcp");
+
+ tcpudp_one_end(rem_addr, sizeof(rem_addr),
+ ap, rem_port, (struct sockaddr *) &remaddr,
+ "tcp");
- strcat(local_addr, ":");
- strcat(local_addr, buffer);
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
-
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
-
- strcat(rem_addr, ":");
- strcat(rem_addr, buffer);
timers[0] = '\0';
-
if (flag_opt)
switch (timer_run) {
case 0:
@@ -820,8 +871,11 @@
timer_run, (double) time_len / HZ, retr, timeout);
break;
}
- printf("%-4s %6ld %6ld %-*s %-*s %-11s",
- protname, rxq, txq, netmax(23,strlen(local_addr)), local_addr, netmax(23,strlen(rem_addr)), rem_addr, _(tcp_state[state]));
+
+ tcpudp_write(protname,
+ rxq, txq,
+ local_addr, rem_addr,
+ _(tcp_state[state]));
finish_this_one(uid,inode,timers);
}
@@ -835,7 +889,7 @@
static void udp_do_one(int lnr, const char *line)
{
- char buffer[8192], local_addr[64], rem_addr[64];
+ char local_addr[64], rem_addr[64];
char *udp_state, timers[64], more[512];
int num, local_port, rem_port, d, state, timer_run, uid, timeout;
char *protname;
@@ -927,24 +981,13 @@
if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
{
- safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
- flag_not), sizeof(local_addr));
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(local_port), "udp",
- flag_not & FLAG_NUM_PORT));
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
- strcat(local_addr, ":");
- strcat(local_addr, buffer);
-
- snprintf(buffer, sizeof(buffer), "%s",
- get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
- flag_not), sizeof(rem_addr));
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
- strcat(rem_addr, ":");
- strcat(rem_addr, buffer);
+ tcpudp_one_end(local_addr, sizeof(local_addr),
+ ap, local_port, (struct sockaddr *) &localaddr,
+ "udp");
+
+ tcpudp_one_end(rem_addr, sizeof(rem_addr),
+ ap, rem_port, (struct sockaddr *) &remaddr,
+ "udp");
timers[0] = '\0';
if (flag_opt)
@@ -963,8 +1006,11 @@
retr, timeout);
break;
}
- printf("%-4s %6ld %6ld %-23s %-23s %-11s",
- protname, rxq, txq, local_addr, rem_addr, udp_state);
+
+ tcpudp_write(protname,
+ rxq, txq,
+ local_addr, rem_addr,
+ udp_state);
finish_this_one(uid,inode,timers);
}
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #87 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi Bernd,
What is the status of this bug?
Did you decide about the offered patches already?
Greetings,
Olaf
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Bernd Eckenfels <be-mail2005@lina.inka.de>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #92 received at 254243@bugs.debian.org (full text, mbox, reply):
On Fri, Dec 16, 2005 at 08:03:47PM +0100, Olaf van der Spek wrote:
> Bernd?
I dont like the prposed solution, i am looking for a more generic one. The
pressing problem is to display IPV6 netstat on 80char widt correctly without
truncation (#254243).
I guess this will require some changes to the output formatter, anyway.
I think i will add a non-formatting/non-truncating scritable output instead
of the wide switch, and make netstat on tty observ cols. The question is,
what size to use on non-tty output.
Gruss
Bernd
--
(OO) -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
( .. ) ecki@{inka.de,linux.de,debian.org} http://www.eckes.org/
o--o 1024D/E383CD7E eckes@IRCNet v:+497211603874 f:+49721151516129
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #97 received at 254243@bugs.debian.org (full text, mbox, reply):
On 12/16/05, Bernd Eckenfels <be-mail2005@lina.inka.de> wrote:
> On Fri, Dec 16, 2005 at 08:03:47PM +0100, Olaf van der Spek wrote:
> > Bernd?
>
> I dont like the prposed solution, i am looking for a more generic one. The
Thanks for the response.
In what way would you like it to be more generic?
> pressing problem is to display IPV6 netstat on 80char widt correctly without
> truncation (#254243).
That's not possible without dropping entire columns.
> I guess this will require some changes to the output formatter, anyway.
>
> I think i will add a non-formatting/non-truncating scritable output instead
> of the wide switch, and make netstat on tty observ cols. The question is,
> what size to use on non-tty output.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <olafvdspek@gmail.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #102 received at 254243@bugs.debian.org (full text, mbox, reply):
On 12/16/05, Olaf van der Spek <olafvdspek@gmail.com> wrote:
> On 12/16/05, Bernd Eckenfels <be-mail2005@lina.inka.de> wrote:
> > On Fri, Dec 16, 2005 at 08:03:47PM +0100, Olaf van der Spek wrote:
> > > Bernd?
> >
> > I dont like the prposed solution, i am looking for a more generic one. The
>
> Thanks for the response.
> In what way would you like it to be more generic?
>
> > pressing problem is to display IPV6 netstat on 80char widt correctly without
> > truncation (#254243).
>
> That's not possible without dropping entire columns.
>
> > I guess this will require some changes to the output formatter, anyway.
> >
> > I think i will add a non-formatting/non-truncating scritable output instead
> > of the wide switch, and make netstat on tty observ cols. The question is,
> > what size to use on non-tty output.
Bernd?
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <OvdSpek@LIACS.NL>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #107 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi Bernd,
Do you mind if an NMU is done to fix this issue?
Olaf
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Bernd Eckenfels <be-mail2006@lina.inka.de>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #112 received at 254243@bugs.debian.org (full text, mbox, reply):
On Sat, Mar 11, 2006 at 10:31:58PM +0100, Olaf van der Spek wrote:
> Do you mind if an NMU is done to fix this issue?
An NMU for a Wishlist Bug is IMHO not aproperiate, especially not since the
fixing patch may break existing scripts.
Gruss
Bernd
--
(OO) -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
( .. ) ecki@{inka.de,linux.de,debian.org} http://www.eckes.org/
o--o 1024D/E383CD7E eckes@IRCNet v:+497211603874 f:+49721151516129
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <OvdSpek@LIACS.NL>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #117 received at 254243@bugs.debian.org (full text, mbox, reply):
Bernd Eckenfels wrote:
> On Sat, Mar 11, 2006 at 10:31:58PM +0100, Olaf van der Spek wrote:
>> Do you mind if an NMU is done to fix this issue?
>
> An NMU for a Wishlist Bug is IMHO not aproperiate, especially not since the
> fixing patch may break existing scripts.
The patch I submitted does not change the output if stdout is not a
terminal.
Could you please explain how it still breaks existing scripts?
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Olaf van der Spek <OvdSpek@LIACS.NL>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #122 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi,
I've increased the severity to normal as these bugs do affect the
usefulness of the netstat app.
Olaf
Severity set to `normal'.
Request was from
Olaf van der Spek <OvdSpek@LIACS.NL>
to
control@bugs.debian.org.
Full text and
rfc822 format available.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Joel Becker <jlbec@evilplan.org>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #129 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek <OvdSpek@LIACS.NL> wrote:
> I've increased the severity to normal as these bugs do affect the
> usefulness of the netstat app.
Can we increase it further? This is not cosmetic. I just
suffered an attack on my httpd from a runaway host, and I couldn't
determine which host it was because of the output truncation. Sure, I
was able to find out with deeper digging, but this sort of thing is
precisely what people use "netstat -an" for!
Joel
--
"People with narrow minds usually have broad tongues."
http://www.jlbec.org/
jlbec@evilplan.org
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Bernd Eckenfels <be-mail2006@lina.inka.de>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #134 received at 254243@bugs.debian.org (full text, mbox, reply):
severity 254243 important
thanks
yes it is possible.
The new version will feature a -X option which enforce script-parseable,
untruncated netstat output. Then the bug can be a wishlist to better use the
available interactive screen space.
Gruss
Bernd
On Fri, Mar 17, 2006 at 06:23:56PM +0000, Joel Becker wrote:
> Olaf van der Spek <OvdSpek@LIACS.NL> wrote:
> > I've increased the severity to normal as these bugs do affect the
> > usefulness of the netstat app.
>
> Can we increase it further? This is not cosmetic. I just
> suffered an attack on my httpd from a runaway host, and I couldn't
> determine which host it was because of the output truncation. Sure, I
> was able to find out with deeper digging, but this sort of thing is
> precisely what people use "netstat -an" for!
>
> Joel
>
> --
>
> "People with narrow minds usually have broad tongues."
>
> http://www.jlbec.org/
> jlbec@evilplan.org
>
--
(OO) -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
( .. ) ecki@{inka.de,linux.de,debian.org} http://www.eckes.org/
o--o 1024D/E383CD7E eckes@IRCNet v:+497211603874 f:+49721151516129
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
Severity set to `important'.
Request was from
Bernd Eckenfels <be-mail2006@lina.inka.de>
to
control@bugs.debian.org.
Full text and
rfc822 format available.
Tags added: ipv6
Request was from
Thijs Kinkhorst <thijs@debian.org>
to
control@bugs.debian.org.
Full text and
rfc822 format available.
Acknowledgement sent to
Bernd Eckenfels <be-mail2006@lina.inka.de>:
Extra info received and filed, but not forwarded.
Full text and
rfc822 format available.
Message #143 received at 254243-quiet@bugs.debian.org (full text, mbox, reply):
Thanks for the patch, it is a known bug, with some possible solutions. Will
most likely add your patch as a "unformatted delimited" version.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=254243 for alternatives
Gruss
Bernd
On Tue, Oct 10, 2006 at 06:28:49AM +0200, nh wrote:
> Hi,
>
> debian net-tools netstat strips ipv6 raw6/tcp6/udp6 remote/local address
> fields to length of ~18 (without port).
> I didn't find way how to make it print full address (since it's
> hardcoded to keep formatting).
>
> Patch makes it to print full addresses when '-v' switch is used.
> It's applicable on net-tools_1.60-10 and testing/unstable net-tools_1.60-17.
>
> I'm not sure if there is any special ipv6 version of net-tools, other
> tool which I missed or particular reason why it's limited (I do prefer
> to see full address instead of nicely formatted and stripped stuff in
> some cases :>), so sorry for bothering if it's some of those variants.
>
> Regards,
> Nathaniel Hier
>
>
>
>
>
>
> --- old/net-tools-1.60/netstat.c 2006-10-10 05:45:48.000000000 +0200
> +++ net-tools-1.60/netstat.c 2006-10-10 05:46:19.000000000 +0200
> @@ -779,16 +779,26 @@
> get_sname(htons(local_port), "tcp",
> flag_not & FLAG_NUM_PORT));
>
> - if ((strlen(local_addr) + strlen(buffer)) > 22)
> + if ((strlen(local_addr) + strlen(buffer)) > 22 && !protname[3])
> local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> + local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 46)
> + local_addr[46 - strlen(buffer)] = '\0';
>
> strcat(local_addr, ":");
> strcat(local_addr, buffer);
> snprintf(buffer, sizeof(buffer), "%s",
> get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
>
> - if ((strlen(rem_addr) + strlen(buffer)) > 22)
> + if ((strlen(rem_addr) + strlen(buffer)) > 22 && !protname[3])
> + rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 46)
> + rem_addr[46 - strlen(buffer)] = '\0';
>
> strcat(rem_addr, ":");
> strcat(rem_addr, buffer);
> @@ -820,6 +830,8 @@
> timer_run, (double) time_len / HZ, retr, timeout);
> break;
> }
> +
> +
> printf("%-4s %6ld %6ld %-*s %-*s %-11s",
> protname, rxq, txq, netmax(23,strlen(local_addr)), local_addr, netmax(23,strlen(rem_addr)), rem_addr, _(tcp_state[state]));
>
> @@ -932,8 +944,15 @@
> snprintf(buffer, sizeof(buffer), "%s",
> get_sname(htons(local_port), "udp",
> flag_not & FLAG_NUM_PORT));
> - if ((strlen(local_addr) + strlen(buffer)) > 22)
> +
> + if ((strlen(local_addr) + strlen(buffer)) > 22 && !protname[3])
> local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> + local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 46)
> + local_addr[46 - strlen(buffer)] = '\0';
> +
> strcat(local_addr, ":");
> strcat(local_addr, buffer);
>
> @@ -941,8 +960,14 @@
> get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
> safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
> flag_not), sizeof(rem_addr));
> - if ((strlen(rem_addr) + strlen(buffer)) > 22)
> + if ((strlen(rem_addr) + strlen(buffer)) > 22 && !protname[3])
> rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> + rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 46)
> + rem_addr[46 - strlen(buffer)] = '\0';
> +
> strcat(rem_addr, ":");
> strcat(rem_addr, buffer);
>
> @@ -963,8 +988,9 @@
> retr, timeout);
> break;
> }
> - printf("%-4s %6ld %6ld %-23s %-23s %-11s",
> - protname, rxq, txq, local_addr, rem_addr, udp_state);
> +
> + printf("%-4s %6ld %6ld %-*s %-*s %-11s",
> + protname, rxq, txq, netmax(23,strlen(local_addr)), local_addr, netmax(23,strlen(rem_addr)), rem_addr, udp_state);
>
> finish_this_one(uid,inode,timers);
> }
> @@ -1054,8 +1080,15 @@
> flag_not & FLAG_NUM_PORT));
> safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
> flag_not), sizeof(local_addr));
> - if ((strlen(local_addr) + strlen(buffer)) > 22)
> +
> + if ((strlen(local_addr) + strlen(buffer)) > 22 && !protname[3])
> + local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> local_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(local_addr) + strlen(buffer)) > 46)
> + local_addr[46 - strlen(buffer)] = '\0';
> +
> strcat(local_addr, ":");
> strcat(local_addr, buffer);
>
> @@ -1063,8 +1096,15 @@
> get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
> safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
> flag_not), sizeof(rem_addr));
> - if ((strlen(rem_addr) + strlen(buffer)) > 22)
> +
> + if ((strlen(rem_addr) + strlen(buffer)) > 22 && !protname[3])
> rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 22 &&
> + !(flag_ver & FLAG_VERBOSE) && protname[3])
> + rem_addr[22 - strlen(buffer)] = '\0';
> + else if ((strlen(rem_addr) + strlen(buffer)) > 46)
> + rem_addr[46 - strlen(buffer)] = '\0';
> +
> strcat(rem_addr, ":");
> strcat(rem_addr, buffer);
>
--
(OO) -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
( .. ) ecki@{inka.de,linux.de,debian.org} http://www.eckes.org/
o--o 1024D/E383CD7E eckes@IRCNet v:+497211603874 f:+49721151516129
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
Brian Haley <brian.haley@hp.com>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #148 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi,
I also ran into this problem and have tried both patches here. I don't
really like the second one since in addition to having to supply a -v
flag you get spurious warnings depending on what address families are
installed:
netstat: no support for `AF IPX' on this system.
netstat: no support for `AF AX25' on this system.
netstat: no support for `AF X25' on this system.
netstat: no support for `AF NETROM' on this system.
I know it's the easy solution since USAGI did the same thing in 2002
though... but not having the default be the full output can lead to this:
# netstat -an
tcp6 0 0 ::ffff:16.123.1.1:22 ::ffff:16.123.1.2:57347 ESTABLISHED
# netstat -anv
tcp6 0 0 ::ffff:16.123.1.1:22 ::ffff:16.123.1.29:57347 ESTABLISHED
If I didn't know to add the -v I would have missed that final 9 in 29
since it at least looked like a valid address.
Thanks,
-Brian
Tags added: upstream
Request was from
Peter Eisentraut <peter_e@gmx.net>
to
control@bugs.debian.org.
(Thu, 03 Apr 2008 15:33:02 GMT)
Full text and
rfc822 format available.
Information forwarded to
debian-bugs-dist@lists.debian.org, Bernd Eckenfels <ecki@debian.org>:
Bug#254243; Package
net-tools.
Full text and
rfc822 format available.
Acknowledgement sent to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
Bernd Eckenfels <ecki@debian.org>.
Full text and
rfc822 format available.
Message #155 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
What's the status of this bug report/patch?
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Sun, 19 Oct 2008 09:33:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Sun, 19 Oct 2008 09:33:08 GMT)
Full text and
rfc822 format available.
Message #160 received at 254243@bugs.debian.org (full text, mbox, reply):
I think it should be merged with #222324
I'm willing to continue work on my patch from 2005 if Luk and Martin agree.
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Sun, 19 Oct 2008 10:42:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Luk Claes <luk@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Sun, 19 Oct 2008 10:42:08 GMT)
Full text and
rfc822 format available.
Message #165 received at 254243@bugs.debian.org (full text, mbox, reply):
Olaf van der Spek wrote:
> I think it should be merged with #222324
> I'm willing to continue work on my patch from 2005 if Luk and Martin agree.
It's a bit unclear to me what Bernd's objections are and what he
intended to incorporate, so I kind of decided to delay this till after
lenny. But I don't see a reason to not go forward with this once it's
clear to me what Bernd's opinion is...
Cheers
Luk
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Sun, 19 Oct 2008 18:42:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Sun, 19 Oct 2008 18:42:12 GMT)
Full text and
rfc822 format available.
Message #170 received at 254243@bugs.debian.org (full text, mbox, reply):
Luk Claes wrote:
> Olaf van der Spek wrote:
>> I think it should be merged with #222324
>> I'm willing to continue work on my patch from 2005 if Luk and Martin agree.
>
> It's a bit unclear to me what Bernd's objections are and what he
Yeah, it's unclear to me too. ;)
That was the core of the issue.
> intended to incorporate, so I kind of decided to delay this till after
> lenny. But I don't see a reason to not go forward with this once it's
> clear to me what Bernd's opinion is...
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 06:45:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 06:45:02 GMT)
Full text and
rfc822 format available.
Message #175 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.19.1125 +0200]:
> I think it should be merged with #222324
> I'm willing to continue work on my patch from 2005 if Luk and Martin agree.
I don't want to have to rely on a width switch. I'd say that netstat
should output line-oriented and stop worrying about terminal size.
First of all, IPv6-connected hosts are unlikely to be so old that
they can only do width-80 or non-tty terminals, and second, the days
of tools like route/arp/netstat which present formatted output
(which is harder to process) are hopefully over in favour of tools
that print the maximum of information and leave it to other tools to
do the formatting. I really like /bin/ip for that reason, and
because its output is the same as its input. Tabular output, like
netstat, is IMHO not worth the trouble, especially if it means that
the output cannot be complete.
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 10:51:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 10:51:02 GMT)
Full text and
rfc822 format available.
Message #180 received at 254243@bugs.debian.org (full text, mbox, reply):
martin f krafft wrote:
> also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.19.1125 +0200]:
>> I think it should be merged with #222324
>> I'm willing to continue work on my patch from 2005 if Luk and Martin agree.
>
> I don't want to have to rely on a width switch. I'd say that netstat
> should output line-oriented and stop worrying about terminal size.
> First of all, IPv6-connected hosts are unlikely to be so old that
> they can only do width-80 or non-tty terminals, and second, the days
> of tools like route/arp/netstat which present formatted output
> (which is harder to process) are hopefully over in favour of tools
> that print the maximum of information and leave it to other tools to
> do the formatting. I really like /bin/ip for that reason, and
> because its output is the same as its input. Tabular output, like
> netstat, is IMHO not worth the trouble, especially if it means that
> the output cannot be complete.
That's fine for machine readable output, but what about human readable
output?
And how to handle existing scripts that rely on this specific tabular
output?
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 10:54:31 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 10:54:31 GMT)
Full text and
rfc822 format available.
Message #185 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.20.1244 +0200]:
> That's fine for machine readable output, but what about human readable
> output?
That's debateable. I find e.g. 'ip route list' output far better
than /sbin/route by now. The same applies to 'ip address list' vs.
/sbin/ifconfig. /usr/sbin/arp was always non-tabular.
> And how to handle existing scripts that rely on this specific tabular
> output?
those should hardly depend on column or terminal width.
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
"there was no difference between the behavior of a god
and the operations of pure chance..."
-- thomas pynchon, "gravity's rainbow"
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 11:03:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 11:03:02 GMT)
Full text and
rfc822 format available.
Message #190 received at 254243@bugs.debian.org (full text, mbox, reply):
martin f krafft wrote:
> also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.20.1244 +0200]:
>> That's fine for machine readable output, but what about human readable
>> output?
>
> That's debateable. I find e.g. 'ip route list' output far better
> than /sbin/route by now. The same applies to 'ip address list' vs.
> /sbin/ifconfig. /usr/sbin/arp was always non-tabular.
# arp
Address HWtype HWaddress Flags Mask
Iface
192.168.1.34 ether 00:17:31:64:23:c5 C
eth0
192.168.1.254 ether 00:19:cb:43:af:b7 C
eth0
This looks pretty tabular to me.
>> And how to handle existing scripts that rely on this specific tabular
>> output?
>
> those should hardly depend on column or terminal width.
So that doesn't have to be taken into account? Good.
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 11:12:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 11:12:02 GMT)
Full text and
rfc822 format available.
Message #195 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.20.1259 +0200]:
> Address HWtype HWaddress Flags Mask Iface
> 192.168.1.34 ether 00:17:31:64:23:c5 C eth0
> 192.168.1.254 ether 00:19:cb:43:af:b7 C eth0
>
> This looks pretty tabular to me.
Ha! I forgot! I have arp aliased to arp -a:
-a Use alternate BSD style output format (with no fixed columns).
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
"you don't sew with a fork, so i see no reason
to eat with knitting needles."
-- miss piggy, on eating chinese food
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 11:18:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 11:18:03 GMT)
Full text and
rfc822 format available.
Message #200 received at 254243@bugs.debian.org (full text, mbox, reply):
martin f krafft wrote:
> also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.20.1259 +0200]:
>> Address HWtype HWaddress Flags Mask Iface
>> 192.168.1.34 ether 00:17:31:64:23:c5 C eth0
>> 192.168.1.254 ether 00:19:cb:43:af:b7 C eth0
>>
>> This looks pretty tabular to me.
>
> Ha! I forgot! I have arp aliased to arp -a:
>
> -a Use alternate BSD style output format (with no fixed columns).
Hehe. I really don't think that's good for netstat. Too many columns and
too many rows.
But as machine readable format, it's the best way I think.
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 19:51:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Luar Roji <cyberplant@roji.net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 19:51:02 GMT)
Full text and
rfc822 format available.
Message #205 received at 254243@bugs.debian.org (full text, mbox, reply):
I think we have to fix it soon, some way or another..
I would preffer to keep the actual behaviour so no scripts are harmed. But
it's real that we don't want to have to add a new command line flag always
from now!
Now, another fact is that netstat was always tabular, and I think we are used
to see it this way..
Maybe (only maybe!) we can make a NEW version of netstat, and show a warning
when chopping is happening, so we don't break actual scripts, and in the new
version we can do what we want without being afraid, what do you think? In
the future we can rename the old netstat, and use the new as the original..
netstat-ng?
On Mon, Oct 20, 2008 at 01:12:33PM +0200, Olaf van der Spek wrote:
> martin f krafft wrote:
>> also sprach Olaf van der Spek <Olaf@XWIS.Net> [2008.10.20.1259 +0200]:
>>> Address HWtype HWaddress Flags Mask Iface
>>> 192.168.1.34 ether 00:17:31:64:23:c5 C eth0
>>> 192.168.1.254 ether 00:19:cb:43:af:b7 C eth0
>>>
>>> This looks pretty tabular to me.
>>
>> Ha! I forgot! I have arp aliased to arp -a:
>>
>> -a Use alternate BSD style output format (with no fixed columns).
>
> Hehe. I really don't think that's good for netstat. Too many columns and
> too many rows.
>
> But as machine readable format, it's the best way I think.
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 19:54:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 19:54:03 GMT)
Full text and
rfc822 format available.
Message #210 received at 254243@bugs.debian.org (full text, mbox, reply):
Luar Roji wrote:
> I think we have to fix it soon, some way or another..
Before or after Lenny?
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 21:33:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Luar Roji <cyberplant@roji.net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 21:33:03 GMT)
Full text and
rfc822 format available.
Message #215 received at 254243@bugs.debian.org (full text, mbox, reply):
I think it's important enough to have it fixed in lenny, but don't know what
other people think about.
On Mon, Oct 20, 2008 at 09:50:59PM +0200, Olaf van der Spek wrote:
> Luar Roji wrote:
>> I think we have to fix it soon, some way or another..
>
> Before or after Lenny?
>
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Mon, 20 Oct 2008 21:36:23 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Mon, 20 Oct 2008 21:36:24 GMT)
Full text and
rfc822 format available.
Message #220 received at 254243@bugs.debian.org (full text, mbox, reply):
Luar Roji wrote:
> I think it's important enough to have it fixed in lenny, but don't know what
> other people think about.
I think it should've been fixed before Etch. ;)
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Tue, 21 Oct 2008 08:18:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Tue, 21 Oct 2008 08:18:03 GMT)
Full text and
rfc822 format available.
Message #225 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach Luar Roji <cyberplant@roji.net> [2008.10.20.2146 +0200]:
> Maybe (only maybe!) we can make a NEW version of netstat, and show a warning
> when chopping is happening, so we don't break actual scripts, and in the new
> version we can do what we want without being afraid, what do you think? In
> the future we can rename the old netstat, and use the new as the original..
This, in addition to the -w flag, sounds like a good idea! The
question now is whether it's possible to patch the source in such
a way that the release team will let us bring it into lenny. I think
it's worth a try and I am happy to help you make it happen.
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Tue, 11 Nov 2008 07:57:43 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Tue, 11 Nov 2008 07:58:08 GMT)
Full text and
rfc822 format available.
Message #230 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
tags 254243 patch
thanks
@Phil, net-tools upstream: here is a patch proposal for netstat, you
can find information and the discussion leading up to it here:
http://bugs.debian.org/254243
If you could acknowledge that you like the solution and want to
integrate it into netstat, then we could try to push it into our
forthcoming stable release, which has IPv6 as a release goal.
@Luk, Debian release team: I'd appreciate a short note whether this
is NMU-able and potentially could become part of lenny.
also sprach Luar Roji <cyberplant@roji.net> [2008.11.11.0837 +0100]:
> Well, I've finally done it!
[...]
> The URL is: http://roji.net/net-tools-files.tar.gz
Hi Luar, this is *really good* work. The patch is minimal and
non-intrusive, I wish more people would work like you. Don't worry
about taking a bit longer, we all have our lives to live. It's the
result in the end which counts. And yours is great.
I've tried the new package and I've created a patch as follows, and
also added the patch tag to the bug report (this email is BCC'd to
control@bugs.debian.org).
Let's hope upstream/Phil likes it as much as I do. I'll wait for his
word before I upload an NMU.
$ debdiff net-tools_1.60-21.dsc net-tools_1.60-21.1.dsc
diffstat for net-tools_1.60-21 net-tools_1.60-21.1
debian/changelog | 7 +++++++
netstat.c | 18 +++++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff -u net-tools-1.60/netstat.c net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c
+++ net-tools-1.60/netstat.c
@@ -149,6 +149,7 @@
int flag_igmp= 0;
int flag_rom = 0;
int flag_exp = 1;
+int flag_wide= 0;
int flag_prg = 0;
int flag_arg = 0;
int flag_ver = 0;
@@ -786,16 +787,20 @@
get_sname(htons(local_port), "tcp",
flag_not & FLAG_NUM_PORT));
- if ((strlen(local_addr) + strlen(buffer)) > 22)
- local_addr[22 - strlen(buffer)] = '\0';
+ if (!flag_wide) {
+ if ((strlen(local_addr) + strlen(buffer)) > 22)
+ local_addr[22 - strlen(buffer)] = '\0';
+ }
strcat(local_addr, ":");
strcat(local_addr, buffer);
snprintf(buffer, sizeof(buffer), "%s",
get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
- rem_addr[22 - strlen(buffer)] = '\0';
+ if (!flag_wide) {
+ if ((strlen(rem_addr) + strlen(buffer)) > 22)
+ rem_addr[22 - strlen(buffer)] = '\0';
+ }
strcat(rem_addr, ":");
strcat(rem_addr, buffer);
@@ -1595,7 +1600,7 @@
getroute_init(); /* Set up AF routing support */
afname[0] = '\0';
- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl64", longopts, &lop)) != EOF)
+ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF)
switch (i) {
case -1:
break;
@@ -1639,6 +1644,9 @@
case 'i':
flag_int++;
break;
+ case 'W':
+ flag_wide++;
+ break;
case 'n':
flag_not |= FLAG_NUM;
break;
diff -u net-tools-1.60/debian/changelog net-tools-1.60/debian/changelog
--- net-tools-1.60/debian/changelog
+++ net-tools-1.60/debian/changelog
@@ -1,3 +1,10 @@
+net-tools (1.60-21.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Added new parameter -W to not truncate IP addresses (Closes: #254243)
+
+ -- Luar Roji <cyberplant@roji.net> Tue, 11 Nov 2008 05:15:42 -0200
+
net-tools (1.60-21) unstable; urgency=low
* Update maintainer to net-tools Team.
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
"aus der kriegsschule des lebens -
was mich nicht umbringt, macht mich härter."
- friedrich nietzsche
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Tags added: patch
Request was from
martin f krafft <madduck@debian.org>
to
control@bugs.debian.org.
(Tue, 11 Nov 2008 07:58:35 GMT)
Full text and
rfc822 format available.
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Tue, 11 Nov 2008 09:03:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Tue, 11 Nov 2008 09:03:06 GMT)
Full text and
rfc822 format available.
Message #237 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach Luar Roji <cyberplant@roji.net> [2008.11.11.0909 +0100]:
> I forgot to add a description of the flag in the help page, do you
> want I add it?
>
> What about the manpage?
Yes, that would make sense. Also, it has been suggested to add
--wide as a synonym.
You can just recreate the diff, no need to create a new changelog
entry.
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
"if confronted with a choice between all the truth in god's right hand
and the ever live struggle for truth, coupled with eternal error, in
god's left, i would choose the left."
-- gotthold lessing
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Tue, 11 Nov 2008 13:57:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Tue, 11 Nov 2008 13:57:03 GMT)
Full text and
rfc822 format available.
Message #242 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach martin f krafft <madduck@debian.org> [2008.11.11.1000 +0100]:
> Yes, that would make sense. Also, it has been suggested to add
> --wide as a synonym.
>
> You can just recreate the diff, no need to create a new changelog
> entry.
Attached is the updated patch and upstream is again on Cc. I changed
the changelog entry a bit from what Luar sent, and verified that the
patch is sane and obeys style rules etc. I also rephrased the
manpage description.
Still waiting for upstream to give an okay. This is not to sound
impatient, just telling the world that I haven't received one yet.
:)
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
quantum mechanics: the dreams stuff is made of.
[net-tools_1.60-21.1.debdiff (text/plain, attachment)]
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Reply sent
to
Luk Claes <luk@debian.org>:
You have taken responsibility.
(Sun, 16 Nov 2008 17:27:10 GMT)
Full text and
rfc822 format available.
Notification sent
to
martin f krafft <madduck@debian.org>:
Bug acknowledged by developer.
(Sun, 16 Nov 2008 17:27:11 GMT)
Full text and
rfc822 format available.
Message #247 received at 254243-close@bugs.debian.org (full text, mbox, reply):
Source: net-tools
Source-Version: 1.60-22
We believe that the bug you reported is fixed in the latest version of
net-tools, which is due to be installed in the Debian FTP archive:
net-tools_1.60-22.diff.gz
to pool/main/n/net-tools/net-tools_1.60-22.diff.gz
net-tools_1.60-22.dsc
to pool/main/n/net-tools/net-tools_1.60-22.dsc
net-tools_1.60-22_i386.deb
to pool/main/n/net-tools/net-tools_1.60-22_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 254243@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Luk Claes <luk@debian.org> (supplier of updated net-tools package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sun, 16 Nov 2008 17:53:05 +0100
Source: net-tools
Binary: net-tools
Architecture: source i386
Version: 1.60-22
Distribution: unstable
Urgency: low
Maintainer: net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>
Changed-By: Luk Claes <luk@debian.org>
Description:
net-tools - The NET-3 networking toolkit
Closes: 254243
Changes:
net-tools (1.60-22) unstable; urgency=low
.
* Add new command line option -W/--wide to netstat which prevents
truncation of IPv6 addresses (Closes: #254243). Thanks Luar Roji.
Checksums-Sha1:
de5608534270fd0d2b4621dd7a50613ceacdf291 1070 net-tools_1.60-22.dsc
0e4502c63ebc4201b4a6d458da7e0663dcb345b2 191308 net-tools_1.60-22.diff.gz
e974963aeab15af592baa08d9a8132a32f55d175 264606 net-tools_1.60-22_i386.deb
Checksums-Sha256:
b2018137415aa14f4fe0c38249650ab0801cdb37dee629c6e5c2123e6bef386f 1070 net-tools_1.60-22.dsc
13b422ab816e96f77c1f29cfad5885d9c12a402c6c908314d7de3a681ee75138 191308 net-tools_1.60-22.diff.gz
c66b55778c6d6db78da3303f81e2f5f35e18b32d593e5af7ec2d9c3f5db9ccba 264606 net-tools_1.60-22_i386.deb
Files:
4363de6eca4bbcdb9c718fc9f4caeda6 1070 net important net-tools_1.60-22.dsc
2b9b816167b67d2714de52c845828644 191308 net important net-tools_1.60-22.diff.gz
bba2a9db8105ed8da392150485f24f1b 264606 net important net-tools_1.60-22_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkkgUNIACgkQ5UTeB5t8Mo3RPwCeN9nL/K/Z3wqiu/HEgc6dKzxz
tTMAoIjV+yyIfdbWFogmcRuyl2FLsMc7
=1+6N
-----END PGP SIGNATURE-----
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Sun, 16 Nov 2008 17:39:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Sun, 16 Nov 2008 17:39:07 GMT)
Full text and
rfc822 format available.
Message #252 received at 254243@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
also sprach martin f krafft <madduck@debian.org> [2008.11.11.1453 +0100]:
> Still waiting for upstream to give an okay. This is not to sound
> impatient, just telling the world that I haven't received one yet.
Luk informed me that the patch has been committed upstream and he
pushed 1.60-22 to the archive just now.
Thanks Luar. You've made the (IPv6) world a better place. :)
--
.''`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems
if loving linux is wrong, i don't want to be right.
[digital_signature_gpg.asc (application/pgp-signature, inline)]
Information forwarded
to
debian-bugs-dist@lists.debian.org, net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>:
Bug#254243; Package
net-tools.
(Tue, 02 Dec 2008 14:12:10 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ferenc Wagner <wferi@niif.hu>:
Extra info received and forwarded to list. Copy sent to
net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>.
(Tue, 02 Dec 2008 14:12:10 GMT)
Full text and
rfc822 format available.
Message #257 received at 254243@bugs.debian.org (full text, mbox, reply):
Hi,
Thanks for finally fixing this long standing and disturbing bug!
Do you think it will get a Lenny freeze exception? :)
--
Cheers,
Feri.
Bug archived.
Request was from
Debbugs Internal Request <owner@bugs.debian.org>
to
internal_control@bugs.debian.org.
(Tue, 06 Jan 2009 07:31:52 GMT)
Full text and
rfc822 format available.
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed Jan 6 13:15:10 2016;
Machine Name:
buxtehude
Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.