Prevent sockstat print out some empty entries related to IPv6.
Sockstat use netstat tcp/udp socket print, and fstat tcp/udp socket print, but it just specify all of IPPROTO_IP and IPPROTO_IPV6 sockets for fstat. Now IPv6 socket also use raw socket, but only netstat don't print it, so now they are printed as empty entries in sockstat output. Approved by: jkh
This commit is contained in:
parent
2f66668b70
commit
f3935df101
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl5
|
||||
#-
|
||||
# Copyright (c) 1999 Dag-Erling Coïdan Smørgrav
|
||||
# Copyright (c) 1999 Dag-Erling Coïdan Smgrav
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -56,7 +56,7 @@ open FSTAT, "fstat |" or die "'fstat' failed: $!\n";
|
||||
while (<FSTAT>) {
|
||||
($user, $cmd, $pid, $fd, $inet, $type, $proto, $sock) = split;
|
||||
chop $fd;
|
||||
next unless ($inet =~ m/^internet6?$/);
|
||||
next unless ($inet =~ m/^internet6?$/) && ($type ne "raw");
|
||||
($proto, $laddr, $faddr) =
|
||||
($proto{$sock}, $myaddr{$sock}, $hisaddr{$sock});
|
||||
write STDOUT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user