aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-12 19:44:09 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-12 22:58:13 -0400
commitd4f06873b636519cedbe8d2eeae77c713c6a121c (patch)
tree7025fa2ff2b8cf9e701de46ce7c71a1553f1a19a /net/ipv4/inet_diag.c
parent41b822c59e21414d829bcfd00df0c8f7f13b1b95 (diff)
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.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,
718 const struct nlmsghdr *unlh) 718 const struct nlmsghdr *unlh)
719{ 719{
720 const struct inet_request_sock *ireq = inet_rsk(req); 720 const struct inet_request_sock *ireq = inet_rsk(req);
721 struct inet_sock *inet = inet_sk(sk);
722 struct inet_diag_msg *r; 721 struct inet_diag_msg *r;
723 struct nlmsghdr *nlh; 722 struct nlmsghdr *nlh;
724 long tmo; 723 long tmo;
@@ -744,7 +743,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
744 if (tmo < 0) 743 if (tmo < 0)
745 tmo = 0; 744 tmo = 0;
746 745
747 r->id.idiag_sport = inet->inet_sport; 746 r->id.idiag_sport = htons(ireq->ir_num);
748 r->id.idiag_dport = ireq->ir_rmt_port; 747 r->id.idiag_dport = ireq->ir_rmt_port;
749 748
750 memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src)); 749 memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));