Skip to content

Commit c0636fa

Browse files
xemuldavem330
authored andcommitted
inet_diag: Add the SKMEMINFO extension
Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5d2e5f2 commit c0636fa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/linux/inet_diag.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ enum {
108108
INET_DIAG_CONG,
109109
INET_DIAG_TOS,
110110
INET_DIAG_TCLASS,
111+
INET_DIAG_SKMEMINFO,
111112
};
112113

113-
#define INET_DIAG_MAX INET_DIAG_TCLASS
114+
#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
114115

115116

116117
/* INET_DIAG_MEM */

net/ipv4/inet_diag.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
136136
minfo->idiag_tmem = sk_wmem_alloc_get(sk);
137137
}
138138

139+
if (ext & (1 << (INET_DIAG_SKMEMINFO - 1)))
140+
if (sock_diag_put_meminfo(sk, skb, INET_DIAG_SKMEMINFO))
141+
goto rtattr_failure;
142+
139143
if (icsk == NULL) {
140144
r->idiag_rqueue = r->idiag_wqueue = 0;
141145
goto out;

0 commit comments

Comments
 (0)