ss: Use nl_proto_a2n for filtering by netlink proto
Now it is posible to filter by existing Netlink protos:
ss -A netlink src uevent
ss -A netlink src nft
ss -A netlink src genl
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
This commit is contained in:
parent
f00073e8b9
commit
b00daf6a83
12
misc/ss.c
12
misc/ss.c
|
|
@ -1229,16 +1229,8 @@ void *parse_hostcond(char *addr)
|
||||||
}
|
}
|
||||||
if (addr[0] && strcmp(addr, "*")) {
|
if (addr[0] && strcmp(addr, "*")) {
|
||||||
a.addr.bitlen = 32;
|
a.addr.bitlen = 32;
|
||||||
if (get_u32(a.addr.data, addr, 0)) {
|
if (nl_proto_a2n(&a.addr.data[0], addr) == -1)
|
||||||
if (strcmp(addr, "rtnl") == 0)
|
return NULL;
|
||||||
a.addr.data[0] = 0;
|
|
||||||
else if (strcmp(addr, "fw") == 0)
|
|
||||||
a.addr.data[0] = 3;
|
|
||||||
else if (strcmp(addr, "tcpdiag") == 0)
|
|
||||||
a.addr.data[0] = 4;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue