diff options
author | tuexen <tuexen@FreeBSD.org> | 2013-02-09 17:26:14 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2013-02-09 17:26:14 +0000 |
commit | 026c1e8b1a1c4bee198b507e5bbd7ecde48cf5af (patch) | |
tree | 2cf33d91d2d068193e3685d2edb621e6e132dcd2 /sys/netinet/sctp_sysctl.c | |
parent | 4c7dca13e4e6734c0970e0f3d3a7b02ff879ae72 (diff) | |
download | FreeBSD-src-026c1e8b1a1c4bee198b507e5bbd7ecde48cf5af.zip FreeBSD-src-026c1e8b1a1c4bee198b507e5bbd7ecde48cf5af.tar.gz |
Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK
only the supported address types. While there, do some whitespace
cleanups.
MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctp_sysctl.c')
-rw-r--r-- | sys/netinet/sctp_sysctl.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 14372bb..debb8cc 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -197,29 +197,29 @@ copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct s /* Turn on all the appropriate scope */ if (stcb) { /* use association specific values */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* use generic values for endpoints */ + /* Use generic values for endpoints. */ loopback_scope = 1; ipv4_local_scope = 1; local_scope = 1; site_scope = 1; - } - - /* use only address families of interest */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp)) { - ipv4_addr_legal = 0; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; - ipv6_addr_legal = 0; } /* neither Mac OS X nor FreeBSD support mulitple routing functions */ |