We might leave nd6_ns_output() really early. Postpone memset()

until after we decide to stay.
This commit is contained in:
dyoung 2007-11-16 17:51:51 +00:00
parent 9044dcac49
commit 777dd06a99

View File

@ -1,4 +1,4 @@
/* $NetBSD: nd6_nbr.c,v 1.81 2007/11/10 00:14:32 dyoung Exp $ */ /* $NetBSD: nd6_nbr.c,v 1.82 2007/11/16 17:51:51 dyoung Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/* /*
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.81 2007/11/10 00:14:32 dyoung Exp $"); __KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.82 2007/11/16 17:51:51 dyoung Exp $");
#include "opt_inet.h" #include "opt_inet.h"
#include "opt_ipsec.h" #include "opt_ipsec.h"
@ -351,11 +351,11 @@ nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6,
const void *mac; const void *mac;
struct route ro; struct route ro;
memset(&ro, 0, sizeof(ro));
if (IN6_IS_ADDR_MULTICAST(taddr6)) if (IN6_IS_ADDR_MULTICAST(taddr6))
return; return;
memset(&ro, 0, sizeof(ro));
/* estimate the size of message */ /* estimate the size of message */
maxlen = sizeof(*ip6) + sizeof(*nd_ns); maxlen = sizeof(*ip6) + sizeof(*nd_ns);
maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7; maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7;