summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2001-11-27 11:55:28 +0000
committertanimura <tanimura@FreeBSD.org>2001-11-27 11:55:28 +0000
commitf951178b75bc676829e7a843e16ff980682d9f7b (patch)
tree65661fc58cc3af0686fcd57e14417328e0b700d2 /sys/netinet
parent5a6e4aa9ec3c58c225b07323a379d9c5353a38ac (diff)
downloadFreeBSD-src-f951178b75bc676829e7a843e16ff980682d9f7b.zip
FreeBSD-src-f951178b75bc676829e7a843e16ff980682d9f7b.tar.gz
Clear a new syncache entry first, followed by filling in values. This
fixes route breakage due to uncleared gabage on my box.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_syncache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 89889b2..3fbb0b8 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -228,7 +228,7 @@ syncache_init(void)
/* Allocate the hash table. */
MALLOC(tcp_syncache.hashbase, struct syncache_head *,
tcp_syncache.hashsize * sizeof(struct syncache_head),
- M_SYNCACHE, M_WAITOK);
+ M_SYNCACHE, M_WAITOK | M_ZERO);
/* Initialize the hash buckets. */
for (i = 0; i < tcp_syncache.hashsize; i++) {
@@ -596,10 +596,9 @@ syncache_socket(sc, lso)
sc->sc_route6.ro_rt = NULL;
MALLOC(sin6, struct sockaddr_in6 *, sizeof *sin6,
- M_SONAME, M_NOWAIT);
+ M_SONAME, M_NOWAIT | M_ZERO);
if (sin6 == NULL)
goto abort;
- bzero(sin6, sizeof(*sin6));
sin6->sin6_family = AF_INET6;
sin6->sin6_len = sizeof(*sin6);
sin6->sin6_addr = sc->sc_inc.inc6_faddr;
@@ -628,7 +627,7 @@ syncache_socket(sc, lso)
sc->sc_route.ro_rt = NULL;
MALLOC(sin, struct sockaddr_in *, sizeof *sin,
- M_SONAME, M_NOWAIT);
+ M_SONAME, M_NOWAIT | M_ZERO);
if (sin == NULL)
goto abort;
sin->sin_family = AF_INET;
@@ -855,6 +854,7 @@ syncache_add(inc, to, th, sop, m)
/*
* Fill in the syncache values.
*/
+ bzero(sc, sizeof(*sc));
sc->sc_tp = tp;
sc->sc_inp_gencnt = tp->t_inpcb->inp_gencnt;
sc->sc_ipopts = ipopts;
OpenPOWER on IntegriCloud