From 91ef813ce3dfd62efa0613a6e03f65c47d61025d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Fri, 13 Oct 2000 16:25:37 +0000 Subject: [PATCH] Skip sockets with no SCB --- usr.bin/sockstat/sockstat.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/sockstat/sockstat.pl b/usr.bin/sockstat/sockstat.pl index a6223acda0c7..aa5e5a8446ab 100644 --- a/usr.bin/sockstat/sockstat.pl +++ b/usr.bin/sockstat/sockstat.pl @@ -104,6 +104,7 @@ sub print_inet($) { printf($inet_fmt, "USER", "COMMAND", "PID", "FD", "PROTO", "LOCAL ADDRESS", "FOREIGN ADDRESS"); foreach $fsd (@{$fstat{$af}}) { + next unless defined($fsd->[7]); $nsd = $netstat{$fsd->[7]} || $unknown; printf($inet_fmt, $fsd->[0], $fsd->[1], $fsd->[2], substr($fsd->[3], 0, -1), @@ -127,6 +128,7 @@ sub print_unix() { } printf($unix_fmt, "USER", "COMMAND", "PID", "FD", "PROTO", "ADDRESS"); foreach $fsd (@{$fstat{"local"}}) { + next unless defined($fsd->[6]); $nsd = $netstat{$fsd->[6]} || $unknown; printf($unix_fmt, $fsd->[0], $fsd->[1], $fsd->[2], substr($fsd->[3], 0, -1), $fsd->[5],