netstat and ipv6
Brooks Davis
brooks at one-eyed-alien.net
Fri Jul 14 22:46:30 UTC 2006
On Fri, Jul 14, 2006 at 03:39:59PM -0700, Julian Elischer wrote:
> Gary Palmer wrote:
>
> >On Fri, Jul 14, 2006 at 03:13:46PM -0700, Julian Elischer wrote:
> >
> >
> >>is ther ean official way that netstat should be using to NOT try fo ipv6
> >>stuff?
> >>
> >>
> >>%netstat -s>/dev/null
> >>Warning: sysctl(net.inet6.ip6.rip6stats): No such file or directory
> >>
> >>
> >
> >doesn't the
> >
> >-f inet
> >
> >parameter stop that?
> >
> >
>
> yeah but I shouldn't have to say that..
> It doesn't complain about the fact that appletalk isn't compiled into
> the system..
>
> I put forward the following patch:
> nutmeg:rjulian 33] cvs diff -u
> cvs server: Diffing .
> Index: inet6.c
> ===================================================================
> RCS file: /usr/local/cvsroot/freebsd/src/usr.bin/netstat/inet6.c,v
> retrieving revision 1.25
> diff -u -r1.25 inet6.c
> --- inet6.c 28 Jul 2004 16:03:12 -0000 1.25
> +++ inet6.c 14 Jul 2006 22:39:08 -0000
> @@ -1030,7 +1030,9 @@
> mib[3] = IPV6CTL_RIP6STATS;
> l = sizeof(rip6stat);
> if (sysctl(mib, 4, &rip6stat, &l, NULL, 0) < 0) {
> - perror("Warning: sysctl(net.inet6.ip6.rip6stats)");
> + /* Just shut up if the kernel doesn't have ipv6. */
> + if (errno != ENOENT)
> + perror("Warning: sysctl(net.inet6.ip6.rip6stats)");
> return;
> }
>
> nutmeg:rjulian 34] pwd
> /build/master/usr/src/usr.bin/netstat
> nutmeg:rjulian 35]
That looks like the right thing to me.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060714/06784646/attachment.pgp
More information about the freebsd-current
mailing list