diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-13 02:44:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-13 05:58:13 +0300 |
commit | d4f06873b636519cedbe8d2eeae77c713c6a121c (patch) | |
tree | 7025fa2ff2b8cf9e701de46ce7c71a1553f1a19a /net/ipv4/inet_diag.c | |
parent | 41b822c59e21414d829bcfd00df0c8f7f13b1b95 (diff) | |
download | linux-d4f06873b636519cedbe8d2eeae77c713c6a121c.tar.xz |
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 'net/ipv4/inet_diag.c')
-rw-r--r-- | net/ipv4/inet_diag.c | 3 |
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)); |