inspec/test/unit/mock/cmd/netstat-tulpen
Adam Leff 037f08beb2 Fixing port check with v4 IPs in a v6 netstat line
On Linux, netstat may show a tcp6/udp6 protocol line but include a
v4 address. This happens with AF_INET6 sockets that can accept
both v4 and v6 traffic. The port check was not properly handling
this situation and trying to pass a v4 address to URI bracketed as
if it was a v6 address.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-06 22:03:41 -07:00

7 lines
718 B
Text

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 21699 1/sshd
tcp6 0 48 2601:1:ad80:1445::54776 2620:0:861:52:208::6667 LISTEN 0 21702 2043/pidgin
tcp6 0 0 :::22 :::* LISTEN 0 21701 1/sshd
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 8689 545/rpcbind
tcp6 0 0 192.168.1.123:8005 :::* LISTEN 0 21703 1234/java