diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/socket.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index c66c161908c0..97b556c1c450 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2306,16 +2306,14 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl | |||
2306 | return -EINVAL; | 2306 | return -EINVAL; |
2307 | if (get_user(val, (int __user *)optval)) | 2307 | if (get_user(val, (int __user *)optval)) |
2308 | return -EFAULT; | 2308 | return -EFAULT; |
2309 | if ((val < 8) || (val > SCTP_MAX_CHUNK_LEN)) | 2309 | if ((val != 0) && ((val < 8) || (val > SCTP_MAX_CHUNK_LEN))) |
2310 | return -EINVAL; | 2310 | return -EINVAL; |
2311 | sp->user_frag = val; | 2311 | sp->user_frag = val; |
2312 | 2312 | ||
2313 | if (val) { | 2313 | /* Update the frag_point of the existing associations. */ |
2314 | /* Update the frag_point of the existing associations. */ | 2314 | list_for_each(pos, &(sp->ep->asocs)) { |
2315 | list_for_each(pos, &(sp->ep->asocs)) { | 2315 | asoc = list_entry(pos, struct sctp_association, asocs); |
2316 | asoc = list_entry(pos, struct sctp_association, asocs); | 2316 | asoc->frag_point = sctp_frag_point(sp, asoc->pmtu); |
2317 | asoc->frag_point = sctp_frag_point(sp, asoc->pmtu); | ||
2318 | } | ||
2319 | } | 2317 | } |
2320 | 2318 | ||
2321 | return 0; | 2319 | return 0; |