aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-12 16:44:09 -0700
committerDavid S. Miller <davem@davemloft.net>2015-03-12 22:58:13 -0400
commitd4f06873b636519cedbe8d2eeae77c713c6a121c (patch)
tree7025fa2ff2b8cf9e701de46ce7c71a1553f1a19a /net/ipv4/inet_diag.c
parentinet: prepare sock_edemux() & sock_gen_put() for new SYN_RECV state (diff)
downloadlinux-dev-d4f06873b636519cedbe8d2eeae77c713c6a121c.tar.xz
linux-dev-d4f06873b636519cedbe8d2eeae77c713c6a121c.zip
inet: get_openreq4() & get_openreq6() do not need listener
ireq->ir_num contains local port, use it. Also, get_openreq4() dumping listen_sk->refcnt makes litle sense. inet_diag_fill_req() can also use ireq->ir_num Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/inet_diag.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 29317ff4a007..c55a6fa3162d 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -718,7 +718,6 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
const struct nlmsghdr *unlh)
{
const struct inet_request_sock *ireq = inet_rsk(req);
- struct inet_sock *inet = inet_sk(sk);
struct inet_diag_msg *r;
struct nlmsghdr *nlh;
long tmo;
@@ -744,7 +743,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
if (tmo < 0)
tmo = 0;
- r->id.idiag_sport = inet->inet_sport;
+ r->id.idiag_sport = htons(ireq->ir_num);
r->id.idiag_dport = ireq->ir_rmt_port;
memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));