mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
sctp: get netns from asoc and ep base
Commit 312434617c
("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>
This commit is contained in:
parent
26c97a2d82
commit
4e7696d90b
14 changed files with 49 additions and 62 deletions
|
@ -241,9 +241,8 @@ out:
|
|||
if (!first_frag)
|
||||
return NULL;
|
||||
|
||||
retval = sctp_make_reassembled_event(sock_net(ulpq->asoc->base.sk),
|
||||
&ulpq->reasm, first_frag,
|
||||
last_frag);
|
||||
retval = sctp_make_reassembled_event(ulpq->asoc->base.net, &ulpq->reasm,
|
||||
first_frag, last_frag);
|
||||
if (retval) {
|
||||
sin->fsn = next_fsn;
|
||||
if (is_last) {
|
||||
|
@ -326,7 +325,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_reassembled(
|
|||
|
||||
pd_point = sctp_sk(asoc->base.sk)->pd_point;
|
||||
if (pd_point && pd_point <= pd_len) {
|
||||
retval = sctp_make_reassembled_event(sock_net(asoc->base.sk),
|
||||
retval = sctp_make_reassembled_event(asoc->base.net,
|
||||
&ulpq->reasm,
|
||||
pd_first, pd_last);
|
||||
if (retval) {
|
||||
|
@ -337,8 +336,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_reassembled(
|
|||
goto out;
|
||||
|
||||
found:
|
||||
retval = sctp_make_reassembled_event(sock_net(asoc->base.sk),
|
||||
&ulpq->reasm,
|
||||
retval = sctp_make_reassembled_event(asoc->base.net, &ulpq->reasm,
|
||||
first_frag, pos);
|
||||
if (retval)
|
||||
retval->msg_flags |= MSG_EOR;
|
||||
|
@ -630,7 +628,7 @@ out:
|
|||
if (!first_frag)
|
||||
return NULL;
|
||||
|
||||
retval = sctp_make_reassembled_event(sock_net(ulpq->asoc->base.sk),
|
||||
retval = sctp_make_reassembled_event(ulpq->asoc->base.net,
|
||||
&ulpq->reasm_uo, first_frag,
|
||||
last_frag);
|
||||
if (retval) {
|
||||
|
@ -716,7 +714,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_reassembled_uo(
|
|||
|
||||
pd_point = sctp_sk(asoc->base.sk)->pd_point;
|
||||
if (pd_point && pd_point <= pd_len) {
|
||||
retval = sctp_make_reassembled_event(sock_net(asoc->base.sk),
|
||||
retval = sctp_make_reassembled_event(asoc->base.net,
|
||||
&ulpq->reasm_uo,
|
||||
pd_first, pd_last);
|
||||
if (retval) {
|
||||
|
@ -727,8 +725,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_reassembled_uo(
|
|||
goto out;
|
||||
|
||||
found:
|
||||
retval = sctp_make_reassembled_event(sock_net(asoc->base.sk),
|
||||
&ulpq->reasm_uo,
|
||||
retval = sctp_make_reassembled_event(asoc->base.net, &ulpq->reasm_uo,
|
||||
first_frag, pos);
|
||||
if (retval)
|
||||
retval->msg_flags |= MSG_EOR;
|
||||
|
@ -814,7 +811,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_first_uo(struct sctp_ulpq *ulpq)
|
|||
return NULL;
|
||||
|
||||
out:
|
||||
retval = sctp_make_reassembled_event(sock_net(ulpq->asoc->base.sk),
|
||||
retval = sctp_make_reassembled_event(ulpq->asoc->base.net,
|
||||
&ulpq->reasm_uo, first_frag,
|
||||
last_frag);
|
||||
if (retval) {
|
||||
|
@ -921,7 +918,7 @@ static struct sctp_ulpevent *sctp_intl_retrieve_first(struct sctp_ulpq *ulpq)
|
|||
return NULL;
|
||||
|
||||
out:
|
||||
retval = sctp_make_reassembled_event(sock_net(ulpq->asoc->base.sk),
|
||||
retval = sctp_make_reassembled_event(ulpq->asoc->base.net,
|
||||
&ulpq->reasm, first_frag,
|
||||
last_frag);
|
||||
if (retval) {
|
||||
|
@ -1159,7 +1156,7 @@ static void sctp_generate_iftsn(struct sctp_outq *q, __u32 ctsn)
|
|||
|
||||
if (ftsn_chunk) {
|
||||
list_add_tail(&ftsn_chunk->list, &q->control_chunk_list);
|
||||
SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_OUTCTRLCHUNKS);
|
||||
SCTP_INC_STATS(asoc->base.net, SCTP_MIB_OUTCTRLCHUNKS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue