Skip to content

Implement dumping udp sockets via sock_diag netlink

Pavel Emelyanov netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13inet_diag: Remove indirect sizeof from inet diag handlersinclude/linux/inet_diag.h net/dccp/diag.c net/ipv4/inet_diag.c +1 more+2 -60 replies
2/13inet_diag: Reduce the number of args for bytecode run routinenet/ipv4/inet_diag.c+8 -60 replies
3/13inet_diag: Export inet diag cookie checking routineinclude/linux/inet_diag.h net/ipv4/inet_diag.c+16 -50 replies
4/13inet_diag: Split inet_diag_get_exact into partsnet/ipv4/inet_diag.c+22 -160 replies
5/13inet_diag: Split inet_diag_get_exact into partsnet/ipv4/inet_diag.c+16 -120 replies
6/13inet_diag: Introduce the byte-code run on an inet socketinclude/linux/inet_diag.h net/ipv4/inet_diag.c+33 -240 replies
7/13inet_diag: Introduce the inet socket dumping routineinclude/linux/inet_diag.h net/ipv4/inet_diag.c+41 -190 replies
8/13inet_diag: Generalize inet_diag dump and get_exact callsinclude/linux/inet_diag.h net/dccp/diag.c net/ipv4/inet_diag.c +1 more+51 -80 replies
9/13udp: Export code sk lookup routinesinclude/net/udp.h net/ipv4/udp.c net/ipv6/udp.c+10 -20 replies
10/13udp_diag: Basic skeletonnet/ipv4/udp_diag.c+96 -00 replies
11/13udp_diag: Implement the get_exact dumping functionalitynet/ipv4/udp_diag.c+51 -115 replies
12/13udp_diag: Implement the dump-all functionalitynet/ipv4/udp_diag.c+54 -00 replies
13/13udp_diag: Wire the udp_diag module into kbuildnet/ipv4/Kconfig net/ipv4/Makefile+5 -00 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchEric Dumazet
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13A-b
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/13] Implement dumping udp sockets via sock_diag netlink

Hi!

This is an extension of inet_diag module and the new udp_diag one. Plus the patch for iproute's ss to dump udp sockets via netlink (applies on top of previous patch for new NETLINK_SOCK_DIAG API [1]).

The overall idea is:

Patch the inet_diag module so that the protocol level handlers are called indirectly from the very beginning, not just for getting the tcp_info bits. Implement the udp_diag module that provides callbacks for IPPROTO_UDP and IPPROTO_UDPLITE protocols.

The existing inet request packet (inet_diag_req) format used to request for TCP/DCCP sockets is used for UDP socket as well, although not all the state bits matter for UDP.

When sending back the reply the existing format (inet_diag_message) is used as well. Some bits on this struct are meaningless for UDP, but I hope that setting these to 0 and wasting some space on reply skb worth the saved amount of new code on both -- the kernel side and the userspace side (i.e. ss tool). The data that is stored in an nl attribute but doesn't exist for UDP is just not provided.

[1] http://www.spinics.net/lists/netdev/msg182467.html