]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: vty command fixup for evpn rt5 1238/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 25 Sep 2017 16:28:01 +0000 (18:28 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 25 Sep 2017 16:31:11 +0000 (18:31 +0200)
evpn vty command can be used to configure evpn rt5 entries.

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

index aa11013fcc01f07ede68a22652f7ea9bdd38b300..6ae7c5ba4b51438cded520cd37a2fd18bf8ed15c 100644 (file)
@@ -1118,17 +1118,18 @@ DEFUN(evpnrt5_network,
       "Name of the route map\n")
 {
        int idx_ipv4_prefixlen = 1;
-       int idx_ext_community = 3;
-       int idx_word = 7;
+       int idx_route_distinguisher = 3;
+       int idx_label = 7;
        int idx_esi = 9;
        int idx_gwip = 11;
        int idx_ethtag = 5;
        int idx_routermac = 13;
        int idx_rmap = 15;
+
        return bgp_static_set_safi(
                AFI_L2VPN, SAFI_EVPN, vty, argv[idx_ipv4_prefixlen]->arg,
-               argv[idx_ext_community]->arg, argv[idx_word]->arg,
-               argv[idx_rmap] ? argv[idx_gwip]->arg : NULL,
+               argv[idx_route_distinguisher]->arg, argv[idx_label]->arg,
+               NULL,
                BGP_EVPN_IP_PREFIX_ROUTE, argv[idx_esi]->arg,
                argv[idx_gwip]->arg, argv[idx_ethtag]->arg,
                argv[idx_routermac]->arg);
index a12abd9fd037a4cf308162fb04cb121c740b07e5..5e51418165bb2df113093da0406b4cf3824f2ca0 100644 (file)
@@ -11129,11 +11129,23 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp,
 
                        /* "network" configuration display.  */
                        prefix_rd2str(prd, rdbuf, RD_ADDRSTRLEN);
+                       if (p->u.prefix_evpn.route_type == 5) {
+                               char local_buf[PREFIX_STRLEN];
+                               uint8_t family = IS_EVPN_PREFIX_IPADDR_V4((struct prefix_evpn *)p)
+                                       ? AF_INET
+                                       : AF_INET6;
+                               inet_ntop(family, &p->u.prefix_evpn.ip.ip.addr, local_buf,
+                                         PREFIX_STRLEN);
+                               sprintf(buf, "%s/%u", local_buf,p->u.prefix_evpn.ip_prefix_length);
+                       } else {
+                               prefix2str(p, buf, sizeof(buf));
+                       }
 
-                       inet_ntop(AF_INET, &bgp_static->igpnexthop, buf2,
-                                 SU_ADDRSTRLEN);
-
-                       prefix2str(p, buf, sizeof(buf));
+                       if (bgp_static->gatewayIp.family == AF_INET ||
+                           bgp_static->gatewayIp.family == AF_INET6)
+                               inet_ntop(bgp_static->gatewayIp.family,
+                                         &bgp_static->gatewayIp.u.prefix, buf2,
+                                         sizeof(buf2));
                        vty_out(vty,
                                " network %s rd %s ethtag %u tag %u esi %s gwip %s routermac %s\n",
                                buf, rdbuf, p->u.prefix_evpn.eth_tag,