summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIvan Skytte Jorgensen <isj-sctp@i1.dk>2005-10-28 15:36:12 -0700
committerSridhar Samudrala <sri@us.ibm.com>2005-10-28 15:36:12 -0700
commit96a339985d4c6874d32909e8f1903e6e6c141399 (patch)
treed3eb8006efa5e03bb0ef875bf8dc2ed1d90ecb21 /net
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>
Diffstat (limited to 'net')
-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 c66c161908c..97b556c1c45 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
return -EINVAL;
if (get_user(val, (int __user *)optval))
return -EFAULT;
- if ((val < 8) || (val > SCTP_MAX_CHUNK_LEN))
+ if ((val != 0) && ((val < 8) || (val > SCTP_MAX_CHUNK_LEN)))
return -EINVAL;
sp->user_frag = val;
- if (val) {
- /* Update the frag_point of the existing associations. */
- list_for_each(pos, &(sp->ep->asocs)) {
- asoc = list_entry(pos, struct sctp_association, asocs);
- asoc->frag_point = sctp_frag_point(sp, asoc->pmtu);
- }
+ /* Update the frag_point of the existing associations. */
+ list_for_each(pos, &(sp->ep->asocs)) {
+ asoc = list_entry(pos, struct sctp_association, asocs);
+ asoc->frag_point = sctp_frag_point(sp, asoc->pmtu);
}
return 0;