Skip to content

Commit

Permalink
inet_diag: Add the SKMEMINFO extension
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Dec 30, 2011
1 parent 5d2e5f2 commit c0636fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/inet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0636fa

Please sign in to comment.