aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2011-12-09 01:21:16 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-09 14:14:07 -0500
commit7b35eadd7eee2e0b42421ce3efbc30f1c3c745e5 (patch)
tree068ff7b5ba08d957978a63fedad6c2d86af48ed2 /net/ipv4/inet_diag.c
parenta73ed26bbae7327370c5bd298f07de78df9e3466 (diff)
inet_diag: Remove indirect sizeof from inet diag handlers
There's an info_size value stored on inet_diag_handler, but for existing code this value is effectively constant, so just use sizeof(struct tcp_info) where required. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index b56b7ba8beeb..a247f85571c4 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -98,8 +98,7 @@ static int inet_csk_diag_fill(struct sock *sk,
98 minfo = INET_DIAG_PUT(skb, INET_DIAG_MEMINFO, sizeof(*minfo)); 98 minfo = INET_DIAG_PUT(skb, INET_DIAG_MEMINFO, sizeof(*minfo));
99 99
100 if (ext & (1 << (INET_DIAG_INFO - 1))) 100 if (ext & (1 << (INET_DIAG_INFO - 1)))
101 info = INET_DIAG_PUT(skb, INET_DIAG_INFO, 101 info = INET_DIAG_PUT(skb, INET_DIAG_INFO, sizeof(struct tcp_info));
102 handler->idiag_info_size);
103 102
104 if ((ext & (1 << (INET_DIAG_CONG - 1))) && icsk->icsk_ca_ops) { 103 if ((ext & (1 << (INET_DIAG_CONG - 1))) && icsk->icsk_ca_ops) {
105 const size_t len = strlen(icsk->icsk_ca_ops->name); 104 const size_t len = strlen(icsk->icsk_ca_ops->name);
@@ -299,7 +298,7 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
299 err = -ENOMEM; 298 err = -ENOMEM;
300 rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) + 299 rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) +
301 sizeof(struct inet_diag_meminfo) + 300 sizeof(struct inet_diag_meminfo) +
302 handler->idiag_info_size + 64)), 301 sizeof(struct tcp_info) + 64)),
303 GFP_KERNEL); 302 GFP_KERNEL);
304 if (!rep) 303 if (!rep)
305 goto out; 304 goto out;