Subject: netstat fails on -current
To: None <christos@netbsd.org>
From: Kurt Schreiner <ks@ub.uni-mainz.de>
List: current-users
Date: 08/21/2006 16:35:26
Hi,

netstat crashes with "Segmentation fault" since some days on -current.
Tracing this down I've found the "||" -> "&&" change beeing the culprit.
There's some more "||" -> "&&" needed to make it work again (compiled
on i386 and tested both as "netstat" and "netstat <kernel> <devmem>"):

diff -u main.c main.c.ks
--- main.c.old      2006-08-19 12:18:41.000000000 +0200
+++ main.c          2006-08-21 16:16:54.000000000 +0200
@@ -547,7 +547,7 @@
        }
 #endif
 
-       if (!use_sysctl || (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0)) {
+       if (!use_sysctl && ((kvm_nlist(kvmd, nl) < 0) || nl[0].n_type == 0)) {
                if (nlistf)
                        errx(1, "%s: no namelist", nlistf);
                else


Kurt