Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278544
b: refs/heads/master
c: efb3cb4
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Dec 9, 2011
1 parent 8c3f7ad commit dfac62a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 476f7dbff30a7c122899d753c9119d9233928380
refs/heads/master: efb3cb428dcde2356802b3f93e152efa7abc5a62
28 changes: 16 additions & 12 deletions trunk/net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,19 +709,11 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
return err;
}

static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
struct inet_diag_req *r, struct nlattr *bc)
static void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb,
struct netlink_callback *cb, struct inet_diag_req *r, struct nlattr *bc)
{
int i, num;
int s_i, s_num;
const struct inet_diag_handler *handler;
struct inet_hashinfo *hashinfo;

handler = inet_diag_lock_handler(r->sdiag_protocol);
if (IS_ERR(handler))
goto unlock;

hashinfo = handler->idiag_hashinfo;

s_i = cb->args[1];
s_num = num = cb->args[2];
Expand Down Expand Up @@ -790,7 +782,7 @@ static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
}

if (!(r->idiag_states & ~(TCPF_LISTEN | TCPF_SYN_RECV)))
goto unlock;
goto out;

for (i = s_i; i <= hashinfo->ehash_mask; i++) {
struct inet_ehash_bucket *head = &hashinfo->ehash[i];
Expand Down Expand Up @@ -863,8 +855,20 @@ static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
done:
cb->args[1] = i;
cb->args[2] = num;
unlock:
out:
;
}

static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
struct inet_diag_req *r, struct nlattr *bc)
{
const struct inet_diag_handler *handler;

handler = inet_diag_lock_handler(r->sdiag_protocol);
if (!IS_ERR(handler))
inet_diag_dump_icsk(handler->idiag_hashinfo, skb, cb, r, bc);
inet_diag_unlock_handler(handler);

return skb->len;
}

Expand Down

0 comments on commit dfac62a

Please sign in to comment.