diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2000-09-20 16:39:51 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2000-09-20 16:39:51 +0000 |
commit | dc087a71e34204c41f6ef06c16a54e74c6ea00be (patch) | |
tree | 0fe1c1058ecf347d045a4534c68df1bfc4b8e8d5 | |
parent | 3e67a0be7cc71d62333cf6fc6fc03c4beaa8044e (diff) |
fix in_pcbrtentry
-rw-r--r-- | sys/netinet/in_pcb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index bbda223ea3a..a70cce48c03 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.44 2000/09/19 03:20:57 angelos Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.45 2000/09/20 16:39:50 provos Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -870,6 +870,12 @@ in_pcbrtentry(inp) * No route yet, so try to acquire one. */ if (ro->ro_rt == NULL) { +#ifdef INET6 + bzero(ro, sizeof(struct route_in6)); +#else + bzero(ro, sizeof(struct route)); +#endif + switch(sotopf(inp->inp_socket)) { #ifdef INET6 case PF_INET6: @@ -883,7 +889,7 @@ in_pcbrtentry(inp) break; #endif /* INET6 */ case PF_INET: - if (inp->inp_faddr.s_addr != INADDR_ANY) + if (inp->inp_faddr.s_addr == INADDR_ANY) break; ro->ro_dst.sa_family = AF_INET; ro->ro_dst.sa_len = sizeof(ro->ro_dst); |