Skip to content

Commit 63d0133

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: honor PMTU_DISABLED when handling icmp
sctp_sendmsg() could trigger PMTU updates even when PMTU_DISABLED was set, as pmtu_pending could be set unconditionally during icmp handling if the socket was in use by the application. This patch fixes it by checking for PMTU_DISABLED when handling such deferred updates. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6e91b57 commit 63d0133

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/sctp/socket.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,7 @@ static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
18931893
struct sctp_sndrcvinfo *sinfo)
18941894
{
18951895
struct sock *sk = asoc->base.sk;
1896+
struct sctp_sock *sp = sctp_sk(sk);
18961897
struct net *net = sock_net(sk);
18971898
struct sctp_datamsg *datamsg;
18981899
bool wait_connect = false;
@@ -1911,13 +1912,14 @@ static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
19111912
goto err;
19121913
}
19131914

1914-
if (sctp_sk(sk)->disable_fragments && msg_len > asoc->frag_point) {
1915+
if (sp->disable_fragments && msg_len > asoc->frag_point) {
19151916
err = -EMSGSIZE;
19161917
goto err;
19171918
}
19181919

19191920
if (asoc->pmtu_pending) {
1920-
sctp_assoc_sync_pmtu(asoc);
1921+
if (sp->param_flags & SPP_PMTUD_ENABLE)
1922+
sctp_assoc_sync_pmtu(asoc);
19211923
asoc->pmtu_pending = 0;
19221924
}
19231925

@@ -1936,7 +1938,7 @@ static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
19361938
if (err)
19371939
goto err;
19381940

1939-
if (sctp_sk(sk)->strm_interleave) {
1941+
if (sp->strm_interleave) {
19401942
timeo = sock_sndtimeo(sk, 0);
19411943
err = sctp_wait_for_connect(asoc, &timeo);
19421944
if (err)

0 commit comments

Comments
 (0)