summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2003-11-26 20:31:13 +0000
committerandre <andre@FreeBSD.org>2003-11-26 20:31:13 +0000
commit4a037b3dd4b704250886ced57a0ab6d97411e694 (patch)
treeed37fabeb3faa7279dd548d1d6a2325900b034ef /sys/netinet/tcp_subr.c
parentde5ea0895c09169faa73049888b11e02ce9db310 (diff)
downloadFreeBSD-src-4a037b3dd4b704250886ced57a0ab6d97411e694.zip
FreeBSD-src-4a037b3dd4b704250886ced57a0ab6d97411e694.tar.gz
Make sure all uses of stack allocated struct route's are properly
zeroed. Doing a bzero on the entire struct route is not more expensive than assigning NULL to ro.ro_rt and bzero of ro.ro_dst. Reviewed by: sam (mentor) Approved by: re (scottl)
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index dfd6de1..926d547 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1409,7 +1409,7 @@ tcp_maxmtu(inc)
KASSERT(inc != NULL, ("tcp_maxmtu with NULL in_conninfo pointer"));
- sro.ro_rt = NULL;
+ bzero(&sro, sizeof(sro));
if (inc->inc_faddr.s_addr != INADDR_ANY) {
dst = (struct sockaddr_in *)&sro.ro_dst;
dst->sin_family = AF_INET;
@@ -1439,7 +1439,7 @@ tcp_maxmtu6(inc)
KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer"));
- sro6.ro_rt = NULL;
+ bzero(&sro6, sizeof(sro6));
if (!IN6_IS_ADDR_UNSPECIFIED(&inc->inc6_faddr)) {
sro6.ro_dst.sin6_family = AF_INET6;
sro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6);
OpenPOWER on IntegriCloud