summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorpb <pb@FreeBSD.org>1999-06-25 23:46:47 +0000
committerpb <pb@FreeBSD.org>1999-06-25 23:46:47 +0000
commit3213b13650cb2206bbd62b5b1764d148750f63a0 (patch)
tree9194d24e544e6d9fa72c65e8c8298cea905e434b /sys/netinet/in_pcb.c
parent87c4dbd66a7d9777fbc25f9222da6d2d79e49393 (diff)
downloadFreeBSD-src-3213b13650cb2206bbd62b5b1764d148750f63a0.zip
FreeBSD-src-3213b13650cb2206bbd62b5b1764d148750f63a0.tar.gz
In in_pcbconnect(), check the return value from in_pcbbind() and
exit on errors. If we don't, in_pcbrehash() is called without a preceeding in_pcbinshash(), causing a crash. There are apparently several conditions that could cause the crash; PR misc/12256 is only one of these. PR: misc/12256
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index d66e598..87d8c45 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id: in_pcb.c,v 1.49 1999/04/28 11:37:44 phk Exp $
+ * $Id: in_pcb.c,v 1.50 1999/06/17 23:54:50 green Exp $
*/
#include <sys/param.h>
@@ -458,8 +458,11 @@ in_pcbconnect(inp, nam, p)
return (EADDRINUSE);
}
if (inp->inp_laddr.s_addr == INADDR_ANY) {
- if (inp->inp_lport == 0)
- (void)in_pcbbind(inp, (struct sockaddr *)0, p);
+ if (inp->inp_lport == 0) {
+ error = in_pcbbind(inp, (struct sockaddr *)0, p);
+ if (error)
+ return (error);
+ }
inp->inp_laddr = ifaddr->sin_addr;
}
inp->inp_faddr = sin->sin_addr;
OpenPOWER on IntegriCloud