diff options
author | tuexen <tuexen@FreeBSD.org> | 2013-05-10 18:09:38 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2013-05-10 18:09:38 +0000 |
commit | 6ea39edf934cff6ee443d1e0447b0081574612e5 (patch) | |
tree | f642bd6226b2431c3dee9816695a5d1d53c8f4a0 /sys/netinet | |
parent | 4805e93f7fe66454a5cca7155b7f6abf1256659e (diff) | |
download | FreeBSD-src-6ea39edf934cff6ee443d1e0447b0081574612e5.zip FreeBSD-src-6ea39edf934cff6ee443d1e0447b0081574612e5.tar.gz |
Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLY
socket option for SCTP sockets in the same way as for UDP or TCP
sockets.
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/sctp_pcb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 6969793..e98ca0c 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2376,8 +2376,13 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; #ifdef INET6 - if (MODULE_GLOBAL(ip6_auto_flowlabel)) { - inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + if (INP_SOCKAF(so) == AF_INET6) { + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } + if (MODULE_GLOBAL(ip6_v6only)) { + inp->ip_inp.inp.inp_flags |= IN6P_IPV6_V6ONLY; + } } #endif inp->sctp_associd_counter = 1; |