summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2012-01-11 19:12:24 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2012-01-11 19:12:24 +0000
commitc300b5ec601bd4031e859f644db116ed9adf78a2 (patch)
treec8c7c247929e09034e55d17a90e1638d7c3f22d2 /sys
parentcd75d18c8956e1c34385a351e7c916d308413e30 (diff)
Simplify the #if CARP and if (IFT_CARP) dance in nd6_ns_input().
Fix a white space bug while there. No functional change. ok mikeb@ robert@ henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/nd6_nbr.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 530e239f590..90e7d19c8b3 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.61 2012/01/03 23:41:51 bluhm Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.62 2012/01/11 19:12:23 bluhm Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -200,16 +200,11 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
* (3) "tentative" address on which DAD is being performed.
*/
/* (1) and (3) check. */
-#if NCARP > 0
- if (ifp->if_type == IFT_CARP) {
- ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa;
- if (ifa && !carp_iamatch6(ifp, lladdr, &proxydl))
- ifa = NULL;
- } else {
- ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa;
- }
-#else
ifa = &in6ifa_ifpwithaddr(ifp, &taddr6)->ia_ifa;
+#if NCARP > 0
+ if (ifp->if_type == IFT_CARP && ifa &&
+ !carp_iamatch6(ifp, lladdr, &proxydl))
+ ifa = NULL;
#endif
/* (2) check. */
@@ -1000,7 +995,7 @@ nd6_na_output(struct ifnet *ifp, struct in6_addr *daddr6,
#if NCARP > 0
/* Do not send NAs for carp addresses if we're not the CARP master. */
if (ifp->if_type == IFT_CARP && !carp_iamatch6(ifp, mac, &proxydl))
- goto bad;
+ goto bad;
#endif
ip6->ip6_plen = htons((u_short)icmp6len);