]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: use HAVE_EVPN to disable evpn frame handling
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 17 Jan 2017 21:26:33 +0000 (22:26 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 14 Feb 2017 12:58:59 +0000 (13:58 +0100)
Transmission and Reception routines have a part of code that is
conditionnally compiled to the usage of HAVE_EVPN. Also, each time a
subfield of prefix evpn is reached, like in configuration also, then a
conditionnaly compilation with HAVE_EVPN is used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_evpn.c
bgpd/bgp_route.c

index a9db7d2360a15c5daec06a857c24c858f3882330..98661d7c3843e6a7668fc248b2eec32563034400 100644 (file)
@@ -60,8 +60,7 @@ bgp_nlri_parse_evpn (struct peer *peer, struct attr *attr,
 
 #if !defined(HAVE_EVPN)
   return -1;
-#endif /* HAVE_EVPN */
-
+#else
   p_evpn_p = &p.u.prefix_evpn;
   pnt = packet->nlri;
   lim = pnt + packet->length;
@@ -184,7 +183,7 @@ bgp_nlri_parse_evpn (struct peer *peer, struct attr *attr,
   /* Packet length consistency check. */
   if (pnt != lim)
     return -1;
-
+#endif /* !(HAVE_EVPN) */
   return 0;
 }
 
@@ -193,6 +192,7 @@ bgp_packet_mpattr_route_type_5 (struct stream *s,
                                 struct prefix *p, struct prefix_rd *prd,
                                 u_char *label, struct attr *attr)
 {
+#if defined(HAVE_EVPN)
   int len;
   char temp[16];
   struct evpn_addr *p_evpn_p;
@@ -237,4 +237,5 @@ bgp_packet_mpattr_route_type_5 (struct stream *s,
   else
     stream_put3 (s, 0);
   return;
+#endif /* (HAVE_EVPN) */
 }
index 085763ba8135dba21fcdc541e554dd15add17014..5f47e88a7807bfa1da3cad71310e13b2868320a0 100644 (file)
@@ -3994,7 +3994,9 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
 #if ENABLE_BGP_VNC
   u_int32_t        label = 0;
 #endif
+#if defined(HAVE_EVPN)
   union gw_addr add;
+#endif /* (HAVE_EVPN) */
 
   assert (bgp_static);
 
@@ -4014,6 +4016,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
           bgp_attr_extra_get (&attr)->mp_nexthop_len = IPV4_MAX_BYTELEN;
         }
     }
+#if defined(HAVE_EVPN)
   if(afi == AFI_L2VPN)
     {
       if (bgp_static->gatewayIp.family == AF_INET)
@@ -4033,6 +4036,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
           bgp_add_routermac_ecom (&attr, bgp_static->router_mac);
         }
     }
+#endif /* (HAVE_EVPN) */
   /* Apply route-map. */
   if (bgp_static->rmap.name)
     {
@@ -4495,6 +4499,7 @@ bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str,
     {
       encode_label (0, tag);
     }
+#if defined (HAVE_EVPN)
   if (safi == SAFI_EVPN)
     {
       if( esi && str2esi (esi, NULL) == 0)
@@ -4524,6 +4529,7 @@ bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str,
             }
         }
     }
+#endif /* (HAVE_EVPN) */
   prn = bgp_node_get (bgp->route[afi][safi],
                        (struct prefix *)&prd);
   if (prn->info == NULL)
@@ -6608,6 +6614,7 @@ route_vty_out_overlay (struct vty *vty, struct prefix *p,
 
   if(attr->extra)
     {
+#if defined (HAVE_EVPN)
       struct eth_segment_id *id = &(attr->extra->evpn_overlay.eth_s_id);
       char *str = esi2str(id);
       vty_out (vty, "%s", str);
@@ -6622,6 +6629,7 @@ route_vty_out_overlay (struct vty *vty, struct prefix *p,
                    inet_ntop (AF_INET6, &(attr->extra->evpn_overlay.gw_ip.ipv6),
                               buf, BUFSIZ));
        }
+#endif /* (HAVE_EVPN) */
       if(attr->extra->ecommunity)
         {
           char *mac = NULL;
@@ -10546,9 +10554,11 @@ bgp_config_write_network_evpn (struct vty *vty, struct bgp *bgp,
             inet_ntop (AF_INET, &bgp_static->igpnexthop, buf2, SU_ADDRSTRLEN);
 
             prefix2str (p, buf, sizeof (buf)),
+#if defined (HAVE_EVPN)
            vty_out (vty, " network %s rd %s ethtag %u tag %u esi %s gwip %s routermac %s",
                     buf, rdbuf, p->u.prefix_evpn.eth_tag,
                      decode_label (bgp_static->tag), esi, buf2 , macrouter);
+#endif /*(HAVE_EVPN)*/
            vty_out (vty, "%s", VTY_NEWLINE);
          }
   return 0;