mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-11-01 06:46:22 +00:00
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, "*")) {
|
||||
a.addr.bitlen = 32;
|
||||
if (get_u32(a.addr.data, addr, 0)) {
|
||||
if (strcmp(addr, "rtnl") == 0)
|
||||
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;
|
||||
}
|
||||
if (nl_proto_a2n(&a.addr.data[0], addr) == -1)
|
||||
return NULL;
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user