Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278543
b: refs/heads/master
c: 476f7db
h: refs/heads/master
i:
  278541: 4ed741a
  278539: cc9b737
  278535: b021a41
  278527: 60182f3
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Dec 9, 2011
1 parent 816009c commit 8c3f7ad
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 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: b005ab4ef8805dc4604848c9d2ccca9d71f8fc46
refs/heads/master: 476f7dbff30a7c122899d753c9119d9233928380
38 changes: 22 additions & 16 deletions trunk/net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,25 +258,14 @@ int inet_diag_check_cookie(struct sock *sk, struct inet_diag_req *req)
}
EXPORT_SYMBOL_GPL(inet_diag_check_cookie);

static int inet_diag_get_exact(struct sk_buff *in_skb,
const struct nlmsghdr *nlh,
struct inet_diag_req *req)
static int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_skb,
const struct nlmsghdr *nlh, struct inet_diag_req *req)
{
int err;
struct sock *sk;
struct sk_buff *rep;
struct inet_hashinfo *hashinfo;
const struct inet_diag_handler *handler;

handler = inet_diag_lock_handler(req->sdiag_protocol);
if (IS_ERR(handler)) {
err = PTR_ERR(handler);
goto unlock;
}

hashinfo = handler->idiag_hashinfo;
err = -EINVAL;

if (req->sdiag_family == AF_INET) {
sk = inet_lookup(&init_net, hashinfo, req->id.idiag_dst[0],
req->id.idiag_dport, req->id.idiag_src[0],
Expand All @@ -293,12 +282,12 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
}
#endif
else {
goto unlock;
goto out_nosk;
}

err = -ENOENT;
if (sk == NULL)
goto unlock;
goto out_nosk;

err = inet_diag_check_cookie(sk, req);
if (err)
Expand Down Expand Up @@ -332,8 +321,25 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
else
sock_put(sk);
}
unlock:
out_nosk:
return err;
}

static int inet_diag_get_exact(struct sk_buff *in_skb,
const struct nlmsghdr *nlh,
struct inet_diag_req *req)
{
const struct inet_diag_handler *handler;
int err;

handler = inet_diag_lock_handler(req->sdiag_protocol);
if (IS_ERR(handler))
err = PTR_ERR(handler);
else
err = inet_diag_dump_one_icsk(handler->idiag_hashinfo,
in_skb, nlh, req);
inet_diag_unlock_handler(handler);

return err;
}

Expand Down

0 comments on commit 8c3f7ad

Please sign in to comment.