jpopelka / rpms / net-tools

Forked from rpms/net-tools 4 years ago
Clone
Blob Blame History Raw
diff --git a/netstat.c b/netstat.c
index 911d0c3..d6037a0 100644
--- a/netstat.c
+++ b/netstat.c
@@ -167,6 +167,7 @@ int flag_exp = 1;
 int flag_wide= 0;
 int flag_prg = 0;
 int flag_arg = 0;
+int flag_noprot = 0;
 int flag_ver = 0;
 int flag_l2cap = 0;
 int flag_rfcomm = 0;
@@ -181,9 +182,9 @@ FILE *procinfo;
       perror((file));					\
       return -1;					\
     }							\
-    if (flag_arg || flag_ver)				\
+    if (!flag_noprot && (flag_arg || flag_ver))		\
       ESYSNOT("netstat", (name));			\
-    if (flag_arg)					\
+    if (!flag_noprot && flag_arg)			\
       rc = 1;						\
   } else {						\
     do {						\
@@ -2308,7 +2309,7 @@ int main
 
     if ((flag_inet || flag_inet6 || flag_sta) &&
         !(flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw))
-	   flag_tcp = flag_sctp = flag_udp = flag_udplite = flag_raw = 1;
+	   flag_noprot = flag_tcp = flag_sctp = flag_udp = flag_udplite = flag_raw = 1;
 
     if ((flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw || flag_igmp) &&
         !(flag_inet || flag_inet6))