Don't print a warning when using netstat to print

SCTP statistics when there is not SCTP in the kernel.
This problem was reported by Sean Mahood.

MFC after: 1 week.
This commit is contained in:
Michael Tuexen 2012-01-25 21:49:48 +00:00
parent 7599ae7787
commit 23a0e422aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230555

View File

@ -611,7 +611,8 @@ sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
memset(&zerostat, 0, len);
if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len,
zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
warn("sysctl: net.inet.sctp.stats");
if (errno != ENOENT)
warn("sysctl: net.inet.sctp.stats");
return;
}
} else