summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-08-05 16:52:13 +0000
committertuexen <tuexen@FreeBSD.org>2010-08-05 16:52:13 +0000
commit37e30c9a937a2be7af765a05a76586980c916ad7 (patch)
treee5060a012149d9109b853f169c20064b3b6d30e0
parent4b65e9a5398c1292af6eaac619f856b29421e832 (diff)
downloadFreeBSD-src-37e30c9a937a2be7af765a05a76586980c916ad7.zip
FreeBSD-src-37e30c9a937a2be7af765a05a76586980c916ad7.tar.gz
Fix a bug where endpoints bound to wildcard addresses where
using addresses not announced to the peer due to address scoping. MFC after: 3 weeks
-rw-r--r--sys/netinet/sctp_output.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 16bce28..7038067 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -2740,6 +2740,15 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
}
}
if (stcb) {
+ if (sctp_is_address_in_scope(ifa,
+ stcb->asoc.ipv4_addr_legal,
+ stcb->asoc.ipv6_addr_legal,
+ stcb->asoc.loopback_scope,
+ stcb->asoc.ipv4_local_scope,
+ stcb->asoc.local_scope,
+ stcb->asoc.site_scope, 0) == 0) {
+ continue;
+ }
if (((non_asoc_addr_ok == 0) &&
(sctp_is_addr_restricted(stcb, sifa))) ||
(non_asoc_addr_ok &&
@@ -2783,6 +2792,15 @@ sctp_count_num_preferred_boundall(struct sctp_ifn *ifn,
continue;
}
if (stcb) {
+ if (sctp_is_address_in_scope(ifa,
+ stcb->asoc.ipv4_addr_legal,
+ stcb->asoc.ipv6_addr_legal,
+ stcb->asoc.loopback_scope,
+ stcb->asoc.ipv4_local_scope,
+ stcb->asoc.local_scope,
+ stcb->asoc.site_scope, 0) == 0) {
+ continue;
+ }
if (((non_asoc_addr_ok == 0) &&
(sctp_is_addr_restricted(stcb, sifa))) ||
(non_asoc_addr_ok &&
@@ -2963,6 +2981,15 @@ bound_all_plan_b:
if (sifa == NULL)
continue;
if (stcb) {
+ if (sctp_is_address_in_scope(sifa,
+ stcb->asoc.ipv4_addr_legal,
+ stcb->asoc.ipv6_addr_legal,
+ stcb->asoc.loopback_scope,
+ stcb->asoc.ipv4_local_scope,
+ stcb->asoc.local_scope,
+ stcb->asoc.site_scope, 0) == 0) {
+ continue;
+ }
if (((non_asoc_addr_ok == 0) &&
(sctp_is_addr_restricted(stcb, sifa))) ||
(non_asoc_addr_ok &&
@@ -3005,6 +3032,15 @@ plan_d:
if (sifa == NULL)
continue;
if (stcb) {
+ if (sctp_is_address_in_scope(sifa,
+ stcb->asoc.ipv4_addr_legal,
+ stcb->asoc.ipv6_addr_legal,
+ stcb->asoc.loopback_scope,
+ stcb->asoc.ipv4_local_scope,
+ stcb->asoc.local_scope,
+ stcb->asoc.site_scope, 0) == 0) {
+ continue;
+ }
if (((non_asoc_addr_ok == 0) &&
(sctp_is_addr_restricted(stcb, sifa))) ||
(non_asoc_addr_ok &&
OpenPOWER on IntegriCloud