Browse Source

bgpd: remove HAVE_IPV6 conditionals

Signed-off-by: Lou Berger <lberger@labn.net>
Tested-by: NetDEF CI System <cisystem@netdef.org>
Lou Berger 4 years ago
parent
commit
205e6744f2
17 changed files with 33 additions and 461 deletions
  1. 1 16
      bgpd/bgp_attr.c
  2. 0 2
      bgpd/bgp_attr.h
  3. 0 2
      bgpd/bgp_debug.c
  4. 9 22
      bgpd/bgp_encap.c
  5. 0 4
      bgpd/bgp_mpath.c
  6. 0 8
      bgpd/bgp_mplsvpn.c
  7. 0 51
      bgpd/bgp_network.c
  8. 0 26
      bgpd/bgp_nexthop.c
  9. 0 2
      bgpd/bgp_open.c
  10. 0 4
      bgpd/bgp_packet.c
  11. 15 198
      bgpd/bgp_route.c
  12. 0 8
      bgpd/bgp_routemap.c
  13. 0 4
      bgpd/bgp_table.h
  14. 6 94
      bgpd/bgp_vty.c
  15. 2 16
      bgpd/bgp_zebra.c
  16. 0 2
      bgpd/bgp_zebra.h
  17. 0 2
      bgpd/bgpd.h

+ 1 - 16
bgpd/bgp_attr.c

@@ -511,11 +511,9 @@ attrhash_key_make (void *p)
       if (extra->transit)
         MIX(transit_hash_key_make (extra->transit));
 
-#ifdef HAVE_IPV6
       MIX(extra->mp_nexthop_len);
       key = jhash(extra->mp_nexthop_global.s6_addr, 16, key);
       key = jhash(extra->mp_nexthop_local.s6_addr, 16, key);
-#endif /* HAVE_IPV6 */
     }
 
   return key;
@@ -542,11 +540,9 @@ attrhash_cmp (const void *p1, const void *p2)
           && ae1->aggregator_as == ae2->aggregator_as
           && ae1->aggregator_addr.s_addr == ae2->aggregator_addr.s_addr
           && ae1->weight == ae2->weight
-#ifdef HAVE_IPV6
           && ae1->mp_nexthop_len == ae2->mp_nexthop_len
           && IPV6_ADDR_SAME (&ae1->mp_nexthop_global, &ae2->mp_nexthop_global)
           && IPV6_ADDR_SAME (&ae1->mp_nexthop_local, &ae2->mp_nexthop_local)
-#endif /* HAVE_IPV6 */
           && IPV4_ADDR_SAME (&ae1->mp_nexthop_global_in, &ae2->mp_nexthop_global_in)
           && ae1->ecommunity == ae2->ecommunity
           && ae1->cluster == ae2->cluster
@@ -696,9 +692,7 @@ bgp_attr_default_set (struct attr *attr, u_char origin)
   attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_AS_PATH);
   attr->extra->weight = BGP_ATTR_DEFAULT_WEIGHT;
   attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP);
-#ifdef HAVE_IPV6
   attr->extra->mp_nexthop_len = IPV6_MAX_BYTELEN;
-#endif
 
   return attr;
 }
@@ -757,9 +751,8 @@ bgp_attr_aggregate_intern (struct bgp *bgp, u_char origin,
     }
 
   attre.weight = BGP_ATTR_DEFAULT_WEIGHT;
-#ifdef HAVE_IPV6
   attre.mp_nexthop_len = IPV6_MAX_BYTELEN;
-#endif
+
   if (! as_set)
     attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE);
   attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_AGGREGATOR);
@@ -1658,7 +1651,6 @@ bgp_mp_reach_parse (struct bgp_attr_parser_args *args,
       stream_getl (s); /* RD low */
       stream_get (&attre->mp_nexthop_global_in, s, 4);
       break;
-#ifdef HAVE_IPV6
     case 24:
       {
         u_int32_t rd_high __attribute__((unused));
@@ -1705,7 +1697,6 @@ bgp_mp_reach_parse (struct bgp_attr_parser_args *args,
 	  attre->mp_nexthop_len = 16;
 	}
       break;
-#endif /* HAVE_IPV6 */
     default:
       zlog_info ("%s: (%s) Wrong multiprotocol next hop length: %d", 
 		 __func__, peer->host, attre->mp_nexthop_len);
@@ -2434,7 +2425,6 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi,
 	  break;
 	}
       break;
-#ifdef HAVE_IPV6
     case AFI_IP6:
       switch (safi)
       {
@@ -2480,7 +2470,6 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi,
 	break;
       }
       break;
-#endif /*HAVE_IPV6*/
     default:
       break;
     }
@@ -3063,9 +3052,7 @@ bgp_dump_routes_attr (struct stream *s, struct attr *attr,
   /* Nexthop attribute. */
   /* If it's an IPv6 prefix, don't dump the IPv4 nexthop to save space */
   if(prefix != NULL
-#ifdef HAVE_IPV6
      && prefix->family != AF_INET6
-#endif /* HAVE_IPV6 */
      )
     {
       stream_putc (s, BGP_ATTR_FLAG_TRANS);
@@ -3129,7 +3116,6 @@ bgp_dump_routes_attr (struct stream *s, struct attr *attr,
       stream_put (s, attr->community->val, attr->community->size * 4);
     }
 
-#ifdef HAVE_IPV6
   /* Add a MP_NLRI attribute to dump the IPv6 next hop */
   if (prefix != NULL && prefix->family == AF_INET6 && attr->extra &&
      (attr->extra->mp_nexthop_len == 16 || attr->extra->mp_nexthop_len == 32) )
@@ -3161,7 +3147,6 @@ bgp_dump_routes_attr (struct stream *s, struct attr *attr,
       /* Set MP attribute length. */
       stream_putc_at (s, sizep, (stream_get_endp (s) - sizep) - 1);
     }
-#endif /* HAVE_IPV6 */
 
   /* Return total size of attribute. */
   len = stream_get_endp (s) - cp - 2;

+ 0 - 2
bgpd/bgp_attr.h

@@ -61,10 +61,8 @@ struct bgp_attr_encap_subtlv {
 struct attr_extra
 {
   /* Multi-Protocol Nexthop, AFI IPv6 */
-#ifdef HAVE_IPV6
   struct in6_addr mp_nexthop_global;
   struct in6_addr mp_nexthop_local;
-#endif /* HAVE_IPV6 */
 
   /* Extended Communities attribute. */
   struct ecommunity *ecommunity;

+ 0 - 2
bgpd/bgp_debug.c

@@ -175,7 +175,6 @@ bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
     snprintf (buf + strlen (buf), size - strlen (buf), ", origin %s",
 	      bgp_origin_str[attr->origin]);
 
-#ifdef HAVE_IPV6
   if (attr->extra)
     {
       char addrbuf[BUFSIZ];
@@ -192,7 +191,6 @@ bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
                   inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local, 
                              addrbuf, BUFSIZ));
     }
-#endif /* HAVE_IPV6 */
 
   if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))
     snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u",

+ 9 - 22
bgpd/bgp_encap.c

@@ -511,7 +511,7 @@ DEFUN (show_bgp_ipv4_encap,
 {
   return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 0);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap,
        show_bgp_ipv6_encap_cmd,
        "show bgp ipv6 encap",
@@ -522,7 +522,6 @@ DEFUN (show_bgp_ipv6_encap,
 {
   return bgp_show_encap (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_rd,
        show_bgp_ipv4_encap_rd_cmd,
@@ -545,7 +544,7 @@ DEFUN (show_bgp_ipv4_encap_rd,
     }
   return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 0);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_rd,
        show_bgp_ipv6_encap_rd_cmd,
        "show bgp ipv6 encap rd ASN:nn_or_IP-address:nn",
@@ -568,7 +567,6 @@ DEFUN (show_bgp_ipv6_encap_rd,
     }
   return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_tags,
        show_bgp_ipv4_encap_tags_cmd,
@@ -581,7 +579,7 @@ DEFUN (show_bgp_ipv4_encap_tags,
 {
   return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_normal, NULL,  1);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_tags,
        show_bgp_ipv6_encap_tags_cmd,
        "show bgp ipv6 encap tags",
@@ -593,7 +591,7 @@ DEFUN (show_bgp_ipv6_encap_tags,
 {
   return bgp_show_encap (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL,  1);
 }
-#endif
+
 
 DEFUN (show_bgp_ipv4_encap_rd_tags,
        show_bgp_ipv4_encap_rd_tags_cmd,
@@ -617,7 +615,7 @@ DEFUN (show_bgp_ipv4_encap_rd_tags,
     }
   return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 1);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_rd_tags,
        show_bgp_ipv6_encap_rd_tags_cmd,
        "show bgp ipv6 encap rd ASN:nn_or_IP-address:nn tags",
@@ -640,7 +638,6 @@ DEFUN (show_bgp_ipv6_encap_rd_tags,
     }
   return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 1);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_neighbor_routes,
        show_bgp_ipv4_encap_neighbor_routes_cmd,
@@ -672,7 +669,7 @@ DEFUN (show_bgp_ipv4_encap_neighbor_routes,
 
   return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_neighbor, su, 0);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_neighbor_routes,
        show_bgp_ipv6_encap_neighbor_routes_cmd,
        "show bgp ipv6 encap neighbors A.B.C.D routes",
@@ -703,7 +700,6 @@ DEFUN (show_bgp_ipv6_encap_neighbor_routes,
 
   return bgp_show_encap (vty, AFI_IP6, NULL, bgp_show_type_neighbor, su, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_rd_neighbor_routes,
        show_bgp_ipv4_encap_rd_neighbor_routes_cmd,
@@ -747,7 +743,7 @@ DEFUN (show_bgp_ipv4_encap_rd_neighbor_routes,
 
   return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_neighbor, su, 0);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_rd_neighbor_routes,
        show_bgp_ipv6_encap_rd_neighbor_routes_cmd,
        "show bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) routes",
@@ -790,7 +786,6 @@ DEFUN (show_bgp_ipv6_encap_rd_neighbor_routes,
 
   return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_neighbor, su, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_neighbor_advertised_routes,
        show_bgp_ipv4_encap_neighbor_advertised_routes_cmd,
@@ -822,7 +817,7 @@ DEFUN (show_bgp_ipv4_encap_neighbor_advertised_routes,
 
   return show_adj_route_encap (vty, peer, NULL);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_neighbor_advertised_routes,
        show_bgp_ipv6_encap_neighbor_advertised_routes_cmd,
        "show bgp ipv6 encap neighbors A.B.C.D advertised-routes",
@@ -853,7 +848,6 @@ DEFUN (show_bgp_ipv6_encap_neighbor_advertised_routes,
 
   return show_adj_route_encap (vty, peer, NULL);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_rd_neighbor_advertised_routes,
        show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd,
@@ -896,7 +890,7 @@ DEFUN (show_bgp_ipv4_encap_rd_neighbor_advertised_routes,
 
   return show_adj_route_encap (vty, peer, &prd);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_encap_rd_neighbor_advertised_routes,
        show_bgp_ipv6_encap_rd_neighbor_advertised_routes_cmd,
        "show bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) advertised-routes",
@@ -938,7 +932,6 @@ DEFUN (show_bgp_ipv6_encap_rd_neighbor_advertised_routes,
 
   return show_adj_route_encap (vty, peer, &prd);
 }
-#endif
 
 void
 bgp_encap_init (void)
@@ -955,7 +948,6 @@ bgp_encap_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv4_encap_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd);
 
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_tags_cmd);
@@ -964,8 +956,6 @@ bgp_encap_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_neighbor_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_neighbor_advertised_routes_cmd);
-#endif
-
 
   install_element (ENABLE_NODE, &show_bgp_ipv4_encap_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv4_encap_rd_cmd);
@@ -976,7 +966,6 @@ bgp_encap_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv4_encap_neighbor_advertised_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd);
 
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_rd_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_tags_cmd);
@@ -985,7 +974,5 @@ bgp_encap_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_rd_neighbor_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_neighbor_advertised_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_rd_neighbor_advertised_routes_cmd);
-#endif
-
 
 }

+ 0 - 4
bgpd/bgp_mpath.c

@@ -148,7 +148,6 @@ bgp_info_nexthop_cmp (struct bgp_info *bi1, struct bgp_info *bi2)
           compare = IPV4_ADDR_CMP (&ae1->mp_nexthop_global_in,
                                    &ae2->mp_nexthop_global_in);
           break;
-#ifdef HAVE_IPV6
         case 16:
           compare = IPV6_ADDR_CMP (&ae1->mp_nexthop_global,
                                    &ae2->mp_nexthop_global);
@@ -160,7 +159,6 @@ bgp_info_nexthop_cmp (struct bgp_info *bi1, struct bgp_info *bi2)
             compare = IPV6_ADDR_CMP (&ae1->mp_nexthop_local,
                                      &ae2->mp_nexthop_local);
           break;
-#endif /* HAVE_IPV6 */
         }
     }
 
@@ -746,10 +744,8 @@ bgp_info_mpath_aggregate_update (struct bgp_info *new_best,
 
   /* Zap multipath attr nexthop so we set nexthop to self */
   attr.nexthop.s_addr = 0;
-#ifdef HAVE_IPV6
   if (attr.extra)
     memset (&attr.extra->mp_nexthop_global, 0, sizeof (struct in6_addr));
-#endif /* HAVE_IPV6 */
 
   /* TODO: should we set ATOMIC_AGGREGATE and AGGREGATOR? */
 

+ 0 - 8
bgpd/bgp_mplsvpn.c

@@ -599,7 +599,6 @@ DEFUN (show_bgp_ipv4_vpn,
   return bgp_show_mpls_vpn (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_vpn,
        show_bgp_ipv6_vpn_cmd,
        "show bgp ipv6 vpn",
@@ -610,7 +609,6 @@ DEFUN (show_bgp_ipv6_vpn,
 {
   return bgp_show_mpls_vpn (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_vpn_rd,
        show_bgp_ipv4_vpn_rd_cmd,
@@ -758,7 +756,6 @@ DEFUN (show_bgp_ipv4_vpn_neighbor_routes,
   return bgp_show_mpls_vpn (vty, AFI_IP, NULL, bgp_show_type_neighbor, &su, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_vpn_neighbor_routes,
        show_bgp_ipv6_vpn_neighbor_routes_cmd,
        "show bgp ipv6 vpn neighbors (A.B.C.D|X:X::X:X) routes",
@@ -792,7 +789,6 @@ DEFUN (show_bgp_ipv6_vpn_neighbor_routes,
 
   return bgp_show_mpls_vpn (vty, AFI_IP6, NULL, bgp_show_type_neighbor, &su, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_vpn_neighbor_advertised_routes,
        show_bgp_ipv4_vpn_neighbor_advertised_routes_cmd,
@@ -1035,7 +1031,6 @@ bgp_mplsvpn_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_neighbor_routes_cmd);
 
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_tags_cmd);
@@ -1044,7 +1039,6 @@ bgp_mplsvpn_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_neighbor_routes_cmd);
-#endif
 
   install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_cmd);
@@ -1055,7 +1049,6 @@ bgp_mplsvpn_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_neighbor_advertised_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_neighbor_routes_cmd);
 
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_tags_cmd);
@@ -1064,5 +1057,4 @@ bgp_mplsvpn_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_neighbor_advertised_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_neighbor_advertised_routes_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_neighbor_routes_cmd);
-#endif
 }

+ 0 - 51
bgpd/bgp_network.c

@@ -387,10 +387,8 @@ bgp_connect (struct peer *peer)
     zlog_err ("%s: could not raise privs", __func__);
   if (sockunion_family (&peer->su) == AF_INET)
     setsockopt_ipv4_tos (peer->fd, IPTOS_PREC_INTERNETCONTROL);
-# ifdef HAVE_IPV6
   else if (sockunion_family (&peer->su) == AF_INET6)
     setsockopt_ipv6_tclass (peer->fd, IPTOS_PREC_INTERNETCONTROL);
-# endif
   if (bgpd_privs.change (ZPRIVS_LOWER))
     zlog_err ("%s: could not lower privs", __func__);
 #endif
@@ -404,10 +402,8 @@ bgp_connect (struct peer *peer)
   /* Update source bind. */
   bgp_update_source (peer);
 
-#ifdef HAVE_IPV6
   if (peer->ifname)
     ifindex = ifname2ifindex (peer->ifname);
-#endif /* HAVE_IPV6 */
 
   if (BGP_DEBUG (events, EVENTS))
     plog_debug (peer->log, "%s [Event] Connect start to %s fd %d",
@@ -455,10 +451,8 @@ bgp_listener (int sock, struct sockaddr *sa, socklen_t salen)
 #ifdef IPTOS_PREC_INTERNETCONTROL
   if (sa->sa_family == AF_INET)
     setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL);
-#  ifdef HAVE_IPV6
   else if (sa->sa_family == AF_INET6)
     setsockopt_ipv6_tclass (sock, IPTOS_PREC_INTERNETCONTROL);
-#  endif
 #endif
 
   sockopt_v6only (sa->sa_family, sock);
@@ -491,7 +485,6 @@ bgp_listener (int sock, struct sockaddr *sa, socklen_t salen)
 }
 
 /* IPv6 supported version of BGP server socket setup.  */
-#ifdef HAVE_IPV6
 int
 bgp_socket (unsigned short port, const char *address)
 {
@@ -548,50 +541,6 @@ bgp_socket (unsigned short port, const char *address)
 
   return 0;
 }
-#else
-/* Traditional IPv4 only version.  */
-int
-bgp_socket (unsigned short port, const char *address)
-{
-  int sock;
-  int socklen;
-  struct sockaddr_in sin;
-  int ret;
-
-  sock = socket (AF_INET, SOCK_STREAM, 0);
-  if (sock < 0)
-    {
-      zlog_err ("socket: %s", safe_strerror (errno));
-      return sock;
-    }
-
-  /* if we intend to implement ttl-security, this socket needs ttl=255 */
-  sockopt_ttl (AF_INET, sock, MAXTTL);
-
-  memset (&sin, 0, sizeof (struct sockaddr_in));
-  sin.sin_family = AF_INET;
-  sin.sin_port = htons (port);
-  socklen = sizeof (struct sockaddr_in);
-
-  if (address && ((ret = inet_aton(address, &sin.sin_addr)) < 1))
-    {
-      zlog_err("bgp_socket: could not parse ip address %s: %s",
-                address, safe_strerror (errno));
-      return ret;
-    }
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-  sin.sin_len = socklen;
-#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
-
-  ret = bgp_listener (sock, (struct sockaddr *) &sin, socklen);
-  if (ret < 0) 
-    {
-      close (sock);
-      return ret;
-    }
-  return sock;
-}
-#endif /* HAVE_IPV6 */
 
 void
 bgp_close (void)

+ 0 - 26
bgpd/bgp_nexthop.c

@@ -43,9 +43,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "zebra/zserv.h"	/* For ZEBRA_SERV_PATH. */
 
 struct bgp_nexthop_cache *zlookup_query (struct in_addr);
-#ifdef HAVE_IPV6
 struct bgp_nexthop_cache *zlookup_query_ipv6 (struct in6_addr *);
-#endif /* HAVE_IPV6 */
 
 /* Only one BGP scan thread are activated at the same time. */
 static struct thread *bgp_scan_thread = NULL;
@@ -133,7 +131,6 @@ bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
       if (next1->ifindex != next2->ifindex)
 	return 0;
       break;
-#ifdef HAVE_IPV6
     case ZEBRA_NEXTHOP_IPV6:
       if (! IPV6_ADDR_SAME (&next1->gate.ipv6, &next2->gate.ipv6))
 	return 0;
@@ -145,7 +142,6 @@ bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
       if (next1->ifindex != next2->ifindex)
 	return 0;
       break;
-#endif /* HAVE_IPV6 */
     default:
       /* do nothing */
       break;
@@ -197,7 +193,6 @@ bgp_nexthop_onlink (afi_t afi, struct attr *attr)
 	  return 1;
 	}
     }
-#ifdef HAVE_IPV6
   else if (afi == AFI_IP6)
     {
       if (attr->extra->mp_nexthop_len == 32)
@@ -216,11 +211,9 @@ bgp_nexthop_onlink (afi_t afi, struct attr *attr)
 	    }
 	}
     }
-#endif /* HAVE_IPV6 */
   return 0;
 }
 
-#ifdef HAVE_IPV6
 /* Check specified next-hop is reachable or not. */
 static int
 bgp_nexthop_lookup_ipv6 (struct peer *peer, struct bgp_info *ri, int *changed,
@@ -305,7 +298,6 @@ bgp_nexthop_lookup_ipv6 (struct peer *peer, struct bgp_info *ri, int *changed,
 
   return bnc->valid;
 }
-#endif /* HAVE_IPV6 */
 
 /* Check specified next-hop is reachable or not. */
 int
@@ -325,10 +317,8 @@ bgp_nexthop_lookup (afi_t afi, struct peer *peer, struct bgp_info *ri,
       return 1;
     }
   
-#ifdef HAVE_IPV6
   if (afi == AFI_IP6)
     return bgp_nexthop_lookup_ipv6 (peer, ri, changed, metricchanged);
-#endif /* HAVE_IPV6 */
 
   addr = ri->attr->nexthop;
 
@@ -538,9 +528,7 @@ bgp_scan_timer (struct thread *t)
 
   bgp_scan (AFI_IP, SAFI_UNICAST);
 
-#ifdef HAVE_IPV6
   bgp_scan (AFI_IP6, SAFI_UNICAST);
-#endif /* HAVE_IPV6 */
 
   return 0;
 }
@@ -684,7 +672,6 @@ bgp_connected_add (struct connected *ifc)
 	  rn->info = bc;
 	}
     }
-#ifdef HAVE_IPV6
   else if (addr->family == AF_INET6)
     {
       apply_mask_ipv6 ((struct prefix_ipv6 *) &p);
@@ -708,7 +695,6 @@ bgp_connected_add (struct connected *ifc)
 	  rn->info = bc;
 	}
     }
-#endif /* HAVE_IPV6 */
 }
 
 void
@@ -751,7 +737,6 @@ bgp_connected_delete (struct connected *ifc)
       bgp_unlock_node (rn);
       bgp_unlock_node (rn);
     }
-#ifdef HAVE_IPV6
   else if (addr->family == AF_INET6)
     {
       apply_mask_ipv6 ((struct prefix_ipv6 *) &p);
@@ -776,7 +761,6 @@ bgp_connected_delete (struct connected *ifc)
       bgp_unlock_node (rn);
       bgp_unlock_node (rn);
     }
-#endif /* HAVE_IPV6 */
 }
 
 int
@@ -899,7 +883,6 @@ zlookup_query (struct in_addr addr)
   return zlookup_read ();
 }
 
-#ifdef HAVE_IPV6
 static struct bgp_nexthop_cache *
 zlookup_read_ipv6 (void)
 {
@@ -1002,7 +985,6 @@ zlookup_query_ipv6 (struct in6_addr *addr)
 
   return zlookup_read_ipv6 ();
 }
-#endif /* HAVE_IPV6 */
 
 static int
 bgp_import_check (struct prefix *p, u_int32_t *igpmetric,
@@ -1321,7 +1303,6 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
 		   inet_ntop (AF_INET, &rn->p.u.prefix4, buf, INET6_ADDRSTRLEN), VTY_NEWLINE);
       }
 
-#ifdef HAVE_IPV6
   {
     for (rn = bgp_table_top (bgp_nexthop_cache_table[AFI_IP6]); 
          rn; 
@@ -1353,7 +1334,6 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
 		     VTY_NEWLINE);
 	}
   }
-#endif /* HAVE_IPV6 */
 
   vty_out (vty, "BGP connected route:%s", VTY_NEWLINE);
   for (rn = bgp_table_top (bgp_connected_table[AFI_IP]); 
@@ -1363,7 +1343,6 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
       vty_out (vty, " %s/%d%s", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
 	       VTY_NEWLINE);
 
-#ifdef HAVE_IPV6
   {
     for (rn = bgp_table_top (bgp_connected_table[AFI_IP6]); 
          rn; 
@@ -1374,7 +1353,6 @@ show_ip_bgp_scan_tables (struct vty *vty, const char detail)
 		 rn->p.prefixlen,
 		 VTY_NEWLINE);
   }
-#endif /* HAVE_IPV6 */
 
   return CMD_SUCCESS;
 }
@@ -1426,12 +1404,10 @@ bgp_scan_init (void)
 
   bgp_connected_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST);
 
-#ifdef HAVE_IPV6
   cache1_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
   cache2_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
   bgp_nexthop_cache_table[AFI_IP6] = cache1_table[AFI_IP6];
   bgp_connected_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
-#endif /* HAVE_IPV6 */
 
   /* Make BGP scan thread. */
   bgp_scan_thread = thread_add_timer (bm->master, bgp_scan_timer, 
@@ -1464,7 +1440,6 @@ bgp_scan_finish (void)
     bgp_table_unlock (bgp_connected_table[AFI_IP]);
   bgp_connected_table[AFI_IP] = NULL;
 
-#ifdef HAVE_IPV6
   if (cache1_table[AFI_IP6])
     bgp_table_unlock (cache1_table[AFI_IP6]);
   cache1_table[AFI_IP6] = NULL;
@@ -1476,7 +1451,6 @@ bgp_scan_finish (void)
   if (bgp_connected_table[AFI_IP6])
     bgp_table_unlock (bgp_connected_table[AFI_IP6]);
   bgp_connected_table[AFI_IP6] = NULL;
-#endif /* HAVE_IPV6 */
 }
 
 void

+ 0 - 2
bgpd/bgp_open.c

@@ -1006,7 +1006,6 @@ bgp_open_capability (struct stream *s, struct peer *peer)
       stream_putc (s, 0);
       stream_putc (s, SAFI_ENCAP);
     }
-#ifdef HAVE_IPV6
   /* IPv6 unicast. */
   if (peer->afc[AFI_IP6][SAFI_UNICAST])
     {
@@ -1055,7 +1054,6 @@ bgp_open_capability (struct stream *s, struct peer *peer)
       stream_putc (s, 0);
       stream_putc (s, SAFI_ENCAP);
     }
-#endif /* HAVE_IPV6 */
 
   /* Route refresh. */
   SET_FLAG (peer->cap, PEER_CAP_REFRESH_ADV);

+ 0 - 4
bgpd/bgp_packet.c

@@ -449,10 +449,8 @@ bgp_default_update_send (struct peer *peer, struct attr *attr,
 
   if (afi == AFI_IP)
     str2prefix ("0.0.0.0/0", &p);
-#ifdef HAVE_IPV6
   else 
     str2prefix ("::/0", &p);
-#endif /* HAVE_IPV6 */
 
   /* Logging the attribute. */
   if (BGP_DEBUG (update, UPDATE_OUT))
@@ -518,10 +516,8 @@ bgp_default_withdraw_send (struct peer *peer, afi_t afi, safi_t safi)
 
   if (afi == AFI_IP)
     str2prefix ("0.0.0.0/0", &p);
-#ifdef HAVE_IPV6
   else 
     str2prefix ("::/0", &p);
-#endif /* HAVE_IPV6 */
 
   total_attr_len = 0;
 

File diff suppressed because it is too large
+ 15 - 198
bgpd/bgp_route.c


+ 0 - 8
bgpd/bgp_routemap.c

@@ -1710,7 +1710,6 @@ struct route_map_rule_cmd route_set_aggregator_as_cmd =
   route_set_aggregator_as_free,
 };
 
-#ifdef HAVE_IPV6
 /* `match ipv6 address IP_ACCESS_LIST' */
 
 static route_map_result_t
@@ -2071,8 +2070,6 @@ struct route_map_rule_cmd route_set_ipv6_nexthop_peer_cmd =
   route_set_ipv6_nexthop_peer_free
 };
 
-#endif /* HAVE_IPV6 */
-
 /* `set vpnv4 nexthop A.B.C.D' */
 
 static route_map_result_t
@@ -3568,8 +3565,6 @@ ALIAS (no_set_aggregator_as,
        "AS number\n"
        "IP address of aggregator\n")
 
-
-#ifdef HAVE_IPV6
 DEFUN (match_ipv6_address, 
        match_ipv6_address_cmd,
        "match ipv6 address WORD",
@@ -3737,7 +3732,6 @@ ALIAS (no_set_ipv6_nexthop_local,
        "IPv6 next-hop address\n"
        "IPv6 local address\n"
        "IPv6 address of next hop\n")
-#endif /* HAVE_IPV6 */
 
 DEFUN (set_vpnv4_nexthop,
        set_vpnv4_nexthop_cmd,
@@ -3998,7 +3992,6 @@ bgp_route_map_init (void)
   install_element (RMAP_NODE, &no_set_originator_id_cmd);
   install_element (RMAP_NODE, &no_set_originator_id_val_cmd);
 
-#ifdef HAVE_IPV6
   route_map_install_match (&route_match_ipv6_address_cmd);
   route_map_install_match (&route_match_ipv6_next_hop_cmd);
   route_map_install_match (&route_match_ipv6_address_prefix_list_cmd);
@@ -4020,7 +4013,6 @@ bgp_route_map_init (void)
   install_element (RMAP_NODE, &no_set_ipv6_nexthop_local_val_cmd);
   install_element (RMAP_NODE, &set_ipv6_nexthop_peer_cmd);
   install_element (RMAP_NODE, &no_set_ipv6_nexthop_peer_cmd);
-#endif /* HAVE_IPV6 */
 
   /* AS-Pathlimit: functionality removed, commands kept for
    * compatibility.

+ 0 - 4
bgpd/bgp_table.h

@@ -265,8 +265,6 @@ bgp_node_match_ipv4 (const struct bgp_table *table, struct in_addr *addr)
 						     addr));
 }
 
-#ifdef HAVE_IPV6
-
 /*
  * bgp_node_match_ipv6
  */
@@ -277,8 +275,6 @@ bgp_node_match_ipv6 (const struct bgp_table *table, struct in6_addr *addr)
 						     addr));
 }
 
-#endif /* HAVE_IPV6 */
-
 static inline unsigned long
 bgp_table_count (const struct bgp_table *const table)
 {

+ 6 - 94
bgpd/bgp_vty.c

@@ -107,12 +107,10 @@ bgp_parse_afi(const char *str, afi_t *afi)
 	*afi = AFI_IP;
 	return 0;
     }
-#ifdef HAVE_IPV6
     if (!strcmp(str, "ipv6")) {
 	*afi = AFI_IP6;
 	return 0;
     }
-#endif /* HAVE_IPV6 */
     return -1;
 }
 
@@ -145,10 +143,8 @@ peer_address_self_check (union sockunion *su)
 
   if (su->sa.sa_family == AF_INET)
     ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr);
-#ifdef HAVE_IPV6
   else if (su->sa.sa_family == AF_INET6)
     ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr);
-#endif /* HAVE IPV6 */
 
   if (ifp)
     return 1;
@@ -6935,7 +6931,6 @@ ALIAS (clear_bgp_as_soft,
        "Soft reconfig\n")
 
 /* RS-client soft reconfiguration. */
-#ifdef HAVE_IPV6
 DEFUN (clear_bgp_all_rsclient,
        clear_bgp_all_rsclient_cmd,
        "clear bgp * rsclient",
@@ -6981,7 +6976,6 @@ ALIAS (clear_bgp_all_rsclient,
        "view name\n"
        "Clear all peers\n"
        "Soft reconfig for rsclient RIB\n")
-#endif /* HAVE_IPV6 */
 
 DEFUN (clear_ip_bgp_all_rsclient,
        clear_ip_bgp_all_rsclient_cmd,
@@ -7011,7 +7005,6 @@ ALIAS (clear_ip_bgp_all_rsclient,
        "Clear all peers\n"
        "Soft reconfig for rsclient RIB\n")
 
-#ifdef HAVE_IPV6
 DEFUN (clear_bgp_peer_rsclient,
        clear_bgp_peer_rsclient_cmd,
        "clear bgp (A.B.C.D|X:X::X:X) rsclient",
@@ -7061,7 +7054,6 @@ ALIAS (clear_bgp_peer_rsclient,
        "BGP neighbor IP address to clear\n"
        "BGP IPv6 neighbor to clear\n"
        "Soft reconfig for rsclient RIB\n")
-#endif /* HAVE_IPV6 */
 
 DEFUN (clear_ip_bgp_peer_rsclient,
        clear_ip_bgp_peer_rsclient_cmd,
@@ -7537,8 +7529,6 @@ DEFUN (show_bgp_ipv4_vpn_summary,
   return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
 }
 
-#ifdef HAVE_IPV6
-
 /* `show ip bgp summary' commands. */
 DEFUN (show_bgp_ipv6_vpn_summary,
        show_bgp_ipv6_vpn_summary_cmd,
@@ -7551,7 +7541,6 @@ DEFUN (show_bgp_ipv6_vpn_summary,
 {
   return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_summary,
        show_bgp_ipv4_encap_summary_cmd,
@@ -7565,8 +7554,6 @@ DEFUN (show_bgp_ipv4_encap_summary,
   return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
 }
 
-#ifdef HAVE_IPV6
-
 DEFUN (show_bgp_ipv6_encap_summary,
        show_bgp_ipv6_encap_summary_cmd,
        "show bgp ipv6 encap summary",
@@ -7579,10 +7566,6 @@ DEFUN (show_bgp_ipv6_encap_summary,
   return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
 }
 
-#endif
-
-
-
 DEFUN (show_bgp_instance_summary,
        show_bgp_instance_summary_cmd,
        "show bgp view WORD summary",
@@ -7605,7 +7588,6 @@ DEFUN (show_bgp_instance_summary,
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP);
 
-#ifdef HAVE_IPV6
     vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
@@ -7618,7 +7600,7 @@ DEFUN (show_bgp_instance_summary,
     vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
-#endif
+
     return CMD_SUCCESS;
 }
 
@@ -7650,8 +7632,6 @@ DEFUN (show_bgp_instance_ipv4_summary,
     return CMD_SUCCESS;
 }
 
-
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_instance_ipv6_summary,
        show_bgp_instance_ipv6_summary_cmd,
        "show bgp view WORD ipv6 summary",
@@ -7737,7 +7717,6 @@ DEFUN (show_ipv6_mbgp_summary,
 {
   return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
 }
-#endif /* HAVE_IPV6 */
 
 /* variations of show bgp [...] summary */
 
@@ -7762,7 +7741,6 @@ DEFUN (show_bgp_summary,
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
 
-#ifdef HAVE_IPV6
     vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
@@ -7775,7 +7753,7 @@ DEFUN (show_bgp_summary,
     vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
-#endif
+
     return CMD_SUCCESS;
 }
 
@@ -7789,17 +7767,11 @@ ALIAS (show_bgp_summary,
 
 DEFUN (show_bgp_summary_1w,
        show_bgp_summary_1w_cmd,
-#ifdef HAVE_IPV6
        "show bgp (ipv4|ipv6|unicast|multicast|vpn|encap) summary",
-#else
-       "show bgp (ipv4|unicast|multicast|vpn|encap) summary",
-#endif
        SHOW_STR
        BGP_STR
        IP_STR
-#ifdef HAVE_IPV6
        IP6_STR
-#endif
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
@@ -7821,7 +7793,7 @@ DEFUN (show_bgp_summary_1w,
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
     return CMD_SUCCESS;
   }
-#ifdef HAVE_IPV6
+
   if (strcmp (argv[0], "ipv6") == 0) {
     vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
@@ -7837,53 +7809,45 @@ DEFUN (show_bgp_summary_1w,
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
     return CMD_SUCCESS;
   }
-#endif
+
   if (strcmp (argv[0], "unicast") == 0) {
     vty_out(vty, "IPv4 Unicast Summary:%s", VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
-#ifdef HAVE_IPV6
     vty_out(vty, "%s", VTY_NEWLINE);
     vty_out(vty, "IPv6 Unicast Summary:%s", VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
-#endif
     return CMD_SUCCESS;
   }
   if (strcmp (argv[0], "multicast") == 0) {
     vty_out(vty, "IPv4 Multicast Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-----------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
-#ifdef HAVE_IPV6
     vty_out(vty, "%s", VTY_NEWLINE);
     vty_out(vty, "IPv6 Multicast Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-----------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
-#endif
     return CMD_SUCCESS;
   }
   if (strcmp (argv[0], "vpn") == 0) {
     vty_out(vty, "IPv4 VPN Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-----------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
-#ifdef HAVE_IPV6
     vty_out(vty, "%s", VTY_NEWLINE);
     vty_out(vty, "IPv6 VPN Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-----------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
-#endif
     return CMD_SUCCESS;
   }
   if (strcmp (argv[0], "encap") == 0) {
     vty_out(vty, "IPv4 Encap Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
-#ifdef HAVE_IPV6
     vty_out(vty, "%s", VTY_NEWLINE);
     vty_out(vty, "IPv6 Encap Summary:%s", VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
-#endif
     return CMD_SUCCESS;
   }
   vty_out(vty, "Unknown keyword: %s%s", argv[0], VTY_NEWLINE);
@@ -8248,7 +8212,6 @@ bgp_show_peer (struct vty *vty, struct peer *p)
 	  || p->afc_recv[AFI_IP][SAFI_UNICAST]
 	  || p->afc_adv[AFI_IP][SAFI_MULTICAST]
 	  || p->afc_recv[AFI_IP][SAFI_MULTICAST]
-#ifdef HAVE_IPV6
 	  || p->afc_adv[AFI_IP6][SAFI_UNICAST]
 	  || p->afc_recv[AFI_IP6][SAFI_UNICAST]
 	  || p->afc_adv[AFI_IP6][SAFI_MULTICAST]
@@ -8257,7 +8220,6 @@ bgp_show_peer (struct vty *vty, struct peer *p)
 	  || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN]
 	  || p->afc_adv[AFI_IP6][SAFI_ENCAP]
 	  || p->afc_recv[AFI_IP6][SAFI_ENCAP]
-#endif /* HAVE_IPV6 */
 	  || p->afc_adv[AFI_IP][SAFI_ENCAP]
 	  || p->afc_recv[AFI_IP][SAFI_ENCAP]
 	  || p->afc_adv[AFI_IP][SAFI_MPLS_VPN]
@@ -8513,7 +8475,6 @@ bgp_show_peer (struct vty *vty, struct peer *p)
       vty_out (vty, "Nexthop: %s%s", 
 	       inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ),
 	       VTY_NEWLINE);
-#ifdef HAVE_IPV6
       vty_out (vty, "Nexthop global: %s%s", 
 	       inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ),
 	       VTY_NEWLINE);
@@ -8523,7 +8484,6 @@ bgp_show_peer (struct vty *vty, struct peer *p)
       vty_out (vty, "BGP connection: %s%s",
 	       p->shared_network ? "shared network" : "non shared network",
 	       VTY_NEWLINE);
-#endif /* HAVE_IPV6 */
     }
 
   /* TCP metrics. */
@@ -8815,11 +8775,7 @@ DEFUN (show_bgp_neighbors,
 
 DEFUN (show_bgp_neighbors_peer,
        show_bgp_neighbors_peer_cmd,
-#ifdef HAVE_IPV6
        "show bgp neighbors (A.B.C.D|X:X::X:X)",
-#else
-       "show bgp neighbors (A.B.C.D)",
-#endif /* HAVE_IPV6 */
        SHOW_STR
        BGP_STR
        "Detailed information on TCP and BGP neighbor connections\n"
@@ -8843,11 +8799,7 @@ DEFUN (show_bgp_instance_neighbors,
 
 DEFUN (show_bgp_instance_neighbors_peer,
        show_bgp_instance_neighbors_peer_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
-#else
-       "show bgp view WORD neighbors (A.B.C.D)",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
@@ -9189,7 +9141,6 @@ DEFUN (show_bgp_rsclient_summary,
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
 
-#ifdef HAVE_IPV6
     vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
@@ -9202,7 +9153,7 @@ DEFUN (show_bgp_rsclient_summary,
     vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
-#endif
+
     return CMD_SUCCESS;
 }
 
@@ -9229,7 +9180,6 @@ DEFUN (show_bgp_instance_rsclient_summary,
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP);
 
-#ifdef HAVE_IPV6
     vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "---------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
@@ -9242,11 +9192,10 @@ DEFUN (show_bgp_instance_rsclient_summary,
     vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
     vty_out(vty, "-------------------%s", VTY_NEWLINE);
     bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
-#endif
+
     return CMD_SUCCESS;
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_rsclient_summary,
       show_bgp_ipv6_rsclient_summary_cmd,
       "show bgp ipv6 rsclient summary",
@@ -9334,8 +9283,6 @@ ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary,
        "Information about Route Server Clients\n"
        "Summary of all Route Server Clients\n")
 
-#endif /* HAVE IPV6 */
-
 /* Redistribute VTY commands.  */
 
 DEFUN (bgp_redistribute_ipv4,
@@ -9550,7 +9497,6 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
        "Route map reference\n"
        "Pointer to route-map entries\n")
 
-#ifdef HAVE_IPV6
 DEFUN (bgp_redistribute_ipv6,
        bgp_redistribute_ipv6_cmd,
        "redistribute " QUAGGA_IP6_REDIST_STR_BGPD,
@@ -9763,7 +9709,6 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
        "Default metric\n"
        "Route map reference\n"
        "Pointer to route-map entries\n")
-#endif /* HAVE_IPV6 */
 
 int
 bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
@@ -10801,10 +10746,8 @@ bgp_vty_init (void)
   /* address-family commands. */
   install_element (BGP_NODE, &address_family_ipv4_cmd);
   install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
-#ifdef HAVE_IPV6
   install_element (BGP_NODE, &address_family_ipv6_cmd);
   install_element (BGP_NODE, &address_family_ipv6_safi_cmd);
-#endif /* HAVE_IPV6 */
   install_element (BGP_NODE, &address_family_vpnv4_cmd);
   install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd);
 
@@ -10813,9 +10756,7 @@ bgp_vty_init (void)
 
   install_element (BGP_NODE, &address_family_encap_cmd);
   install_element (BGP_NODE, &address_family_encapv4_cmd);
-#ifdef HAVE_IPV6
   install_element (BGP_NODE, &address_family_encapv6_cmd);
-#endif
 
   /* "exit-address-family" command. */
   install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
@@ -10834,7 +10775,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &clear_bgp_all_cmd);
   install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd);
@@ -10846,7 +10786,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd);
   install_element (ENABLE_NODE, &clear_bgp_as_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "clear ip bgp neighbor soft in" */
   install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd);
@@ -10895,7 +10834,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_in_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_in_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_in_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd);
   install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd);
   install_element (ENABLE_NODE, &clear_bgp_all_in_cmd);
@@ -10927,7 +10865,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "clear ip bgp neighbor soft out" */
   install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd);
@@ -10964,7 +10901,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_out_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_out_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_out_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd);
   install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd);
   install_element (ENABLE_NODE, &clear_bgp_all_out_cmd);
@@ -10986,7 +10922,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "clear ip bgp neighbor soft" */
   install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd);
@@ -11007,7 +10942,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd);
   install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd);
   install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd);
@@ -11019,14 +10953,12 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "clear ip bgp neighbor rsclient" */
   install_element (ENABLE_NODE, &clear_ip_bgp_all_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_peer_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_ip_bgp_instance_peer_rsclient_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &clear_bgp_all_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_bgp_instance_all_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_all_rsclient_cmd);
@@ -11035,7 +10967,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &clear_bgp_instance_peer_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_rsclient_cmd);
   install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_peer_rsclient_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "show ip bgp summary" commands. */
   install_element (VIEW_NODE, &show_bgp_summary_cmd);
@@ -11052,51 +10983,39 @@ bgp_vty_init (void)
 
   install_element (VIEW_NODE, &show_bgp_ipv4_vpn_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv4_encap_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_ipv6_vpn_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_encap_summary_cmd);
-#endif
 
   install_element (VIEW_NODE, &show_bgp_instance_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
-#endif /* HAVE_IPV6 */
   install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_summary_cmd);
 
   install_element (RESTRICTED_NODE, &show_bgp_ipv4_vpn_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv4_encap_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_summary_cmd);
-#endif
 
   install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
-#endif /* HAVE_IPV6 */
   install_element (ENABLE_NODE, &show_bgp_ipv4_safi_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv4_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv4_safi_summary_cmd);
 
   install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv4_encap_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_encap_summary_cmd);
-#endif
 
   install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "show ip bgp neighbors" commands. */
   install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd);
@@ -11110,15 +11029,12 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &show_bgp_neighbors_cmd);
   install_element (ENABLE_NODE, &show_bgp_neighbors_peer_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_neighbors_peer_cmd);
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
 
-#endif /* HAVE_IPV6 */
-
   /* "show ip bgp rsclient" commands. */
   install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd);
@@ -11133,7 +11049,6 @@ bgp_vty_init (void)
   install_element (RESTRICTED_NODE, &show_bgp_instance_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_rsclient_summary_cmd);
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
@@ -11146,7 +11061,6 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd);
-#endif /* HAVE_IPV6 */
 
   /* "show ip bgp paths" commands. */
   install_element (VIEW_NODE, &show_bgp_ipv4_paths_cmd);
@@ -11171,7 +11085,6 @@ bgp_vty_init (void)
   install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd);
   install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd);
   install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd);
-#ifdef HAVE_IPV6
   install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd);
   install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd);
   install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd);
@@ -11182,7 +11095,6 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd);
   install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd);
   install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd);
-#endif /* HAVE_IPV6 */
 
   /* ttl_security commands */
   install_element (BGP_NODE, &neighbor_ttl_security_cmd);

+ 2 - 16
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);
 }

+ 0 - 2
bgpd/bgp_zebra.h

@@ -44,9 +44,7 @@ extern int bgp_redistribute_metric_unset (struct bgp *, afi_t, int);
 
 extern struct interface *if_lookup_by_ipv4 (struct in_addr *);
 extern struct interface *if_lookup_by_ipv4_exact (struct in_addr *);
-#ifdef HAVE_IPV6
 extern struct interface *if_lookup_by_ipv6 (struct in6_addr *);
 extern struct interface *if_lookup_by_ipv6_exact (struct in6_addr *);
-#endif /* HAVE_IPV6 */
 
 #endif /* _QUAGGA_BGP_ZEBRA_H */

+ 0 - 2
bgpd/bgpd.h

@@ -205,10 +205,8 @@ struct bgp_nexthop
 {
   struct interface *ifp;
   struct in_addr v4;
-#ifdef HAVE_IPV6
   struct in6_addr v6_global;
   struct in6_addr v6_local;
-#endif /* HAVE_IPV6 */  
 };
 
 /* BGP router distinguisher value.  */