summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2008-07-31 11:08:30 +0000
committerrrs <rrs@FreeBSD.org>2008-07-31 11:08:30 +0000
commit7818f3ed80d17fe337ebaa5b51ecf26b785c41c7 (patch)
tree0e033aa257d8146537bb1dea4adc81527d15a2ef /sys/netinet/sctp_output.c
parentb8596e4794a3aeb4fb1425b04700669f545743de (diff)
downloadFreeBSD-src-7818f3ed80d17fe337ebaa5b51ecf26b785c41c7.zip
FreeBSD-src-7818f3ed80d17fe337ebaa5b51ecf26b785c41c7.tar.gz
Adds support for the SCTP_PORT_REUSE option
Fixes a refcount bug found in the process Obtained from: With the help of Michael Tuexen
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 19bbbac..3c61c69 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -11718,6 +11718,12 @@ sctp_sosend(struct socket *so,
struct sctp_inpcb *inp;
int error, use_rcvinfo = 0;
struct sctp_sndrcvinfo srcv;
+ struct sockaddr *addr_to_use;
+
+#ifdef INET6
+ struct sockaddr_in sin;
+
+#endif
inp = (struct sctp_inpcb *)so->so_pcb;
if (control) {
@@ -11728,7 +11734,19 @@ sctp_sosend(struct socket *so,
use_rcvinfo = 1;
}
}
- error = sctp_lower_sosend(so, addr, uio, top,
+ addr_to_use = addr;
+#ifdef INET6
+ if ((addr) && (addr->sa_family == AF_INET6)) {
+ struct sockaddr_in6 *sin6;
+
+ sin6 = (struct sockaddr_in6 *)addr;
+ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
+ in6_sin6_2_sin(&sin, sin6);
+ addr_to_use = (struct sockaddr *)&sin;
+ }
+ }
+#endif
+ error = sctp_lower_sosend(so, addr_to_use, uio, top,
control,
flags,
use_rcvinfo, &srcv
OpenPOWER on IntegriCloud