aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2009-06-11 10:26:38 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2009-06-11 10:26:38 +0000
commit259d2d5431065a08380b0791b6c5d01b285b0215 (patch)
treef98bbcd30eb93d910b0d5de7940c01d2a7e71764 /sys/net/if.c
parent493f0f17094cc6f7c366ab86df111fe59011fcb3 (diff)
downloadsrc-259d2d5431065a08380b0791b6c5d01b285b0215.tar.gz
src-259d2d5431065a08380b0791b6c5d01b285b0215.zip
carp(4) allows people to share a set of IP addresses and can only
use IPv4/v6 for inter-node communication (according to my reading). Properly wrap the carp callouts in INET || INET6 and refelect this in sys/conf/files as well. While in theory this should be ok, it might be a bit optimistic to think that carp could build with inet6 only[1]. Discussed with: mlaier [1]
Notes
Notes: svn path=/head/; revision=193983
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c95de07b5bb9..baf6939a2247 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -86,9 +86,11 @@
#include <netinet/if_ether.h>
#include <netinet/vinet.h>
#endif
+#if defined(INET) || defined(INET6)
#ifdef DEV_CARP
#include <netinet/ip_carp.h>
#endif
+#endif
#include <security/mac/mac_framework.h>
@@ -1738,10 +1740,12 @@ if_unroute(struct ifnet *ifp, int flag, int fam)
pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
ifp->if_qflush(ifp);
+#if defined(INET) || defined(INET6)
#ifdef DEV_CARP
if (ifp->if_carp)
carp_carpdev_state(ifp->if_carp);
#endif
+#endif
rt_ifmsg(ifp);
}
@@ -1762,10 +1766,12 @@ if_route(struct ifnet *ifp, int flag, int fam)
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
pfctlinput(PRC_IFUP, ifa->ifa_addr);
+#if defined(INET) || defined(INET6)
#ifdef DEV_CARP
if (ifp->if_carp)
carp_carpdev_state(ifp->if_carp);
#endif
+#endif
rt_ifmsg(ifp);
#ifdef INET6
in6_if_up(ifp);
@@ -1816,10 +1822,12 @@ do_link_state_change(void *arg, int pending)
if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) &&
IFP2AC(ifp)->ac_netgraph != NULL)
(*ng_ether_link_state_p)(ifp, link_state);
+#if defined(INET) || defined(INET6)
#ifdef DEV_CARP
if (ifp->if_carp)
carp_carpdev_state(ifp->if_carp);
#endif
+#endif
if (ifp->if_bridge) {
KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!"));
(*bstp_linkstate_p)(ifp, link_state);