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>
This commit is contained in:
parent
7b35eadd7e
commit
87c22ea52e
|
@ -355,9 +355,12 @@ static int bitstring_match(const __be32 *a1, const __be32 *a2, int bits)
|
|||
}
|
||||
|
||||
|
||||
static int inet_diag_bc_run(const void *bc, int len,
|
||||
static int inet_diag_bc_run(const struct nlattr *_bc,
|
||||
const struct inet_diag_entry *entry)
|
||||
{
|
||||
const void *bc = nla_data(_bc);
|
||||
int len = nla_len(_bc);
|
||||
|
||||
while (len > 0) {
|
||||
int yes = 1;
|
||||
const struct inet_diag_bc_op *op = bc;
|
||||
|
@ -512,7 +515,7 @@ static int inet_csk_diag_dump(struct sock *sk,
|
|||
entry.dport = ntohs(inet->inet_dport);
|
||||
entry.userlocks = sk->sk_userlocks;
|
||||
|
||||
if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry))
|
||||
if (!inet_diag_bc_run(bc, &entry))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -547,7 +550,7 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw,
|
|||
entry.dport = ntohs(tw->tw_dport);
|
||||
entry.userlocks = 0;
|
||||
|
||||
if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry))
|
||||
if (!inet_diag_bc_run(bc, &entry))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -668,8 +671,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
|
|||
&ireq->rmt_addr;
|
||||
entry.dport = ntohs(ireq->rmt_port);
|
||||
|
||||
if (!inet_diag_bc_run(nla_data(bc),
|
||||
nla_len(bc), &entry))
|
||||
if (!inet_diag_bc_run(bc, &entry))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue