[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-bugs
Subject:    netstat address family and interface, well-known protocols
From:       marfabastewart <marfabastewart () protonmail ! com>
Date:       2020-07-18 15:07:39
Message-ID: z6OuKrmfVfxwm1-4l8eIIO62xuV-GaxAx1B3IqPf9qWSXlhwHEDyz6Hg5DhLH7g4HNa4Ywc7z03GVAppl76dvMfI7XAcOI5q7EvPSAvQAQY= () protonmail ! com
[Download RAW message or body]

Synopsis:=09netstat address family and interface, well-known protocols
Category:=09user
Environment:
=09System      : OpenBSD 6.7
=09Details     : OpenBSD 6.7-current (GENERIC.MP) #351: Wed Jul 15 16:57:00=
 MDT 2020
=09=09=09 deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC=
.MP

=09Architecture: OpenBSD.amd64
=09Machine     : amd64
Description:
=09netstat doesn't limit output to address family when used with -I, and pr=
otocol list problem
How-To-Repeat:
=09netstat -f inet -s -I lo0
=09or
=09netstat -s -f inet -I lo0
=09netstat -f inet -I lo0

=09Any interface can be used instead of lo0.
=09Netstat shows ipv6 information also although man netstat says
=09=09If the -f address_family option (with the -s option) is present,
=09        show per-interface statistics on the given interface for the
=09        specified address_family.

=09(It does, but doesn't limit output to the specified address_family.)

=09netstat -p only works for the protocols hard-coded in the protox struct =
in
=09/usr/src/usr.bin/netstat/main.c

Fix:
=09I'm not too well-versed in C (as perhaps my questions make clear)
=09but happy to try to offer patches if someone would suggest
=09the general direction of changes to make (and if the whole problem is no=
t EBKAC).

=09I note that netstat -f inet works but adding the -I doesn't seem to work=
.
=09Is it because if iflag is set, we call intpr:
=09=09if (iflag) {
=09=09=09intpr(interval, repeatcount);
=09=09=09exit(0);
=09=09}
=09in lines 295-296 in /usr/src/usr.bin/netstat/main.c?

=09For the protocol problem, I see the call to getprotoent but
=09no call to getprotobyname in the name2protox function in
=09/usr/src/usr.bin/netstat/main.c





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic