Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

diag: warn about missing first netlink attribute

The first netlink attribute (value 0) must always be defined as none/unspec.
This is correctly done in inet_diag.h, but other diag interfaces are wrong.

Because we cannot change an existing API, I add a comment to point the mistake
and avoid to propagate it in a new diag API in the future.

CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nicolas Dichtel and committed by
David S. Miller
31e20bad 2c7a9dc1

+3
+1
include/uapi/linux/packet_diag.h
··· 29 29 }; 30 30 31 31 enum { 32 + /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ 32 33 PACKET_DIAG_INFO, 33 34 PACKET_DIAG_MCLIST, 34 35 PACKET_DIAG_RX_RING,
+1
include/uapi/linux/unix_diag.h
··· 31 31 }; 32 32 33 33 enum { 34 + /* UNIX_DIAG_NONE, standard nl API requires this attribute! */ 34 35 UNIX_DIAG_NAME, 35 36 UNIX_DIAG_VFS, 36 37 UNIX_DIAG_PEER,