summaryrefslogtreecommitdiff
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-05-16 12:39:22 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-05-16 12:39:22 +0000
commit4a6bd1fbd5f03c6a3cdb85b1daa6b421fd6d218d (patch)
tree9181a3f71b3aa106df196abfc64d6b875086d080 /sys/netinet/udp_usrreq.c
parent051c1a42d8a86cb68ed1ca7e56a35bbb92b18b0a (diff)
- pcbflags is not modified in pcb_(dis)connect, so there's no
need to save/restore it. - inp->inp_laddr should be set _before_ calling pcb_disconnect(). otherwise pcb_disconnect() calls pcb_rehash() with the old laddr. [ currently this is not a problem since the hash ignores laddr ] tested by pedro
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index f92bc2cd69e..2e1cdb35394 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.106 2006/01/13 10:11:23 mpf Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.107 2006/05/16 12:39:21 markus Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -927,7 +927,6 @@ udp_output(struct mbuf *m, ...)
struct in_addr laddr;
int s = 0, error = 0;
va_list ap;
- int pcbflags = 0;
va_start(ap, m);
inp = va_arg(ap, struct inpcb *);
@@ -950,12 +949,6 @@ udp_output(struct mbuf *m, ...)
}
if (addr) {
- /*
- * Save current PCB flags because they may change during
- * temporary connection.
- */
- pcbflags = inp->inp_flags;
-
laddr = inp->inp_laddr;
if (inp->inp_faddr.s_addr != INADDR_ANY) {
error = EISCONN;
@@ -1023,9 +1016,8 @@ udp_output(struct mbuf *m, ...)
bail:
if (addr) {
- in_pcbdisconnect(inp);
- inp->inp_flags = pcbflags;
inp->inp_laddr = laddr;
+ in_pcbdisconnect(inp);
splx(s);
}
if (control)
@@ -1176,13 +1168,13 @@ udp_usrreq(so, req, m, addr, control)
}
s = splsoftnet();
- in_pcbdisconnect(inp);
#ifdef INET6
if (inp->inp_flags & INP_IPV6)
inp->inp_laddr6 = in6addr_any;
else
#endif /* INET6 */
inp->inp_laddr.s_addr = INADDR_ANY;
+ in_pcbdisconnect(inp);
splx(s);
so->so_state &= ~SS_ISCONNECTED; /* XXX */