* [PATCH iproute2] ss: Use nl_proto_a2n for filtering by netlink proto
@ 2014-12-06 0:52 Vadim Kochan
2014-12-10 4:40 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Vadim Kochan @ 2014-12-06 0:52 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
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(-)
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;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] ss: Use nl_proto_a2n for filtering by netlink proto
2014-12-06 0:52 [PATCH iproute2] ss: Use nl_proto_a2n for filtering by netlink proto Vadim Kochan
@ 2014-12-10 4:40 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2014-12-10 4:40 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-10 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-06 0:52 [PATCH iproute2] ss: Use nl_proto_a2n for filtering by netlink proto Vadim Kochan
2014-12-10 4:40 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).