Skip to contentSkip to conversation

inet_diag: Add the SKMEMINFO extension

PATCH In review Pavel Emelyanov 1 participant 1 message Dec 29, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/5 inet_diag: Add the SKMEMINFO extension

---
 include/linux/inet_diag.h |    3 ++-
 net/ipv4/inet_diag.c      |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)
include/linux/inet_diag.h +2 -1
index afa5d5c..34e8d52 100644
@@ -108,9 +108,10 @@ enum {
 	INET_DIAG_CONG,
 	INET_DIAG_TOS,
 	INET_DIAG_TCLASS,
+	INET_DIAG_SKMEMINFO,
 };
 
-#define INET_DIAG_MAX INET_DIAG_TCLASS
+#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
 
 
 /* INET_DIAG_MEM */
net/ipv4/inet_diag.c +4 -0
index fb2e47f..2240a8e 100644
@@ -136,6 +136,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
 		minfo->idiag_tmem = sk_wmem_alloc_get(sk);
 	}
 
+	if (ext & (1 << (INET_DIAG_SKMEMINFO - 1)))
+		if (sock_diag_put_meminfo(sk, skb, INET_DIAG_SKMEMINFO))
+			goto rtattr_failure;
+
 	if (icsk == NULL) {
 		r->idiag_rqueue = r->idiag_wqueue = 0;
 		goto out;
Signature · 1 line
1.5.5.6