inet_diag: Add the SKMEMINFO extension
authorPavel Emelyanov <xemul@parallels.com>
Fri, 30 Dec 2011 00:53:32 +0000 (00:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Dec 2011 21:42:19 +0000 (16:42 -0500)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/inet_diag.h
net/ipv4/inet_diag.c

index afa5d5c741695c9f4d0a794a9c90c9cf93f6ce0d..34e8d52c192509ec3908bd74376410f7170a8628 100644 (file)
@@ -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 */
index fb2e47ff59f70d94eb6f1bd778fa2958f6061b28..2240a8e8c44dbefaed2a83aa44b6e058970fc65b 100644 (file)
@@ -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;