]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND
authorLaszlo Toth <laszlth@gmail.com>
Mon, 23 Oct 2017 17:19:33 +0000 (19:19 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:40:06 +0000 (11:40 +0100)
commit07f8d4524ce4a43f392af6429857f65ff418c031
tree44b5e90b8ac314567b91e873784995fe8e68af33
parentd1e162ecec1171e4ae961d976931a4c5145aa6cf
sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND

BugLink: http://bugs.launchpad.net/bugs/1744121
[ Upstream commit b71d21c274eff20a9db8158882b545b141b73ab8 ]

Commit 9b9742022888 ("sctp: support ipv6 nonlocal bind")
introduced support for the above options as v4 sctp did,
so patched sctp_v6_available().

In the v4 implementation it's enough, because
sctp_inet_bind_verify() just returns with sctp_v4_available().
However sctp_inet6_bind_verify() has an extra check before that
for link-local scope_id, which won't respect the above options.

Added the checks before calling ipv6_chk_addr(), but
not before the validation of scope_id.

before (w/ both options):
 ./v6test fe80::10 sctp
 bind failed, errno: 99 (Cannot assign requested address)
 ./v6test fe80::10 tcp
 bind success, errno: 0 (Success)

after (w/ both options):
 ./v6test fe80::10 sctp
 bind success, errno: 0 (Success)

Signed-off-by: Laszlo Toth <laszlth@gmail.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/sctp/ipv6.c