ss: Fix case when UDP is printed as ipproto-xxx
When 'ss' prints UDP sockets info together with RAW sockets
e.g.:
$ ss -a
then UDP sockets are resolved as "ipproto-xxx".
It was caused that dg_proto was set after printing UDP
socket info from netlink. So fixed issue by moving
setting dg_proto before printing info from Netlink.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
This commit is contained in:
parent
8c29ae7cc2
commit
ace5cb31b1
|
|
@ -2287,12 +2287,12 @@ static int udp_show(struct filter *f)
|
||||||
{
|
{
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
|
|
||||||
|
dg_proto = UDP_PROTO;
|
||||||
|
|
||||||
if (!getenv("PROC_NET_UDP") && !getenv("PROC_ROOT")
|
if (!getenv("PROC_NET_UDP") && !getenv("PROC_ROOT")
|
||||||
&& inet_show_netlink(f, NULL, IPPROTO_UDP) == 0)
|
&& inet_show_netlink(f, NULL, IPPROTO_UDP) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dg_proto = UDP_PROTO;
|
|
||||||
|
|
||||||
if (f->families&(1<<AF_INET)) {
|
if (f->families&(1<<AF_INET)) {
|
||||||
if ((fp = net_udp_open()) == NULL)
|
if ((fp = net_udp_open()) == NULL)
|
||||||
goto outerr;
|
goto outerr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue