@@ -38,7 +38,7 @@ struct inet_diag_req_v2 {
__u8 sdiag_family;
__u8 sdiag_protocol;
__u8 idiag_ext;
- __u8 pad;
+ __u8 idiag_ext2;
__u32 idiag_states;
struct inet_diag_sockid id;
};
@@ -109,6 +109,7 @@ enum {
INET_DIAG_TOS,
INET_DIAG_TCLASS,
INET_DIAG_SKMEMINFO,
+ __INET_DIAG_EXT2,
};
#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
@@ -81,6 +81,9 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
const struct inet_diag_handler *handler;
int ext = req->idiag_ext;
+ if (ext & (1 << (__INET_DIAG_EXT2 - 1)))
+ ext |= req->idiag_ext2 << __INET_DIAG_EXT2;
+
handler = inet_diag_table[req->sdiag_protocol];
BUG_ON(handler == NULL);
The inet-diag dumping request carries 8-bit ext value which denotes what additional info we want to see. Unfortunately there's only one bit left on it and occupying one with the "I want shutdown" is unwanted. However, there are 8 more bits in the request and this "pad" field is currently unused. I propose to make the 8th bit of the existing ext flag mean "this unused space contains more ext bits". Signed-off-by: Pavel Emelyanov <xemul@parallels.com> --- include/uapi/linux/inet_diag.h | 3 ++- net/ipv4/inet_diag.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletions(-)