Commit 2dd754e0 authored by Jaromír Končický's avatar Jaromír Končický Committed by Mike Frysinger

netstat: do not abort/warn with unsupported protocols using general -A buckets

When using a bucket of protocols (like -A inet), do not warn/abort when
some protocols are not supported.

URL: https://bugzilla.redhat.com/1063906
URL: https://bugzilla.redhat.com/1063913
parent 343192d1
......@@ -166,6 +166,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;
......@@ -180,9 +181,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 { \
......@@ -2053,7 +2054,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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment