summaryrefslogtreecommitdiff
path: root/sys/netinet6/udp6_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/udp6_output.c')
-rw-r--r--sys/netinet6/udp6_output.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c
index fd75e426255..4abaf4c6d5a 100644
--- a/sys/netinet6/udp6_output.c
+++ b/sys/netinet6/udp6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp6_output.c,v 1.40 2015/11/24 13:37:16 mpi Exp $ */
+/* $OpenBSD: udp6_output.c,v 1.41 2015/12/02 22:13:44 vgross Exp $ */
/* $KAME: udp6_output.c,v 1.21 2001/02/07 11:51:54 itojun Exp $ */
/*
@@ -160,9 +160,13 @@ udp6_output(struct inpcb *in6p, struct mbuf *m, struct mbuf *addr6,
if (error)
goto release;
- if (in6p->inp_lport == 0 &&
- (error = in6_pcbsetport(laddr, in6p, p)) != 0)
- goto release;
+ if (in6p->inp_lport == 0){
+ int s = splsoftnet();
+ error = in6_pcbbind(in6p, NULL, p);
+ splx(s);
+ if (error)
+ goto release;
+ }
} else {
if (IN6_IS_ADDR_UNSPECIFIED(&in6p->inp_faddr6)) {
error = ENOTCONN;