From: Pavel Emelyanov Date: Fri, 30 Dec 2011 00:53:32 +0000 (+0000) Subject: inet_diag: Add the SKMEMINFO extension X-Git-Tag: MMI-PSA29.97-13-9~17755^2~72 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0636faa539ec4205ec50e80844a5b0454b4bbaa;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git inet_diag: Add the SKMEMINFO extension Signed-off-by: Pavel Emelyanov Signed-off-by: David S. Miller --- diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index afa5d5c74169..34e8d52c1925 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h @@ -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 */ diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index fb2e47ff59f7..2240a8e8c44d 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -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;