]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: fix ignoring asoc_id for tcp-style sockets on SCTP_DEFAULT_SEND_PARAM sockopt
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Mon, 18 Mar 2019 12:05:59 +0000 (20:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2019 01:31:08 +0000 (18:31 -0700)
commit9e269a89bef50c527c60627d0f82e717b5210d6f
tree6f5db285282be21d2aad069fd95a5f19d10dc39e
parent478d8bc4f7c86ddb7508cbc6f5d81bfeacebf666
sctp: fix ignoring asoc_id for tcp-style sockets on SCTP_DEFAULT_SEND_PARAM sockopt

Currently if the user pass an invalid asoc_id to SCTP_DEFAULT_SEND_PARAM
on a TCP-style socket, it will silently ignore the new parameters.
That's because after not finding an asoc, it is checking asoc_id against
the known values of CURRENT/FUTURE/ALL values and that fails to match.

IOW, if the user supplies an invalid asoc id or not, it should either
match the current asoc or the socket itself so that it will inherit
these later. Fixes it by forcing asoc_id to SCTP_FUTURE_ASSOC in case it
is a TCP-style socket without an asoc, so that the values get set on the
socket.

Fixes: 627e4673e1e1 ("sctp: use SCTP_FUTURE_ASSOC and add SCTP_CURRENT_ASSOC for SCTP_DEFAULT_SEND_PARAM sockopt")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c