Return error to userspace in __sctp_connect when inconsistent ports are used
Subsystems (2)
PATCH 1/1 Return error to userspace in __sctp_connect when inconsistent ports are used
Hi Vlad,
just as we similarly do in sctp_do_bind() we should return EINVAL when sctp_connectx is called with multiple addresses but different ports.
Issue first mentioned with patch in sourceforge #3323780
regards,
Michele
Tested-by Michele Baldessari <[email protected]>
--- net/sctp/socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/sctp/socket.c +4 -2
@@ -1110,10 +1110,12 @@ static int __sctp_connect(struct sock* sk, goto out_free;/* Make sure the destination port is correctly set -* in all addresses. +* in all addresses and return EINVAL otherwise */ -if (asoc && asoc->peer.port && asoc->peer.port != port) +if (asoc && asoc->peer.port && asoc->peer.port != port) { + err = -EINVAL ; goto out_free; + }/* Check if there already is a matching association on the
Signature · 1 line
1.7.9.3