Signed-off-by: Lou Berger <[email protected]>
---
 bgpd/bgp_attr.c     |  17 +----
 bgpd/bgp_attr.h     |   2 -
 bgpd/bgp_debug.c    |   2 -
 bgpd/bgp_encap.c    |  31 +++-----
 bgpd/bgp_mpath.c    |   4 -
 bgpd/bgp_mplsvpn.c  |   8 --
 bgpd/bgp_network.c  |  51 -------------
 bgpd/bgp_nexthop.c  |  26 -------
 bgpd/bgp_open.c     |   4 -
 bgpd/bgp_packet.c   |   4 -
 bgpd/bgp_route.c    | 213 ++++------------------------------------------------
 bgpd/bgp_routemap.c |  10 ---
 bgpd/bgp_table.h    |   4 -
 bgpd/bgp_vty.c      | 100 ++----------------------
 bgpd/bgp_zebra.c    |  18 +----
 bgpd/bgp_zebra.h    |   2 -
 bgpd/bgpd.h         |   2 -
 17 files changed, 33 insertions(+), 465 deletions(-)

diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 2de5836..731d704 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -510,11 +510,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;
@@ -541,11 +539,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
@@ -695,9 +691,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;
 }
@@ -756,9 +750,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);
@@ -1657,7 +1650,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));
@@ -1704,7 +1696,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);
@@ -2433,7 +2424,6 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, 
safi_t safi,
          break;
        }
       break;
-#ifdef HAVE_IPV6
     case AFI_IP6:
       switch (safi)
       {
@@ -2479,7 +2469,6 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, 
safi_t safi,
        break;
       }
       break;
-#endif /*HAVE_IPV6*/
     default:
       break;
     }
@@ -3062,9 +3051,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);
@@ -3128,7 +3115,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) )
@@ -3160,7 +3146,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;
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 6a134de..fe6c2a1 100644
--- a/bgpd/bgp_attr.h
+++ b/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;
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 1d09769..b9753bb 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -174,7 +174,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];
@@ -191,7 +190,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",
diff --git a/bgpd/bgp_encap.c b/bgpd/bgp_encap.c
index d5aadf8..458933f 100644
--- a/bgpd/bgp_encap.c
+++ b/bgpd/bgp_encap.c
@@ -510,7 +510,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",
@@ -521,7 +521,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,
@@ -544,7 +543,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",
@@ -567,7 +566,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,
@@ -580,7 +578,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",
@@ -592,7 +590,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,
@@ -616,7 +614,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",
@@ -639,7 +637,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,
@@ -671,7 +668,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",
@@ -702,7 +699,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,
@@ -746,7 +742,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",
@@ -789,7 +785,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,
@@ -821,7 +816,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",
@@ -852,7 +847,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,
@@ -895,7 +889,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",
@@ -937,7 +931,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
-
 
 }
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 7999d16..3164f19 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -120,7 +120,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);
@@ -132,7 +131,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 */
         }
     }
 
@@ -715,10 +713,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? */
 
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 3d92397..e5f52b3 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -589,7 +589,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",
@@ -600,7 +599,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,
@@ -748,7 +746,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",
@@ -782,7 +779,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,
@@ -1025,7 +1021,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);
@@ -1034,7 +1029,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);
@@ -1045,7 +1039,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);
@@ -1054,5 +1047,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
 }
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 511a0fe..dae60cc 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -386,10 +386,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
@@ -403,10 +401,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",
@@ -454,10 +450,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);
@@ -490,7 +484,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)
 {
@@ -547,50 +540,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)
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index d3e5821..52d58e9 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -42,9 +42,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;
@@ -132,7 +130,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;
@@ -144,7 +141,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;
@@ -196,7 +192,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)
@@ -215,11 +210,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,
@@ -304,7 +297,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
@@ -324,10 +316,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;
 
@@ -536,9 +526,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;
 }
@@ -681,7 +669,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);
@@ -705,7 +692,6 @@ bgp_connected_add (struct connected *ifc)
          rn->info = bc;
        }
     }
-#endif /* HAVE_IPV6 */
 }
 
 void
@@ -748,7 +734,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);
@@ -773,7 +758,6 @@ bgp_connected_delete (struct connected *ifc)
       bgp_unlock_node (rn);
       bgp_unlock_node (rn);
     }
-#endif /* HAVE_IPV6 */
 }
 
 int
@@ -896,7 +880,6 @@ zlookup_query (struct in_addr addr)
   return zlookup_read ();
 }
 
-#ifdef HAVE_IPV6
 static struct bgp_nexthop_cache *
 zlookup_read_ipv6 (void)
 {
@@ -999,7 +982,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,
@@ -1318,7 +1300,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; 
@@ -1350,7 +1331,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]); 
@@ -1360,7 +1340,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; 
@@ -1371,7 +1350,6 @@ show_ip_bgp_scan_tables (struct vty *vty, const char 
detail)
                 rn->p.prefixlen,
                 VTY_NEWLINE);
   }
-#endif /* HAVE_IPV6 */
 
   return CMD_SUCCESS;
 }
@@ -1423,12 +1401,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, 
@@ -1461,7 +1437,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;
@@ -1473,7 +1448,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
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index eadc090..db8f3cd 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -130,9 +130,7 @@ bgp_afi_safi_valid_indices (afi_t afi, safi_t *safi)
   switch (afi)
     {
       case AFI_IP:
-#ifdef HAVE_IPV6
       case AFI_IP6:
-#endif
         switch (*safi)
           {
             /* BGP MPLS-labeled VPN SAFI isn't contigious with others, remap */
@@ -972,7 +970,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])
     {
@@ -1021,7 +1018,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);
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 4931552..89a20dd 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -448,10 +448,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))
@@ -517,10 +515,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;
 
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 74ba73f..50b951c 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -847,10 +847,8 @@ bgp_announce_check (struct bgp_info *ri, struct peer 
*peer, struct prefix *p,
     {
       if (p->family == AF_INET && p->u.prefix4.s_addr == INADDR_ANY)
        return 0;
-#ifdef HAVE_IPV6
       else if (p->family == AF_INET6 && p->prefixlen == 0)
        return 0;
-#endif /* HAVE_IPV6 */
     }
 
   /* Transparency check. */
@@ -994,31 +992,25 @@ bgp_announce_check (struct bgp_info *ri, struct peer 
*peer, struct prefix *p,
     (safi != SAFI_ENCAP && p->family == AF_INET) || \
     (safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 4))
 
-#ifdef HAVE_IPV6
 #define NEXTHOP_IS_V6 (\
     (safi != SAFI_ENCAP && p->family == AF_INET6) || \
     (safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 16))
-#endif
 
   /* next-hop-set */
   if (transparent
       || (reflect && ! CHECK_FLAG (peer->af_flags[afi][safi], 
PEER_FLAG_NEXTHOP_SELF_ALL))
       || (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)
          && ((NEXTHOP_IS_V4 && attr->nexthop.s_addr)
-#ifdef HAVE_IPV6
              || (NEXTHOP_IS_V6 && 
                   ! IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
              )))
     {
       /* NEXT-HOP Unchanged. */
     }
   else if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF)
           || (NEXTHOP_IS_V4 && attr->nexthop.s_addr == 0)
-#ifdef HAVE_IPV6
           || (NEXTHOP_IS_V6 && 
                IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
           || (peer->sort == BGP_PEER_EBGP
               && bgp_multiaccess_check_v4 (attr->nexthop, peer->host) == 0))
     {
@@ -1031,7 +1023,6 @@ bgp_announce_check (struct bgp_info *ri, struct peer 
*peer, struct prefix *p,
          else
            memcpy (&attr->nexthop, &peer->nexthop.v4, IPV4_MAX_BYTELEN);
        }
-#ifdef HAVE_IPV6
       /* Set IPv6 nexthop. */
       if (NEXTHOP_IS_V6)
        {
@@ -1040,10 +1031,8 @@ bgp_announce_check (struct bgp_info *ri, struct peer 
*peer, struct prefix *p,
                  IPV6_MAX_BYTELEN);
          attr->extra->mp_nexthop_len = 16;
        }
-#endif /* HAVE_IPV6 */
     }
 
-#ifdef HAVE_IPV6
   if (p->family == AF_INET6 && safi != SAFI_ENCAP)
     {
       /* Left nexthop_local unchanged if so configured. */ 
@@ -1082,7 +1071,6 @@ bgp_announce_check (struct bgp_info *ri, struct peer 
*peer, struct prefix *p,
     }
 
     }
-#endif /* HAVE_IPV6 */
 
   /* If this is EBGP peer and remove-private-AS is set.  */
   if (peer->sort == BGP_PEER_EBGP
@@ -1163,10 +1151,8 @@ bgp_announce_check_rsclient (struct bgp_info *ri, struct 
peer *rsclient,
     {
       if (p->family == AF_INET && p->u.prefix4.s_addr == INADDR_ANY)
         return 0;
-#ifdef HAVE_IPV6
       else if (p->family == AF_INET6 && p->prefixlen == 0)
         return 0;
-#endif /* HAVE_IPV6 */
     }
 
   /* If the attribute has originator-id and it is same as remote
@@ -1225,10 +1211,8 @@ bgp_announce_check_rsclient (struct bgp_info *ri, struct 
peer *rsclient,
 
   /* next-hop-set */
   if ((p->family == AF_INET && attr->nexthop.s_addr == 0)
-#ifdef HAVE_IPV6
           || (p->family == AF_INET6 &&
               IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
      )
   {
     /* Set IPv4 nexthop. */
@@ -1240,7 +1224,6 @@ bgp_announce_check_rsclient (struct bgp_info *ri, struct 
peer *rsclient,
         else
           memcpy (&attr->nexthop, &rsclient->nexthop.v4, IPV4_MAX_BYTELEN);
       }
-#ifdef HAVE_IPV6
     /* Set IPv6 nexthop. */
     if (p->family == AF_INET6)
       {
@@ -1249,10 +1232,8 @@ bgp_announce_check_rsclient (struct bgp_info *ri, struct 
peer *rsclient,
                 IPV6_MAX_BYTELEN);
         attr->extra->mp_nexthop_len = 16;
       }
-#endif /* HAVE_IPV6 */
   }
 
-#ifdef HAVE_IPV6
   if (p->family == AF_INET6)
     {
       struct attr_extra *attre = attr->extra;
@@ -1294,8 +1275,6 @@ bgp_announce_check_rsclient (struct bgp_info *ri, struct 
peer *rsclient,
         }
 
     }
-#endif /* HAVE_IPV6 */
-
 
   /* If this is EBGP peer and remove-private-AS is set.  */
   if (rsclient->sort == BGP_PEER_EBGP
@@ -2565,7 +2544,6 @@ bgp_default_originate (struct peer *peer, afi_t afi, 
safi_t safi, int withdraw)
 
   if (afi == AFI_IP)
     str2prefix ("0.0.0.0/0", &p);
-#ifdef HAVE_IPV6
   else if (afi == AFI_IP6)
     {
       struct attr_extra *ae = attr.extra;
@@ -2587,7 +2565,6 @@ bgp_default_originate (struct peer *peer, afi_t afi, 
safi_t safi, int withdraw)
          ae->mp_nexthop_len = 32;
        }
     }
-#endif /* HAVE_IPV6 */
 
   if (peer->default_rmap[afi][safi].name)
     {
@@ -3289,7 +3266,6 @@ bgp_nlri_parse (struct peer *peer, struct attr *attr, 
struct bgp_nlri *packet)
            }
        }
 
-#ifdef HAVE_IPV6
       /* Check address. */
       if (packet->afi == AFI_IP6 && packet->safi == SAFI_UNICAST)
        {
@@ -3304,7 +3280,6 @@ bgp_nlri_parse (struct peer *peer, struct attr *attr, 
struct bgp_nlri *packet)
              continue;
            }
        }
-#endif /* HAVE_IPV6 */
 
       /* Normal process. */
       if (attr)
@@ -3958,14 +3933,12 @@ bgp_static_set (struct vty *vty, struct bgp *bgp, const 
char *ip_str,
       vty_out (vty, "%% Malformed prefix%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
-#ifdef HAVE_IPV6
   if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
     {
       vty_out (vty, "%% Malformed prefix (link-local address)%s",
               VTY_NEWLINE);
       return CMD_WARNING;
     }
-#endif /* HAVE_IPV6 */
 
   apply_mask (&p);
 
@@ -4051,14 +4024,12 @@ bgp_static_unset (struct vty *vty, struct bgp *bgp, 
const char *ip_str,
       vty_out (vty, "%% Malformed prefix%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
-#ifdef HAVE_IPV6
   if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
     {
       vty_out (vty, "%% Malformed prefix (link-local address)%s",
               VTY_NEWLINE);
       return CMD_WARNING;
     }
-#endif /* HAVE_IPV6 */
 
   apply_mask (&p);
 
@@ -4556,7 +4527,6 @@ ALIAS (no_bgp_network_mask_natural,
        "Network number\n"
        "Specify a BGP backdoor route\n")
 
-#ifdef HAVE_IPV6
 DEFUN (ipv6_bgp_network,
        ipv6_bgp_network_cmd,
        "network X:X::X:X/M",
@@ -4614,7 +4584,6 @@ ALIAS (no_ipv6_bgp_network,
        BGP_STR
        "Specify a network to announce via BGP\n"
        "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
-#endif /* HAVE_IPV6 */
 
 /* stubs for removed AS-Pathlimit commands, kept for config compatibility */
 ALIAS_DEPRECATED (bgp_network,
@@ -4721,7 +4690,6 @@ ALIAS_DEPRECATED (no_bgp_network_mask_natural,
        "Specify a BGP backdoor route\n"
        "AS-Path hopcount limit attribute\n"
        "AS-Pathlimit TTL, in number of AS-Path hops\n")
-#ifdef HAVE_IPV6
 ALIAS_DEPRECATED (ipv6_bgp_network,
        ipv6_bgp_network_ttl_cmd,
        "network X:X::X:X/M pathlimit <0-255>",
@@ -4737,7 +4705,6 @@ ALIAS_DEPRECATED (no_ipv6_bgp_network,
        "IPv6 prefix <network>/<length>\n"
        "AS-Path hopcount limit attribute\n"
        "AS-Pathlimit TTL, in number of AS-Path hops\n")
-#endif /* HAVE_IPV6 */
 
 /* Aggreagete address:
 
@@ -5565,7 +5532,6 @@ ALIAS (no_aggregate_address_mask,
        "Filter more specific routes from updates\n"
        "Generate AS set path information\n")
 
-#ifdef HAVE_IPV6
 DEFUN (ipv6_aggregate_address,
        ipv6_aggregate_address_cmd,
        "aggregate-address X:X::X:X/M",
@@ -5642,7 +5608,6 @@ ALIAS (no_ipv6_aggregate_address_summary_only,
        "Configure BGP aggregate entries\n"
        "Aggregate prefix\n"
        "Filter more specific routes from updates\n")
-#endif /* HAVE_IPV6 */
 
 /* Redistribute route treatment. */
 void
@@ -5666,14 +5631,12 @@ bgp_redistribute_add (struct prefix *p, const struct 
in_addr *nexthop,
   if (nexthop)
     attr.nexthop = *nexthop;
 
-#ifdef HAVE_IPV6
   if (nexthop6)
     {
       struct attr_extra *extra = bgp_attr_extra_get(&attr);
       extra->mp_nexthop_global = *nexthop6;
       extra->mp_nexthop_len = 16;
     }
-#endif
 
   attr.med = metric;
   attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC);
@@ -5962,13 +5925,10 @@ route_vty_out(
                    vty_out (vty, "%s", inet_ntop(af,
                        &attr->extra->mp_nexthop_global_in, buf, BUFSIZ));
                    break;
-#if HAVE_IPV6
                case AF_INET6:
                    vty_out (vty, "%s", inet_ntop(af,
                        &attr->extra->mp_nexthop_global, buf, BUFSIZ));
                    break;
-#endif
-
                default:
                    vty_out(vty, "?");
            }
@@ -5981,7 +5941,6 @@ route_vty_out(
            {
                vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
            }
-#ifdef HAVE_IPV6      
          else if (p->family == AF_INET6)
            {
              int len;
@@ -5996,7 +5955,6 @@ route_vty_out(
              else
                vty_out (vty, "%*s", len, " ");
            }
-#endif /* HAVE_IPV6 */
          else
           {
             vty_out(vty, "?");
@@ -6054,7 +6012,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p,
          else
            vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
        }
-#ifdef HAVE_IPV6
       else if (p->family == AF_INET6)
         {
           int len;
@@ -6071,7 +6028,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p,
           else
             vty_out (vty, "%*s", len, " ");
         }
-#endif /* HAVE_IPV6 */
 
       if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
        vty_out (vty, "%10u ", attr->med);
@@ -6127,7 +6083,6 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
          else
            vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
        }
-#ifdef HAVE_IPV6      
       else if (p->family == AF_INET6)
        {
          assert (attr->extra);
@@ -6145,7 +6100,6 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
                                buf1, BUFSIZ));
          
        }
-#endif /* HAVE_IPV6 */
     }
 
   label = decode_label (binfo->extra->tag);
@@ -6308,7 +6262,6 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, 
struct prefix *p,
                   inet_ntoa (attr->extra->mp_nexthop_global_in) :
                   inet_ntoa (attr->nexthop));
        }
-#ifdef HAVE_IPV6
       else
        {
          assert (attr->extra);
@@ -6316,7 +6269,6 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, 
struct prefix *p,
                   inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
                              buf, INET6_ADDRSTRLEN));
        }
-#endif /* HAVE_IPV6 */
 
       if (binfo->peer == bgp->peer_self)
        {
@@ -6342,7 +6294,6 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, 
struct prefix *p,
        }
       vty_out (vty, "%s", VTY_NEWLINE);
 
-#ifdef HAVE_IPV6
       /* display nexthop local */
       if (attr->extra && attr->extra->mp_nexthop_len == 32)
        {
@@ -6351,7 +6302,6 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, 
struct prefix *p,
                              buf, INET6_ADDRSTRLEN),
                   VTY_NEWLINE);
        }
-#endif /* HAVE_IPV6 */
 
       /* Line 3 display Origin, Med, Locpref, Weight, valid, Int/Ext/Local, 
Atomic, best */
       vty_out (vty, "      Origin %s", bgp_origin_long_str[attr->origin]);
@@ -7227,7 +7177,6 @@ DEFUN (show_bgp_ipv4_vpn_route,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_vpn_route,
        show_bgp_ipv6_vpn_route_cmd,
        "show bgp ipv6 vpn X:X::X:X",
@@ -7239,7 +7188,6 @@ DEFUN (show_bgp_ipv6_vpn_route,
 {
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MPLS_VPN, NULL, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_vpn_rd_route,
        show_bgp_ipv4_vpn_rd_route_cmd,
@@ -7299,7 +7247,6 @@ DEFUN (show_bgp_ipv4_encap_route,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_ENCAP, NULL, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_encap_route,
        show_bgp_ipv6_encap_route_cmd,
        "show bgp ipv6 encap X:X::X:X",
@@ -7311,7 +7258,6 @@ DEFUN (show_bgp_ipv6_encap_route,
 {
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_ENCAP, NULL, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_safi_rd_route,
        show_bgp_ipv4_safi_rd_route_cmd,
@@ -7342,7 +7288,6 @@ DEFUN (show_bgp_ipv4_safi_rd_route,
   return bgp_show_route (vty, NULL, argv[2], AFI_IP, safi, &prd, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_rd_route,
        show_bgp_ipv6_safi_rd_route_cmd,
        "show bgp ipv6 (encap|vpn) rd ASN:nn_or_IP-address:nn X:X::X:X",
@@ -7371,7 +7316,6 @@ DEFUN (show_bgp_ipv6_safi_rd_route,
     }
   return bgp_show_route (vty, NULL, argv[2], AFI_IP6, SAFI_ENCAP, &prd, 0);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_prefix,
        show_bgp_ipv4_prefix_cmd,
@@ -7412,7 +7356,6 @@ DEFUN (show_bgp_ipv4_vpn_prefix,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 1);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_vpn_prefix,
        show_bgp_ipv6_vpn_prefix_cmd,
        "show bgp ipv6 vpn X:X::X:X/M",
@@ -7424,7 +7367,6 @@ DEFUN (show_bgp_ipv6_vpn_prefix,
 {
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MPLS_VPN, NULL, 1);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_encap_prefix,
        show_bgp_ipv4_encap_prefix_cmd,
@@ -7439,7 +7381,6 @@ DEFUN (show_bgp_ipv4_encap_prefix,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_ENCAP, NULL, 1);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_encap_prefix,
        show_bgp_ipv6_encap_prefix_cmd,
        "show bgp ipv6 encap X:X::X:X/M",
@@ -7452,7 +7393,6 @@ DEFUN (show_bgp_ipv6_encap_prefix,
 {
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_ENCAP, NULL, 1);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_safi_rd_prefix,
        show_bgp_ipv4_safi_rd_prefix_cmd,
@@ -7484,7 +7424,6 @@ DEFUN (show_bgp_ipv4_safi_rd_prefix,
   return bgp_show_route (vty, NULL, argv[2], AFI_IP, safi, &prd, 1);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_rd_prefix,
        show_bgp_ipv6_safi_rd_prefix_cmd,
        "show bgp ipv6 (encap|vpn) rd ASN:nn_or_IP-address:nn X:X::X:X/M",
@@ -7514,7 +7453,6 @@ DEFUN (show_bgp_ipv6_safi_rd_prefix,
     }
   return bgp_show_route (vty, NULL, argv[2], AFI_IP6, safi, &prd, 1);
 }
-#endif
 
 DEFUN (show_bgp_afi_safi_view,
        show_bgp_afi_safi_view_cmd,
@@ -7632,7 +7570,6 @@ DEFUN (show_bgp_afi,
                    NULL);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi,
        show_bgp_ipv6_safi_cmd,
        "show bgp ipv6 (unicast|multicast)",
@@ -7867,9 +7804,6 @@ DEFUN (show_bgp_view_ipv6_prefix,
   return bgp_show_route (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, NULL, 
1); 
 }
 
-#endif
-
-
 static int
 bgp_show_regexp (struct vty *vty, int argc, const char **argv, afi_t afi,
                 safi_t safi, enum bgp_show_type type)
@@ -7974,7 +7908,6 @@ DEFUN (show_ip_bgp_ipv4_regexp,
                          bgp_show_type_regexp);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_regexp, 
        show_bgp_regexp_cmd,
        "show bgp regexp .LINE",
@@ -8014,7 +7947,6 @@ DEFUN (show_ipv6_mbgp_regexp,
   return bgp_show_regexp (vty, argc, argv, AFI_IP6, SAFI_MULTICAST,
                          bgp_show_type_regexp);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_safi_flap_regexp,
        show_bgp_ipv4_safi_flap_regexp_cmd,
@@ -8055,7 +7987,6 @@ ALIAS (show_bgp_ipv4_safi_flap_regexp,
        "Display routes matching the AS path regular expression\n"
        "A regular-expression to match the BGP AS paths\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_flap_regexp,
        show_bgp_ipv6_safi_flap_regexp_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics regexp 
.LINE",
@@ -8094,7 +8025,6 @@ ALIAS (show_bgp_ipv6_safi_flap_regexp,
        "Display flap statistics of routes\n"
        "Display routes matching the AS path regular expression\n"
        "A regular-expression to match the BGP AS paths\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_regexp, 
        show_bgp_ipv4_safi_regexp_cmd,
@@ -8118,7 +8048,7 @@ DEFUN (show_bgp_ipv4_safi_regexp,
   return bgp_show_regexp (vty, argc-1, argv+1, AFI_IP, safi,
                          bgp_show_type_regexp);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_regexp, 
        show_bgp_ipv6_safi_regexp_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) regexp .LINE",
@@ -8155,8 +8085,6 @@ DEFUN (show_bgp_ipv6_regexp,
                          bgp_show_type_regexp);
 }
 
-#endif /* HAVE_IPV6 */
-
 static int
 bgp_show_prefix_list (struct vty *vty, const char *prefix_list_str, afi_t afi,
                      safi_t safi, enum bgp_show_type type)
@@ -8231,7 +8159,6 @@ DEFUN (show_ip_bgp_ipv4_prefix_list,
                               bgp_show_type_prefix_list);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_prefix_list, 
        show_bgp_prefix_list_cmd,
        "show bgp prefix-list WORD",
@@ -8280,7 +8207,6 @@ DEFUN (show_ipv6_mbgp_prefix_list,
   return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
                               bgp_show_type_prefix_list);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_prefix_list, 
        show_bgp_ipv4_prefix_list_cmd,
@@ -8333,7 +8259,6 @@ ALIAS (show_bgp_ipv4_safi_flap_prefix_list,
        "Display routes conforming to the prefix-list\n"
        "IP prefix-list name\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_flap_prefix_list, 
        show_bgp_ipv6_safi_flap_prefix_list_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics 
prefix-list WORD",
@@ -8370,7 +8295,6 @@ ALIAS (show_bgp_ipv6_safi_flap_prefix_list,
        "Display flap statistics of routes\n"
        "Display routes conforming to the prefix-list\n"
        "IP prefix-list name\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_prefix_list, 
        show_bgp_ipv4_safi_prefix_list_cmd,
@@ -8393,7 +8317,7 @@ DEFUN (show_bgp_ipv4_safi_prefix_list,
   return bgp_show_prefix_list (vty, argv[1], AFI_IP, safi,
                               bgp_show_type_prefix_list);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_prefix_list, 
        show_bgp_ipv6_safi_prefix_list_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) prefix-list WORD",
@@ -8416,8 +8340,6 @@ DEFUN (show_bgp_ipv6_safi_prefix_list,
                               bgp_show_type_prefix_list);
 }
 
-#endif /* HAVE_IPV6 */
-
 static int
 bgp_show_filter_list (struct vty *vty, const char *filter, afi_t afi,
                      safi_t safi, enum bgp_show_type type)
@@ -8492,7 +8414,6 @@ DEFUN (show_ip_bgp_ipv4_filter_list,
                               bgp_show_type_filter_list);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_filter_list, 
        show_bgp_filter_list_cmd,
        "show bgp filter-list WORD",
@@ -8532,7 +8453,6 @@ DEFUN (show_ipv6_mbgp_filter_list,
   return bgp_show_filter_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
                               bgp_show_type_filter_list);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_ip_bgp_dampening_info,
        show_ip_bgp_dampening_params_cmd,
@@ -8598,7 +8518,6 @@ ALIAS (show_bgp_ipv4_safi_flap_filter_list,
        "Display routes conforming to the filter-list\n"
        "Regular expression access list name\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_flap_filter_list, 
        show_bgp_ipv6_safi_flap_filter_list_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics 
filter-list WORD",
@@ -8636,7 +8555,6 @@ ALIAS (show_bgp_ipv6_safi_flap_filter_list,
        "Display flap statistics of routes\n"
        "Display routes conforming to the filter-list\n"
        "Regular expression access list name\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_filter_list, 
        show_bgp_ipv4_safi_filter_list_cmd,
@@ -8659,7 +8577,7 @@ DEFUN (show_bgp_ipv4_safi_filter_list,
   return bgp_show_filter_list (vty, argv[1], AFI_IP, safi,
                                 bgp_show_type_filter_list);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_filter_list, 
        show_bgp_ipv6_safi_filter_list_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) filter-list WORD",
@@ -8695,8 +8613,6 @@ DEFUN (show_bgp_ipv6_filter_list,
                               bgp_show_type_filter_list);
 }
 
-#endif /* HAVE_IPV6 */
-
 static int
 bgp_show_route_map (struct vty *vty, const char *rmap_str, afi_t afi,
                    safi_t safi, enum bgp_show_type type)
@@ -8869,7 +8785,6 @@ DEFUN (show_ip_bgp_ipv4_community_all,
                   bgp_show_type_community_all, NULL);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_community_all,
        show_bgp_community_all_cmd,
        "show bgp community",
@@ -8914,7 +8829,6 @@ DEFUN (show_ipv6_mbgp_community_all,
   return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST,
                   bgp_show_type_community_all, NULL);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_route_map, 
        show_bgp_ipv4_route_map_cmd,
@@ -8966,7 +8880,7 @@ ALIAS (show_bgp_ipv4_safi_flap_route_map,
        "Display flap statistics of routes\n"
        "Display routes matching the route-map\n"
        "A route-map to match on\n")
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_flap_route_map, 
        show_bgp_ipv6_safi_flap_route_map_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics route-map 
WORD",
@@ -9003,7 +8917,6 @@ ALIAS (show_bgp_ipv6_safi_flap_route_map,
        "Display flap statistics of routes\n"
        "Display routes matching the route-map\n"
        "A route-map to match on\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_route_map, 
        show_bgp_ipv4_safi_route_map_cmd,
@@ -9026,7 +8939,7 @@ DEFUN (show_bgp_ipv4_safi_route_map,
   return bgp_show_route_map (vty, argv[1], AFI_IP, safi,
                             bgp_show_type_route_map);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_route_map, 
        show_bgp_ipv6_safi_route_map_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) route-map WORD",
@@ -9061,7 +8974,6 @@ DEFUN (show_bgp_ipv6_route_map,
   return bgp_show_route_map (vty, argv[0], AFI_IP6, SAFI_UNICAST,
                             bgp_show_type_route_map);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_cidr_only,
        show_bgp_ipv4_cidr_only_cmd,
@@ -9132,17 +9044,11 @@ DEFUN (show_bgp_ipv4_safi_cidr_only,
 /* new046 */
 DEFUN (show_bgp_afi_safi_community_all,
        show_bgp_afi_safi_community_all_cmd,
-#ifdef HAVE_IPV6
        "show bgp (ipv4|ipv6) (encap|multicast|unicast|vpn) community",
-#else
-       "show bgp ipv4 (encap|multicast|unicast|vpn) community",
-#endif
        SHOW_STR
        BGP_STR
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
@@ -9165,17 +9071,11 @@ DEFUN (show_bgp_afi_safi_community_all,
 }
 DEFUN (show_bgp_afi_community_all,
        show_bgp_afi_community_all_cmd,
-#ifdef HAVE_IPV6
        "show bgp (ipv4|ipv6) community",
-#else
-       "show bgp ipv4 community",
-#endif
        SHOW_STR
        BGP_STR
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Display routes matching the communities\n")
 {
   afi_t                afi;
@@ -9589,7 +9489,6 @@ ALIAS (show_ip_bgp_ipv4_community_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_community,
        show_bgp_community_cmd,
        "show bgp community (AA:NN|local-AS|no-advertise|no-export)",
@@ -10207,7 +10106,6 @@ ALIAS (show_ipv6_mbgp_community_exact,
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_community,
        show_bgp_ipv4_community_cmd,
@@ -10372,19 +10270,13 @@ ALIAS (show_bgp_ipv4_safi_community,
 
 DEFUN (show_bgp_view_afi_safi_community_all,
        show_bgp_view_afi_safi_community_all_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Display routes matching the communities\n")
@@ -10401,31 +10293,20 @@ DEFUN (show_bgp_view_afi_safi_community_all,
       return CMD_WARNING;
     }
 
-#ifdef HAVE_IPV6
   afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
   safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#else
-  afi = AFI_IP;
-  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#endif
   return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL);
 }
 
 DEFUN (show_bgp_view_afi_safi_community,
        show_bgp_view_afi_safi_community_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export)",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export)",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address family modifier\n"
        "Address family modifier\n"
        "Display routes matching the communities\n"
@@ -10437,32 +10318,20 @@ DEFUN (show_bgp_view_afi_safi_community,
   int afi;
   int safi;
 
-#ifdef HAVE_IPV6
   afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
   safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
   return bgp_show_community (vty, argv[0], argc-3, &argv[3], 0, afi, safi);
-#else
-  afi = AFI_IP;
-  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  return bgp_show_community (vty, argv[0], argc-2, &argv[2], 0, afi, safi);
-#endif
 }
 
 ALIAS (show_bgp_view_afi_safi_community,
        show_bgp_view_afi_safi_community2_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address family modifier\n"
        "Address family modifier\n"
        "Display routes matching the communities\n"
@@ -10477,19 +10346,13 @@ ALIAS (show_bgp_view_afi_safi_community,
 
 ALIAS (show_bgp_view_afi_safi_community,
        show_bgp_view_afi_safi_community3_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address family modifier\n"
        "Address family modifier\n"
        "Display routes matching the communities\n"
@@ -10508,19 +10371,13 @@ ALIAS (show_bgp_view_afi_safi_community,
 
 ALIAS (show_bgp_view_afi_safi_community,
        show_bgp_view_afi_safi_community4_cmd,
-#ifdef HAVE_IPV6
        "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community 
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export) 
(AA:NN|local-AS|no-advertise|no-export)",
-#endif
        SHOW_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
        "Address family\n"
-#ifdef HAVE_IPV6
        "Address family\n"
-#endif
        "Address family modifier\n"
        "Address family modifier\n"
        "Display routes matching the communities\n"
@@ -10710,8 +10567,6 @@ ALIAS (show_bgp_ipv4_safi_community4_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 
-
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_community,
        show_bgp_ipv6_safi_community_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) community 
(AA:NN|local-AS|no-advertise|no-export)",
@@ -10912,8 +10767,6 @@ ALIAS (show_bgp_community_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 
-#endif /* HAVE_IPV6 */
-
 static int
 bgp_show_community_list (struct vty *vty, const char *com, int exact,
                         afi_t afi, safi_t safi)
@@ -10999,7 +10852,6 @@ DEFUN (show_ip_bgp_ipv4_community_list_exact,
   return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_community_list,
        show_bgp_community_list_cmd,
        "show bgp community-list (<1-500>|WORD)",
@@ -11099,7 +10951,6 @@ DEFUN (show_ipv6_mbgp_community_list_exact,
 {
   return bgp_show_community_list (vty, argv[0], 1, AFI_IP6, SAFI_MULTICAST);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_community_list,
        show_bgp_ipv4_community_list_cmd,
@@ -11165,7 +11016,6 @@ DEFUN (show_bgp_ipv4_safi_community_list_exact,
   return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_community_list,
        show_bgp_ipv6_safi_community_list_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) community-list 
(<1-500>|WORD)",
@@ -11212,7 +11062,6 @@ DEFUN (show_bgp_ipv6_safi_community_list_exact,
   }
   return bgp_show_community_list (vty, argv[1], 1, AFI_IP6, safi);
 }
-#endif /* HAVE_IPV6 */
 
 static int
 bgp_show_prefix_longer (struct vty *vty, const char *prefix, afi_t afi,
@@ -11339,7 +11188,6 @@ ALIAS (show_ip_bgp_flap_prefix,
        "Display flap statistics of routes\n"
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_prefix_longer,
        show_bgp_prefix_longer_cmd,
        "show bgp X:X::X:X/M longer-prefixes",
@@ -11379,7 +11227,6 @@ DEFUN (show_ipv6_mbgp_prefix_longer,
   return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
                                 bgp_show_type_prefix_longer);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_prefix_longer,
        show_bgp_ipv4_prefix_longer_cmd,
@@ -11433,7 +11280,6 @@ ALIAS (show_bgp_ipv4_safi_flap_prefix_longer,
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
        "Display route and more specific routes\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_flap_prefix_longer,
        show_bgp_ipv6_safi_flap_prefix_longer_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M 
longer-prefixes",
@@ -11471,7 +11317,6 @@ ALIAS (show_bgp_ipv6_safi_flap_prefix_longer,
        "Display flap statistics of routes\n"
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
        "Display route and more specific routes\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_prefix_longer,
        show_bgp_ipv4_safi_prefix_longer_cmd,
@@ -11497,7 +11342,6 @@ DEFUN (show_bgp_ipv4_safi_prefix_longer,
                                   bgp_show_type_prefix_longer);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_prefix_longer,
        show_bgp_ipv6_safi_prefix_longer_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) X:X::X:X/M 
longer-prefixes",
@@ -11521,7 +11365,6 @@ DEFUN (show_bgp_ipv6_safi_prefix_longer,
   return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
                                   bgp_show_type_prefix_longer);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_safi_flap_address,
        show_bgp_ipv4_safi_flap_address_cmd,
@@ -11558,7 +11401,7 @@ ALIAS (show_bgp_ipv4_safi_flap_address,
        "Display detailed information about dampening\n"
        "Display flap statistics of routes\n"
        "Network in the BGP routing table to display\n")
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_flap_address,
        show_bgp_ipv6_flap_address_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
@@ -11594,7 +11437,6 @@ ALIAS (show_bgp_ipv6_flap_address,
        "Display detailed information about dampening\n"
        "Display flap statistics of routes\n"
        "Network in the BGP routing table to display\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_flap_prefix,
        show_bgp_ipv4_safi_flap_prefix_cmd,
@@ -11633,7 +11475,6 @@ ALIAS (show_bgp_ipv4_safi_flap_prefix,
        "Display flap statistics of routes\n"
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_ipv6_safi_flap_prefix,
        show_bgp_ipv6_safi_flap_prefix_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics 
X:X::X:X/M",
@@ -11684,8 +11525,6 @@ DEFUN (show_bgp_ipv6_prefix_longer,
                                 bgp_show_type_prefix_longer);
 }
 
-#endif /* HAVE_IPV6 */
-
 static struct peer *
 peer_lookup_in_view (struct vty *vty, const char *view_name, 
                      const char *ip_str)
@@ -12355,7 +12194,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_prefix_counts,
 
   return bgp_peer_counts (vty, peer, AFI_IP, safi);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_prefix_counts,
        show_bgp_ipv6_safi_neighbor_prefix_counts_cmd,
        "show bgp ipv6 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) 
prefix-counts",
@@ -12385,7 +12224,6 @@ DEFUN (show_bgp_ipv6_safi_neighbor_prefix_counts,
 
   return bgp_peer_counts (vty, peer, AFI_IP6, safi);
 }
-#endif
 
 DEFUN (show_ip_bgp_encap_neighbor_prefix_counts,
        show_ip_bgp_encap_neighbor_prefix_counts_cmd,
@@ -12584,7 +12422,6 @@ DEFUN (show_ip_bgp_ipv4_neighbor_advertised_route,
   return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
 }
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_view_neighbor_advertised_route,
        show_bgp_view_neighbor_advertised_route_cmd,
        "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes",
@@ -12688,7 +12525,6 @@ DEFUN (ipv6_mbgp_neighbor_advertised_route,
 
   return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0);
 }
-#endif /* HAVE_IPV6 */
 
 DEFUN (show_ip_bgp_view_neighbor_received_routes,
        show_ip_bgp_view_neighbor_received_routes_cmd,
@@ -12911,7 +12747,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_advertised_route,
 
   return peer_adj_routes (vty, peer, AFI_IP, safi, 0);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_advertised_route,
        show_bgp_ipv6_safi_neighbor_advertised_route_cmd,
        "show bgp ipv6 (multicast|unicast) neighbors (A.B.C.D|X:X::X:X) 
advertised-routes",
@@ -12991,8 +12827,6 @@ DEFUN (show_bgp_view_ipv6_neighbor_received_routes,
 
   return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1);
 }
-#endif /* HAVE_IPV6 */
-
 
 DEFUN (show_bgp_ipv4_safi_neighbor_received_routes,
        show_bgp_ipv4_safi_neighbor_received_routes_cmd,
@@ -13023,7 +12857,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_received_routes,
   
   return peer_adj_routes (vty, peer, AFI_IP, safi, 1);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_received_routes,
        show_bgp_ipv6_safi_neighbor_received_routes_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) neighbors 
(A.B.C.D|X:X::X:X) received-routes",
@@ -13053,7 +12887,6 @@ DEFUN (show_bgp_ipv6_safi_neighbor_received_routes,
   
   return peer_adj_routes (vty, peer, AFI_IP6, safi, 1);
 }
-#endif
 
 DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes,
        show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd,
@@ -13240,7 +13073,7 @@ DEFUN 
(show_bgp_ipv4_safi_neighbor_received_prefix_filter,
 
   return CMD_SUCCESS;
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_received_prefix_filter,
        show_bgp_ipv6_safi_neighbor_received_prefix_filter_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) neighbors 
(A.B.C.D|X:X::X:X) received prefix-filter",
@@ -13377,7 +13210,6 @@ DEFUN 
(show_bgp_view_ipv6_neighbor_received_prefix_filter,
 
   return CMD_SUCCESS;
 }
-#endif /* HAVE_IPV6 */
 
 static int
 bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
@@ -13694,7 +13526,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_flap,
   return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
                                  bgp_show_type_flap_neighbor);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_flap,
        show_bgp_ipv6_safi_neighbor_flap_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) neighbors 
(A.B.C.D|X:X::X:X) flap-statistics",
@@ -13724,7 +13556,6 @@ DEFUN (show_bgp_ipv6_safi_neighbor_flap,
   return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
                                  bgp_show_type_flap_neighbor);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_safi_neighbor_damp,
        show_bgp_ipv4_safi_neighbor_damp_cmd,
@@ -13755,7 +13586,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_damp,
   return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
                                  bgp_show_type_damp_neighbor);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_damp,
        show_bgp_ipv6_safi_neighbor_damp_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) neighbors 
(A.B.C.D|X:X::X:X) dampened-routes",
@@ -13785,7 +13616,6 @@ DEFUN (show_bgp_ipv6_safi_neighbor_damp,
   return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
                                  bgp_show_type_damp_neighbor);
 }
-#endif
 
 DEFUN (show_bgp_ipv4_safi_neighbor_routes,
        show_bgp_ipv4_safi_neighbor_routes_cmd,
@@ -13815,7 +13645,7 @@ DEFUN (show_bgp_ipv4_safi_neighbor_routes,
   return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
                                  bgp_show_type_neighbor);
 }
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_neighbor_routes,
        show_bgp_ipv6_safi_neighbor_routes_cmd,
        "show bgp ipv6 (multicast|unicast) neighbors (A.B.C.D|X:X::X:X) routes",
@@ -13844,7 +13674,6 @@ DEFUN (show_bgp_ipv6_safi_neighbor_routes,
   return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
                                  bgp_show_type_neighbor);
 }
-#endif
 
 DEFUN (show_bgp_view_ipv4_safi_rsclient_route,
        show_bgp_view_ipv4_safi_rsclient_route_cmd,
@@ -14082,7 +13911,6 @@ ALIAS (show_bgp_view_ipv4_safi_rsclient_prefix,
        NEIGHBOR_ADDR_STR
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
 
-#ifdef HAVE_IPV6
 DEFUN (show_bgp_view_ipv6_neighbor_routes,
        show_bgp_view_ipv6_neighbor_routes_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) routes",
@@ -14339,8 +14167,6 @@ ALIAS (show_bgp_view_neighbor_damp,
        "Neighbor to display information about\n"
        "Display the dampened routes received from neighbor\n")
 
-#endif /* HAVE_IPV6 */
-
 DEFUN (show_bgp_view_rsclient,
        show_bgp_view_rsclient_cmd,
        "show bgp view WORD rsclient (A.B.C.D|X:X::X:X)",
@@ -14482,7 +14308,6 @@ ALIAS (show_bgp_view_ipv4_rsclient,
        "Information about Route Server Client\n"
        NEIGHBOR_ADDR_STR2)
 
-#ifdef HAVE_IPV6
 ALIAS (show_bgp_view_ipv6_rsclient,
        show_bgp_ipv6_rsclient_cmd,
        "show bgp ipv6 rsclient (A.B.C.D|X:X::X:X)",
@@ -15001,8 +14826,6 @@ ALIAS (show_bgp_view_ipv6_safi_rsclient_prefix,
        NEIGHBOR_ADDR_STR
        "IP prefix <network>/<length>, e.g., 3ffe::/16\n")
 
-#endif /* HAVE_IPV6 */
-
 struct bgp_table *bgp_distance_table;
 
 struct bgp_distance
@@ -15440,7 +15263,7 @@ ALIAS (show_bgp_ipv4_safi_dampened_paths,
        "Address Family modifier\n"
        "Display detailed information about dampening\n"
        "Display paths suppressed due to dampening\n")
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_dampened_paths,
        show_bgp_ipv6_safi_dampened_paths_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) dampened-paths",
@@ -15474,7 +15297,6 @@ ALIAS (show_bgp_ipv6_safi_dampened_paths,
        "Address Family modifier\n"
        "Display detailed information about dampening\n"
        "Display paths suppressed due to dampening\n")
-#endif
 
 DEFUN (show_bgp_ipv4_safi_flap_statistics,
        show_bgp_ipv4_safi_flap_statistics_cmd,
@@ -15509,7 +15331,7 @@ ALIAS (show_bgp_ipv4_safi_flap_statistics,
        "Address Family modifier\n"
        "Display detailed information about dampening\n"
        "Display flap statistics of routes\n")
-#ifdef HAVE_IPV6
+
 DEFUN (show_bgp_ipv6_safi_flap_statistics,
        show_bgp_ipv6_safi_flap_statistics_cmd,
        "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics",
@@ -15543,7 +15365,6 @@ ALIAS (show_bgp_ipv6_safi_flap_statistics,
        "Address Family modifier\n"
        "Display detailed information about dampening\n"
        "Display flap statistics of routes\n")
-#endif
 
 /* Display specified route of BGP table. */
 static int
@@ -16280,7 +16101,6 @@ bgp_route_init (void)
   /* prefix count */
   install_element (ENABLE_NODE, 
&show_bgp_ipv4_safi_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, 
&show_bgp_ipv6_safi_neighbor_prefix_counts_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_prefix_counts_cmd);
 
   /* New config IPv6 BGP commands.  */
@@ -16435,7 +16255,6 @@ bgp_route_init (void)
   /* Statistics */
   install_element (ENABLE_NODE, &show_bgp_statistics_cmd);
   install_element (ENABLE_NODE, &show_bgp_statistics_view_cmd);
-#endif /* HAVE_IPV6 */
 
   install_element (BGP_NODE, &bgp_distance_cmd);
   install_element (BGP_NODE, &no_bgp_distance_cmd);
@@ -16499,10 +16318,8 @@ bgp_route_init (void)
   install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_backdoor_ttl_cmd);
   install_element (BGP_IPV4M_NODE, 
&no_bgp_network_mask_natural_backdoor_ttl_cmd);
 
-#ifdef HAVE_IPV6
   install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd);
   install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd);
-#endif
 
   /* old style commands */
   install_element (VIEW_NODE, &show_ip_bgp_cmd);
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 6e298c5..f27c4ae 100644
--- a/bgpd/bgp_routemap.c
+++ b/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
@@ -2390,11 +2387,9 @@ bgp_route_map_update (const char *unused)
          if (bgp->rmap[ZEBRA_FAMILY_IPV4][i].name)
            bgp->rmap[ZEBRA_FAMILY_IPV4][i].map = 
              route_map_lookup_by_name (bgp->rmap[ZEBRA_FAMILY_IPV4][i].name);
-#ifdef HAVE_IPV6
          if (bgp->rmap[ZEBRA_FAMILY_IPV6][i].name)
            bgp->rmap[ZEBRA_FAMILY_IPV6][i].map =
              route_map_lookup_by_name (bgp->rmap[ZEBRA_FAMILY_IPV6][i].name);
-#endif /* HAVE_IPV6 */
        }
     }
 }
@@ -3570,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",
@@ -3739,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,
@@ -4000,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);
@@ -4022,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.
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h
index 209a18c..bee1296 100644
--- a/bgpd/bgp_table.h
+++ b/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)
 {
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index f7d6621..626956f 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -106,12 +106,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;
 }
 
@@ -144,10 +142,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;
@@ -6934,7 +6930,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",
@@ -6980,7 +6975,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,
@@ -7010,7 +7004,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",
@@ -7060,7 +7053,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,
@@ -7536,8 +7528,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,
@@ -7550,7 +7540,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,
@@ -7564,8 +7553,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",
@@ -7578,10 +7565,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",
@@ -7604,7 +7587,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);
@@ -7617,7 +7599,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;
 }
 
@@ -7649,8 +7631,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",
@@ -7736,7 +7716,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 */
 
@@ -7761,7 +7740,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);
@@ -7774,7 +7752,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;
 }
 
@@ -7788,17 +7766,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"
@@ -7820,7 +7792,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);
@@ -7836,53 +7808,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);
@@ -8247,7 +8211,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]
@@ -8256,7 +8219,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]
@@ -8512,7 +8474,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);
@@ -8522,7 +8483,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. */
@@ -8814,11 +8774,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"
@@ -8842,11 +8798,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"
@@ -9188,7 +9140,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);
@@ -9201,7 +9152,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;
 }
 
@@ -9228,7 +9179,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);
@@ -9241,11 +9191,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",
@@ -9333,8 +9282,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,
@@ -9549,7 +9496,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,
@@ -9762,7 +9708,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,
@@ -10800,10 +10745,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);
 
@@ -10812,9 +10755,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);
@@ -10833,7 +10774,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);
@@ -10845,7 +10785,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);
@@ -10894,7 +10833,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);
@@ -10926,7 +10864,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);
@@ -10963,7 +10900,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);
@@ -10985,7 +10921,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);
@@ -11006,7 +10941,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);
@@ -11018,14 +10952,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);
@@ -11034,7 +10966,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);
@@ -11051,51 +10982,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);
@@ -11109,15 +11028,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);
@@ -11132,7 +11048,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);
@@ -11145,7 +11060,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);
@@ -11170,7 +11084,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);
@@ -11181,7 +11094,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);
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index e454c2e..703e664 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -304,7 +304,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,
@@ -386,7 +385,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)
@@ -439,7 +437,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)
 {
@@ -532,7 +529,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)
@@ -572,7 +568,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))
@@ -583,7 +578,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;
@@ -593,7 +587,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);
 
@@ -602,10 +595,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)
     {
@@ -662,7 +653,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;
 }
 
@@ -762,7 +752,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)
     {
@@ -832,7 +822,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
@@ -887,7 +876,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)
     {
@@ -915,7 +904,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. */
@@ -1073,10 +1061,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);
 }
diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h
index ff9b375..e69a0bc 100644
--- a/bgpd/bgp_zebra.h
+++ b/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 */
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 90def75..eb59031 100644
--- a/bgpd/bgpd.h
+++ b/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.  */
-- 
2.1.3


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to