diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-12-09 13:45:18 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-09 20:14:01 -0800 |
commit | 4e7696d90b51a1a73ce0e8174f3aff58b914619c (patch) | |
tree | f70df63734043ccdfbba56fde42084fa8fb1b19a /net/sctp/transport.c | |
parent | 26c97a2d82c41938c3053d9ec27cdbcd8e34fb8b (diff) |
sctp: get netns from asoc and ep base
Commit 312434617cb1 ("sctp: cache netns in sctp_ep_common") set netns
in asoc and ep base since they're created, and it will never change.
It's a better way to get netns from asoc and ep base, comparing to
calling sock_net().
This patch is to replace them.
v1->v2:
- no change.
Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r-- | net/sctp/transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 7235a6032671..f4de064598f8 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -334,7 +334,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt) pr_debug("%s: rto_pending not set on transport %p!\n", __func__, tp); if (tp->rttvar || tp->srtt) { - struct net *net = sock_net(tp->asoc->base.sk); + struct net *net = tp->asoc->base.net; /* 6.3.1 C3) When a new RTT measurement R' is made, set * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' |