]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 09:39:46 +0000 (18:39 +0900)
commitaddbc8187bb97abb1c06d668da9a98c81b721e7a
treef7d971befcbcd25e8caa88611b20fc4b2a237c1d
parent38958b2938d5536568d334fce2918f552174ef15
sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND

Commit b2fe6a55028d ("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>
net/sctp/ipv6.c