strange netstat -ian output

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Thu Jan 20 15:40:08 UTC 2011


On Fri, 21 Jan 2011, Hajimu UMEMOTO wrote:

> Hi,
>
>>>>>> On Wed, 19 Jan 2011 03:44:31 +0100
>>>>>> Bernd Walter <ticso at cicely7.cicely.de> said:
>
> ticso> This is one of the blocks for this interface:
> ticso> re0    1500 2a02:21e0:16e 2a02:21e0:16e0:20        0     -     -        1     -     -
> ticso>                           ff02:1::2          (refs: 1)
> ticso>                           ff02:1::d          (refs: 1)
> ticso>                           ff02:1::202        (refs: 1)
> ticso>                           ff02:1::1:ff00:103 (refs: 1)
> ticso>                           ff01:1::1          (refs: 1)
> ticso>                           ff02:1::2:6214:d648(refs: 1)
> ticso>                           ff02:1::1          (refs: 1)
> ticso>                           ff02:1::1:ff00:7992(refs: 1)
>
> ticso> 2a02:21e0:16e seems to be the truncated IP.
> ticso> The first line has 2a02:21e0:16e0:20 - I assume this should say 2a02:21e0:16e0:2000::103,
> ticso> but it is truncated as well...
>
> Yes, an IPv6 address is too long for the traditional netstat output
> format. :)
>
> ticso> Adding -W won't help on truncation.
>
> It seems -W is not handled, here.
>
> ticso> - ff02:1::2
> ticso>   is not just truncated - this obviously should be ff02::2.
> ticso>   This '1' is part of every multicst address listed, although they
> ticso>   don't belong there.
> ticso>   By looking at systems with a large number of interfaces I came to the
> ticso>   conclusion that this is the scope ID, but why is it listed as part
> ticso>   of the IP?
>
> Yes, it is the internal scope address representation of the KAME IPv6
> stack.  It is hided in the output of 'netstat -rn'.  But, it seems not
> for `netstat -ani'.  There is no reason to not hide it for `netstat
> -ani', IMHO.  So, I've just committed to hide it:
>
> 	http://svn.freebsd.org/viewvc/base?view=revision&revision=217642

Thanks; there's also a PR somewhere about it from today or yesterday.

The real problem of course is that those things are still queried by
kvm(3) rather than by a real interface in which case I think the
kernel shouldn't export the addresses with the scope embedded.  We
should make sure that with libnetstat or whatever, this will not come
back.

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
         <ks> Going to jail sucks -- <bz> All my daemons like it!
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html


More information about the freebsd-net mailing list