Message ID | 1417827139-10241-1-git-send-email-vadim4j@gmail.com |
---|---|
State | Accepted, archived |
Delegated to: | stephen hemminger |
Headers | show |
On Sat, 6 Dec 2014 02:52:19 +0200 Vadim Kochan <vadim4j@gmail.com> wrote: > 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> Applied -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/misc/ss.c b/misc/ss.c index a99294d..b9dbfd6 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1231,16 +1231,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; }
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> --- misc/ss.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)