Skip to content

Commit 38687b5

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: allow unsetting sockopt MAXSEG
RFC 6458 Section 8.1.16 says that setting MAXSEG as 0 means that the user is not limiting it, and not that it should set to the *current* maximum, as we are doing. This patch thus allow setting it as 0, effectively removing the user limit. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 439ef03 commit 38687b5

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

net/sctp/socket.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,7 +3211,6 @@ static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, unsign
32113211
static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned int optlen)
32123212
{
32133213
struct sctp_sock *sp = sctp_sk(sk);
3214-
struct sctp_af *af = sp->pf->af;
32153214
struct sctp_assoc_value params;
32163215
struct sctp_association *asoc;
32173216
int val;
@@ -3249,12 +3248,6 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned
32493248
}
32503249

32513250
if (asoc) {
3252-
if (val == 0) {
3253-
val = asoc->pathmtu - af->net_header_len;
3254-
val -= af->ip_options_len(sk);
3255-
val -= sizeof(struct sctphdr) +
3256-
sctp_datachk_len(&asoc->stream);
3257-
}
32583251
asoc->user_frag = val;
32593252
sctp_assoc_update_frag_point(asoc);
32603253
} else {

0 commit comments

Comments
 (0)