summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2018-04-26 15:59:02 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-27 14:35:24 -0400
commit38687b56c51b535024d46d6b5375163a6a40a196 (patch)
tree56ef91a153676cf598653f135975fabb58694018 /net/sctp
parent439ef0309cf4b743d76edc2abeca72b27ee1d996 (diff)
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>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 2d35c8ea2470..1b4593b842b0 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3211,7 +3211,6 @@ static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, unsign
3211static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned int optlen) 3211static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned int optlen)
3212{ 3212{
3213 struct sctp_sock *sp = sctp_sk(sk); 3213 struct sctp_sock *sp = sctp_sk(sk);
3214 struct sctp_af *af = sp->pf->af;
3215 struct sctp_assoc_value params; 3214 struct sctp_assoc_value params;
3216 struct sctp_association *asoc; 3215 struct sctp_association *asoc;
3217 int val; 3216 int val;
@@ -3249,12 +3248,6 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned
3249 } 3248 }
3250 3249
3251 if (asoc) { 3250 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 }
3258 asoc->user_frag = val; 3251 asoc->user_frag = val;
3259 sctp_assoc_update_frag_point(asoc); 3252 sctp_assoc_update_frag_point(asoc);
3260 } else { 3253 } else {