Commit 96a33998 authored by Ivan Skytte Jorgensen's avatar Ivan Skytte Jorgensen Committed by Sridhar Samudrala

[SCTP] Allow SCTP_MAXSEG to revert to default frag point with a '0' value.

Signed-off-by: default avatarIvan Skytte Jorgensen <isj-sctp@i1.dk>
Signed-off-by: default avatarSridhar Samudrala <sri@us.ibm.com>
parent a1ab3582
...@@ -2306,17 +2306,15 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl ...@@ -2306,17 +2306,15 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl
return -EINVAL; return -EINVAL;
if (get_user(val, (int __user *)optval)) if (get_user(val, (int __user *)optval))
return -EFAULT; return -EFAULT;
if ((val < 8) || (val > SCTP_MAX_CHUNK_LEN)) if ((val != 0) && ((val < 8) || (val > SCTP_MAX_CHUNK_LEN)))
return -EINVAL; return -EINVAL;
sp->user_frag = val; sp->user_frag = val;
if (val) {
/* Update the frag_point of the existing associations. */ /* Update the frag_point of the existing associations. */
list_for_each(pos, &(sp->ep->asocs)) { list_for_each(pos, &(sp->ep->asocs)) {
asoc = list_entry(pos, struct sctp_association, asocs); asoc = list_entry(pos, struct sctp_association, asocs);
asoc->frag_point = sctp_frag_point(sp, asoc->pmtu); asoc->frag_point = sctp_frag_point(sp, asoc->pmtu);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment