Skip to content

Commit

Permalink
diag: warn about missing first netlink attribute
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Nov 28, 2013
1 parent 2c7a9dc commit 31e20ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/netlink_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct netlink_diag_ring {
};

enum {
/* NETLINK_DIAG_NONE, standard nl API requires this attribute! */
NETLINK_DIAG_MEMINFO,
NETLINK_DIAG_GROUPS,
NETLINK_DIAG_RX_RING,
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/packet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct packet_diag_msg {
};

enum {
/* PACKET_DIAG_NONE, standard nl API requires this attribute! */
PACKET_DIAG_INFO,
PACKET_DIAG_MCLIST,
PACKET_DIAG_RX_RING,
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/unix_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct unix_diag_msg {
};

enum {
/* UNIX_DIAG_NONE, standard nl API requires this attribute! */
UNIX_DIAG_NAME,
UNIX_DIAG_VFS,
UNIX_DIAG_PEER,
Expand Down

0 comments on commit 31e20ba

Please sign in to comment.