diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2011-12-09 01:21:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-09 14:14:07 -0500 |
commit | 87c22ea52e1bb467f58b3e9a71509fccb70c7bd3 (patch) | |
tree | 11d1d61703fa91c84546e94f371ce2efdea2215c /net/ipv4 | |
parent | 7b35eadd7eee2e0b42421ce3efbc30f1c3c745e5 (diff) |
inet_diag: Reduce the number of args for bytecode run routine
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_diag.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index a247f85571c4..bd3f661803a7 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -355,9 +355,12 @@ static int bitstring_match(const __be32 *a1, const __be32 *a2, int bits) | |||
355 | } | 355 | } |
356 | 356 | ||
357 | 357 | ||
358 | static int inet_diag_bc_run(const void *bc, int len, | 358 | static int inet_diag_bc_run(const struct nlattr *_bc, |
359 | const struct inet_diag_entry *entry) | 359 | const struct inet_diag_entry *entry) |
360 | { | 360 | { |
361 | const void *bc = nla_data(_bc); | ||
362 | int len = nla_len(_bc); | ||
363 | |||
361 | while (len > 0) { | 364 | while (len > 0) { |
362 | int yes = 1; | 365 | int yes = 1; |
363 | const struct inet_diag_bc_op *op = bc; | 366 | const struct inet_diag_bc_op *op = bc; |
@@ -512,7 +515,7 @@ static int inet_csk_diag_dump(struct sock *sk, | |||
512 | entry.dport = ntohs(inet->inet_dport); | 515 | entry.dport = ntohs(inet->inet_dport); |
513 | entry.userlocks = sk->sk_userlocks; | 516 | entry.userlocks = sk->sk_userlocks; |
514 | 517 | ||
515 | if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry)) | 518 | if (!inet_diag_bc_run(bc, &entry)) |
516 | return 0; | 519 | return 0; |
517 | } | 520 | } |
518 | 521 | ||
@@ -547,7 +550,7 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, | |||
547 | entry.dport = ntohs(tw->tw_dport); | 550 | entry.dport = ntohs(tw->tw_dport); |
548 | entry.userlocks = 0; | 551 | entry.userlocks = 0; |
549 | 552 | ||
550 | if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry)) | 553 | if (!inet_diag_bc_run(bc, &entry)) |
551 | return 0; | 554 | return 0; |
552 | } | 555 | } |
553 | 556 | ||
@@ -668,8 +671,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, | |||
668 | &ireq->rmt_addr; | 671 | &ireq->rmt_addr; |
669 | entry.dport = ntohs(ireq->rmt_port); | 672 | entry.dport = ntohs(ireq->rmt_port); |
670 | 673 | ||
671 | if (!inet_diag_bc_run(nla_data(bc), | 674 | if (!inet_diag_bc_run(bc, &entry)) |
672 | nla_len(bc), &entry)) | ||
673 | continue; | 675 | continue; |
674 | } | 676 | } |
675 | 677 | ||