mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option
This commit is contained in:
parent
6026b45aab
commit
cee09bda03
1 changed files with 3 additions and 11 deletions
|
|
@ -6840,18 +6840,10 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
|||
|
||||
SCTP_CHECK_AND_CAST(value, optval, uint32_t, optsize);
|
||||
SCTP_INP_WLOCK(inp);
|
||||
if (*value == 0) {
|
||||
/*
|
||||
* Do not allow turning zero checksum
|
||||
* acceptance off again, since this could
|
||||
* result in inconsistent behaviour for
|
||||
* listeners.
|
||||
*/
|
||||
if (inp->zero_checksum > 0) {
|
||||
error = EINVAL;
|
||||
}
|
||||
} else {
|
||||
if (*value != 0) {
|
||||
inp->zero_checksum = 1;
|
||||
} else {
|
||||
inp->zero_checksum = 0;
|
||||
}
|
||||
SCTP_INP_WUNLOCK(inp);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue