diff options
author | Lou Berger <lberger@labn.net> | 2017-05-18 14:56:26 +0200 |
---|---|---|
committer | Lou Berger <lberger@labn.net> | 2017-05-18 23:42:04 +0200 |
commit | fb1d2a2d97da848b8c1198fcca7d9131fefeeb20 (patch) | |
tree | bb6e49a0cfdc59aa9531c66e62493512df46b38b /bgpd/bgp_route.c | |
parent | pimd: Fix indentation issue that is causing clang unhappiness (diff) | |
download | frr-fb1d2a2d97da848b8c1198fcca7d9131fefeeb20.tar.xz frr-fb1d2a2d97da848b8c1198fcca7d9131fefeeb20.zip |
bgpd: cleanup vpn label config, set BoS, use 'label' in place of 'tag'
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_route.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index cb4d88859..3cdc3b003 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4454,7 +4454,7 @@ bgp_purge_static_redist_routes (struct bgp *bgp) */ int bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str, - const char *rd_str, const char *tag_str, + const char *rd_str, const char *label_str, const char *rmap_str, int evpn_type, const char *esi, const char *gwip, const char *ethtag, const char *routermac) { @@ -4491,18 +4491,15 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str return CMD_WARNING; } - if (tag_str) + if (label_str) { - ret = str2tag (tag_str, tag); - if (! ret) - { - vty_out (vty, "%% Malformed tag%s", VTY_NEWLINE); - return CMD_WARNING; - } + unsigned long label_val; + VTY_GET_INTEGER_RANGE("Label/tag", label_val, label_str, 0, 16777215); + encode_label (label_val, tag); } else { - encode_label (0, tag); + memset (tag, 0, sizeof(tag)); /* empty, not even BoS */ } if (safi == SAFI_EVPN) { @@ -4594,7 +4591,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str /* Configure static BGP network. */ int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_str, - const char *rd_str, const char *tag_str, + const char *rd_str, const char *label_str, int evpn_type, const char *esi, const char *gwip, const char *ethtag) { VTY_DECLVAR_CONTEXT(bgp, bgp); @@ -4628,11 +4625,15 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st return CMD_WARNING; } - ret = str2tag (tag_str, tag); - if (! ret) + if (label_str) { - vty_out (vty, "%% Malformed tag%s", VTY_NEWLINE); - return CMD_WARNING; + unsigned long label_val; + VTY_GET_INTEGER_RANGE("Label/tag", label_val, label_str, 0, MPLS_LABEL_MAX); + encode_label (label_val, tag); + } + else + { + memset (tag, 0, sizeof(tag)); /* empty, not even BoS */ } prn = bgp_node_get (bgp->route[afi][safi], @@ -10433,7 +10434,7 @@ bgp_config_write_network_vpn (struct vty *vty, struct bgp *bgp, prefix_rd2str (prd, rdbuf, RD_ADDRSTRLEN); label = decode_label (bgp_static->tag); - vty_out (vty, " network %s/%d rd %s tag %d", + vty_out (vty, " network %s/%d rd %s label %d", inet_ntop (p->family, &p->u.prefix, buf, SU_ADDRSTRLEN), p->prefixlen, rdbuf, label); |