summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 1be4440a..af312e3c 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -305,7 +305,6 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length,
return 0;
}
-#ifdef HAVE_IPV6
/* Zebra route add and delete treatment. */
static int
zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length,
@@ -387,7 +386,6 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length,
return 0;
}
-#endif /* HAVE_IPV6 */
struct interface *
if_lookup_by_ipv4 (struct in_addr *addr)
@@ -440,7 +438,6 @@ if_lookup_by_ipv4_exact (struct in_addr *addr)
return NULL;
}
-#ifdef HAVE_IPV6
struct interface *
if_lookup_by_ipv6 (struct in6_addr *addr)
{
@@ -533,7 +530,6 @@ if_get_ipv6_local (struct interface *ifp, struct in6_addr *addr)
}
return 0;
}
-#endif /* HAVE_IPV6 */
static int
if_get_ipv4_address (struct interface *ifp, struct in_addr *addr)
@@ -573,7 +569,6 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
nexthop->v4 = local->sin.sin_addr;
ifp = if_lookup_by_ipv4 (&local->sin.sin_addr);
}
-#ifdef HAVE_IPV6
if (local->sa.sa_family == AF_INET6)
{
if (IN6_IS_ADDR_LINKLOCAL (&local->sin6.sin6_addr))
@@ -584,7 +579,6 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
else
ifp = if_lookup_by_ipv6 (&local->sin6.sin6_addr);
}
-#endif /* HAVE_IPV6 */
if (!ifp)
return -1;
@@ -594,7 +588,6 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
/* IPv4 connection. */
if (local->sa.sa_family == AF_INET)
{
-#ifdef HAVE_IPV6
/* IPv6 nexthop*/
ret = if_get_ipv6_global (ifp, &nexthop->v6_global);
@@ -603,10 +596,8 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
if_get_ipv6_local (ifp, &nexthop->v6_global);
else
if_get_ipv6_local (ifp, &nexthop->v6_local);
-#endif /* HAVE_IPV6 */
}
-#ifdef HAVE_IPV6
/* IPv6 connection. */
if (local->sa.sa_family == AF_INET6)
{
@@ -663,7 +654,6 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
SET_IN6_LINKLOCAL_IFINDEX (nexthop->v6_local, 0);
}
#endif /* KAME */
-#endif /* HAVE_IPV6 */
return ret;
}
@@ -763,7 +753,7 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp, sa
zapi_ipv4_route (ZEBRA_IPV4_ROUTE_ADD, zclient,
(struct prefix_ipv4 *) p, &api);
}
-#ifdef HAVE_IPV6
+
/* We have to think about a IPv6 link-local address curse. */
if (p->family == AF_INET6)
{
@@ -833,7 +823,6 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp, sa
zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient,
(struct prefix_ipv6 *) p, &api);
}
-#endif /* HAVE_IPV6 */
}
void
@@ -888,7 +877,7 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi)
zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE, zclient,
(struct prefix_ipv4 *) p, &api);
}
-#ifdef HAVE_IPV6
+
/* We have to think about a IPv6 link-local address curse. */
if (p->family == AF_INET6)
{
@@ -916,7 +905,6 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi)
zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient,
(struct prefix_ipv6 *) p, &api);
}
-#endif /* HAVE_IPV6 */
}
/* Other routes redistribution into BGP. */
@@ -1074,10 +1062,8 @@ bgp_zebra_init (struct thread_master *master)
zclient->ipv4_route_delete = zebra_read_ipv4;
zclient->interface_up = bgp_interface_up;
zclient->interface_down = bgp_interface_down;
-#ifdef HAVE_IPV6
zclient->ipv6_route_add = zebra_read_ipv6;
zclient->ipv6_route_delete = zebra_read_ipv6;
-#endif /* HAVE_IPV6 */
bgp_nexthop_buf = stream_new(BGP_NEXTHOP_BUF_SIZE);
}