netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next iproute2 0/2] Add support for operating raw sockest via diag interface
@ 2016-10-26 19:30 Cyrill Gorcunov
  2016-10-26 19:30 ` [RFC net-next iproute2 1/2] libnetlink: Add test for error code returned from netlink reply Cyrill Gorcunov
  2016-10-26 19:30 ` [RFC net-next iproute2 2/2] ss: Add inet raw sockets information gathering via netlink diag interface Cyrill Gorcunov
  0 siblings, 2 replies; 6+ messages in thread
From: Cyrill Gorcunov @ 2016-10-26 19:30 UTC (permalink / raw)
  To: netdev
  Cc: Stephen Hemminger, Eric Dumazet, David Ahern, Andrey Vagin,
	Cyrill Gorcunov

The diag interface for raw sockets is now in linux-net-next
http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=432490f9d455fb842d70219f22d9d2c812371676
so here is early patches for misc/ss

While "showing" action works as expected, I see some weird effects on
"kill" socket actions. In particular I've a test program which binds
sockets to veth interface

	# ip link add dev vm1 type veth peer name vm2

        setsockopt(sk, SOL_SOCKET, SO_BINDTODEVICE, "vm1", 3);
        setsockopt(sk6, SOL_SOCKET, SO_BINDTODEVICE, "vm1", 3);
        setsockopt(skc, SOL_SOCKET, SO_BINDTODEVICE, "vm1", 3);
        setsockopt(sk6, SOL_SOCKET, SO_BINDTODEVICE, "vm1", 3);
        setsockopt(skicmp, SOL_SOCKET, SO_BINDTODEVICE, "vm1", 3);

so the output shows

[root@pcs7 iproute2]# ./misc/ss -A raw
State      Recv-Q Send-Q                                Local Address:Port                                                 Peer Address:Port                
UNCONN     0      0                                             *%vm1:icmp                                                            *:*                    
UNCONN     0      0                                                 *:ipproto-255                                                     *:*                    
UNCONN     0      0                                             *%vm1:ipproto-255                                                     *:*                    
UNCONN     0      0                                    127.0.0.10%vm1:ipproto-255                                                     *:*                    
UNCONN     0      0                                                :::ipv6-icmp                                                      :::*                    
UNCONN     0      0                                                :::ipv6-icmp                                                      :::*                    
ESTAB      0      0                                               ::1:ipproto-255                                                   ::1:ipproto-9091         
UNCONN     0      0                                           ::1%vm1:ipproto-255                                                    :::*                    
[root@pcs7 iproute2]# 

But when I start killing sockets

[root@pcs7 iproute2]# ./misc/ss -aKw 'dev == vm1'
State      Recv-Q Send-Q                                Local Address:Port                                                 Peer Address:Port                
UNCONN     0      0                                             *%vm1:ipproto-255                                                     *:*                    
UNCONN     0      0                                    127.0.0.10%vm1:ipproto-255                                                     *:*                    
UNCONN     0      0                                           ::1%vm1:ipproto-255                                                    :::*                    
[root@pcs7 iproute2]# 
[root@pcs7 iproute2]# ./misc/ss -aKw 'dev == vm1'
State      Recv-Q Send-Q                                Local Address:Port                                                 Peer Address:Port                
UNCONN     0      0                                    127.0.0.10%vm1:ipproto-255                                                     *:*                    
[root@pcs7 iproute2]# ./misc/ss -aKw 'dev == vm1'
State      Recv-Q Send-Q                                Local Address:Port                                                 Peer Address:Port                
UNCONN     0      0                                             *%vm1:icmp                                                            *:*                    
[root@pcs7 iproute2]# ./misc/ss -aKw 'dev == vm1'
State      Recv-Q Send-Q                                Local Address:Port                                                 Peer Address:Port                
[root@pcs7 iproute2]# 

It doesn't do all this in one pass, so I suspect I miss something in second patch?
Please take a look, once time permit.

Cyrill Gorcunov (2):
  libnetlink: Add test for error code returned from netlink reply
  ss: Add inet raw sockets information gathering via netlink diag
    interface

 include/linux/inet_diag.h | 15 +++++++++++++++
 lib/libnetlink.c          | 21 +++++++++++++++++++++
 misc/ss.c                 | 20 ++++++++++++++++++--
 3 files changed, 54 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-27 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 19:30 [RFC net-next iproute2 0/2] Add support for operating raw sockest via diag interface Cyrill Gorcunov
2016-10-26 19:30 ` [RFC net-next iproute2 1/2] libnetlink: Add test for error code returned from netlink reply Cyrill Gorcunov
2016-10-27  3:52   ` Stephen Hemminger
2016-10-27  6:52     ` Cyrill Gorcunov
2016-10-27  8:24       ` Cyrill Gorcunov
2016-10-26 19:30 ` [RFC net-next iproute2 2/2] ss: Add inet raw sockets information gathering via netlink diag interface Cyrill Gorcunov

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).