]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_route.c
Merge branch 'master' into cleanup
[mirror_frr.git] / bgpd / bgp_route.c
index 0040c7a1446a53b5bc425601be812033472b2f28..b25101f28fac1789330421b5c8497965c19158e9 100644 (file)
@@ -1172,10 +1172,8 @@ subgroup_announce_reset_nhop (u_char family, struct attr *attr)
 {
   if (family == AF_INET)
     attr->nexthop.s_addr = 0;
-#ifdef HAVE_IPV6
   if (family == AF_INET6)
     memset (&attr->extra->mp_nexthop_global, 0, IPV6_MAX_BYTELEN);
-#endif
 }
 
 int
@@ -1266,10 +1264,8 @@ subgroup_announce_check (struct bgp_info *ri, struct update_subgroup *subgrp,
     {
       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. */
@@ -1432,7 +1428,6 @@ subgroup_announce_check (struct bgp_info *ri, struct update_subgroup *subgrp,
   if (reflect)
     SET_FLAG(attr->rmap_change_flags, BATTR_REFLECTED);
 
-#ifdef HAVE_IPV6
 #define NEXTHOP_IS_V6 (\
     (safi != SAFI_ENCAP && \
      (p->family == AF_INET6 || peer_cap_enhe(peer))) || \
@@ -1463,7 +1458,6 @@ subgroup_announce_check (struct bgp_info *ri, struct update_subgroup *subgrp,
             PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)))
         memset (&attr->extra->mp_nexthop_local, 0, IPV6_MAX_BYTELEN);
     }
-#endif /* HAVE_IPV6 */
 
   bgp_peer_remove_private_as(bgp, afi, safi, peer, attr);
   bgp_peer_as_override(bgp, afi, safi, peer, attr);
@@ -2320,14 +2314,12 @@ bgp_update_martian_nexthop (struct bgp *bgp, afi_t afi, safi_t safi, struct attr
                  IPV4_CLASS_DE (ntohl (attre->mp_nexthop_global_in.s_addr)));
           break;
 
-#ifdef HAVE_IPV6
         case BGP_ATTR_NHLEN_IPV6_GLOBAL:
         case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL:
           ret = (IN6_IS_ADDR_UNSPECIFIED(&attre->mp_nexthop_global) ||
                  IN6_IS_ADDR_LOOPBACK(&attre->mp_nexthop_global)    ||
                  IN6_IS_ADDR_MULTICAST(&attre->mp_nexthop_global));
           break;
-#endif /* HAVE_IPV6 */
 
         default:
           ret = 1;
@@ -3526,7 +3518,6 @@ bgp_nlri_parse_ip (struct peer *peer, struct attr *attr,
            }
        }
 
-#ifdef HAVE_IPV6
       /* Check address. */
       if (afi == AFI_IP6 && safi == SAFI_UNICAST)
        {
@@ -3549,7 +3540,6 @@ bgp_nlri_parse_ip (struct peer *peer, struct attr *attr,
              continue;
            }
        }
-#endif /* HAVE_IPV6 */
 
       /* Normal process. */
       if (attr)
@@ -4032,14 +4022,12 @@ bgp_static_set (struct vty *vty, 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);
 
@@ -4121,14 +4109,12 @@ bgp_static_unset (struct vty *vty, 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);
 
@@ -5554,14 +5540,12 @@ bgp_redistribute_add (struct bgp *bgp, struct prefix *p, const struct in_addr *n
     attr.nexthop = *nexthop;
   attr.nh_ifindex = ifindex;
 
-#ifdef HAVE_IPV6
   if (nexthop6)
     {
       struct attr_extra *extra = bgp_attr_extra_get(&attr);
       extra->mp_nexthop_global = *nexthop6;
       extra->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL;
     }
-#endif
 
   attr.med = metric;
   attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC);
@@ -5890,12 +5874,10 @@ route_vty_out (struct vty *vty, struct prefix *p,
                     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, "?");
                   break;
@@ -6142,7 +6124,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
               else
                 json_object_string_add(json_net, "nextHop", inet_ntoa (attr->nexthop));
             }
-#ifdef HAVE_IPV6
           else if (p->family == AF_INET6 || BGP_ATTR_NEXTHOP_AFI_IP6(attr))
             {
               char buf[BUFSIZ];
@@ -6150,7 +6131,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
               json_object_string_add(json_net, "netHopGloabal", inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
                                   buf, BUFSIZ));
             }
-#endif /* HAVE_IPV6 */
 
           if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
             json_object_int_add(json_net, "metric", attr->med);
@@ -6183,7 +6163,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
               else
                 vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
             }
-#ifdef HAVE_IPV6
           else if (p->family == AF_INET6 || BGP_ATTR_NEXTHOP_AFI_IP6(attr))
             {
               int len;
@@ -6200,7 +6179,6 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t
               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);
           else
@@ -6281,7 +6259,6 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
                 vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
             }
        }
-#ifdef HAVE_IPV6      
       else if (p->family == AF_INET6 || BGP_ATTR_NEXTHOP_AFI_IP6(attr))
        {
          assert (attr->extra);
@@ -6318,7 +6295,6 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
             }
 
        }
-#endif /* HAVE_IPV6 */
     }
 
   label = decode_label (binfo->extra->tag);
@@ -10568,7 +10544,6 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_neighbor_prefix_counts_cmd);
-#ifdef HAVE_IPV6
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_prefix_counts_cmd);
 
@@ -10588,7 +10563,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);