aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Skytte Jorgensen <isj-sctp@i1.dk>2005-10-28 18:36:12 -0400
committerSridhar Samudrala <sri@us.ibm.com>2005-10-28 18:36:12 -0400
commit96a339985d4c6874d32909e8f1903e6e6c141399 (patch)
treed3eb8006efa5e03bb0ef875bf8dc2ed1d90ecb21
parenta1ab3582699def352dab1355adcadd3d47f79f0f (diff)
[SCTP] Allow SCTP_MAXSEG to revert to default frag point with a '0' value.
Signed-off-by: Ivan Skytte Jorgensen <isj-sctp@i1.dk> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
-rw-r--r--net/sctp/socket.c12
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;