diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-01-28 15:08:26 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-30 00:44:06 -0800 |
commit | 8889394df2aaf39aa4378fc87af300e9e813c729 (patch) | |
tree | eb2162abd6573049035d11db8cbc6e782e0da748 /net/sctp | |
parent | 7adb5ed5eec39fd829020b2568352e2745a05a50 (diff) | |
download | linux-8889394df2aaf39aa4378fc87af300e9e813c729.tar.bz2 |
sctp: use SCTP_FUTURE_ASSOC for SCTP_ASSOCINFO sockopt
Check with SCTP_FUTURE_ASSOC instead in
sctp_set/getsockopt_associnfo, it's compatible with 0.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/socket.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 48d6be8b198a..e505e189bcef 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3208,7 +3208,8 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, unsig asoc = sctp_id2assoc(sk, assocparams.sasoc_assoc_id); - if (!asoc && assocparams.sasoc_assoc_id && sctp_style(sk, UDP)) + if (!asoc && assocparams.sasoc_assoc_id != SCTP_FUTURE_ASSOC && + sctp_style(sk, UDP)) return -EINVAL; /* Set the values to the specific association */ @@ -6357,7 +6358,8 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, asoc = sctp_id2assoc(sk, assocparams.sasoc_assoc_id); - if (!asoc && assocparams.sasoc_assoc_id && sctp_style(sk, UDP)) + if (!asoc && assocparams.sasoc_assoc_id != SCTP_FUTURE_ASSOC && + sctp_style(sk, UDP)) return -EINVAL; /* Values correspoinding to the specific association */ |