From b87891fb58fd1b0137a81dd8d1f4808b4bfcb200 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sat, 12 Feb 2005 02:56:05 +0000 Subject: [PATCH] Move mac = NULL initialisation up and simplify second conditional. This both fixes the compiler warning and makes the code a bit more obvious. --- sys/netinet6/nd6_nbr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 225ee4d24f..9ee230b820 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/nd6_nbr.c,v 1.4.2.6 2003/01/23 21:06:47 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/nd6_nbr.c,v 1.10 2005/02/01 16:09:37 hrs Exp $ */ +/* $DragonFly: src/sys/netinet6/nd6_nbr.c,v 1.11 2005/02/12 02:56:05 joerg Exp $ */ /* $KAME: nd6_nbr.c,v 1.86 2002/01/21 02:33:04 jinmei Exp $ */ /* @@ -904,8 +904,8 @@ nd6_na_output(struct ifnet *ifp, const struct in6_addr *daddr6, * Basically, if NS packet is sent to unicast/anycast addr, * target lladdr option SHOULD NOT be included. */ + mac = NULL; if (tlladdr) { - mac = NULL; /* * sdl0 != NULL indicates proxy NA. If we do proxy, use * lladdr in sdl0. If we are not proxying (sending NA for @@ -920,7 +920,7 @@ nd6_na_output(struct ifnet *ifp, const struct in6_addr *daddr6, mac = LLADDR(sdl); } } - if (tlladdr && mac) { + if (mac != NULL) { int optlen = sizeof(struct nd_opt_hdr) + ifp->if_addrlen; struct nd_opt_hdr *nd_opt = (struct nd_opt_hdr *)(nd_na + 1); -- 2.41.0