diff options
author | Christopher Zimmermann <chrisz@cvs.openbsd.org> | 2014-04-06 16:49:41 +0000 |
---|---|---|
committer | Christopher Zimmermann <chrisz@cvs.openbsd.org> | 2014-04-06 16:49:41 +0000 |
commit | eaf0b040e78e4a37272256631157db668381a70f (patch) | |
tree | 2d8b9edff4942f31a6a0ebb65c4b5daf3f5ec8c5 /sys/netinet/in_pcb.c | |
parent | 11c8fcc2dada5d887e442858ef39883ebeb72b35 (diff) |
Remove redundant call to in{,6}_pcbbind() from tcp PRU_CONNECT.
Make sure that in_pcbbind() is called from in_pcbconnect() by KASSERTing that
local port == 0 implies an unspecified local address.
OK claudio@
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index db67fbaa95c..ba420f7cfdb 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.149 2014/03/28 08:33:51 sthen Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.150 2014/04/06 16:49:40 chrisz Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -417,6 +417,7 @@ in_pcbconnect(struct inpcb *inp, struct mbuf *nam) inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr, inp->inp_lport, inp->inp_rtableid) != 0) return (EADDRINUSE); + KASSERT(inp->inp_laddr.s_addr == INADDR_ANY || inp->inp_lport != 0); if (inp->inp_laddr.s_addr == INADDR_ANY) { if (inp->inp_lport == 0 && in_pcbbind(inp, NULL, curproc) == EADDRNOTAVAIL) |