diff options
author | Lou Berger <lberger@labn.net> | 2017-05-17 20:54:10 +0200 |
---|---|---|
committer | Lou Berger <lberger@labn.net> | 2017-05-17 20:56:43 +0200 |
commit | 201c3dac294e15ecc6673d88f5ca9c1842a71f88 (patch) | |
tree | 6893166fbd3c806623a409184d739bf42803507d /bgpd | |
parent | Merge pull request #565 from qlyoung/fix-ldpd-vtysh-3.0 (diff) | |
download | frr-201c3dac294e15ecc6673d88f5ca9c1842a71f88.tar.xz frr-201c3dac294e15ecc6673d88f5ca9c1842a71f88.zip |
bgpd: fix config of v6 vpn networks tags
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_encap.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_evpn_vty.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_mplsvpn.c | 12 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 16 | ||||
-rw-r--r-- | bgpd/bgp_route.h | 4 |
5 files changed, 14 insertions, 26 deletions
diff --git a/bgpd/bgp_encap.c b/bgpd/bgp_encap.c index 23be34c63..01df05395 100644 --- a/bgpd/bgp_encap.c +++ b/bgpd/bgp_encap.c @@ -219,7 +219,7 @@ DEFUN (encap_network, int idx_ipv4 = 1; int idx_rd = 3; int idx_word = 5; - return bgp_static_set_safi (SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, argv[idx_word]->arg, + return bgp_static_set_safi (AFI_IP, SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, argv[idx_word]->arg, NULL, 0, NULL, NULL, NULL, NULL); } @@ -238,7 +238,7 @@ DEFUN (no_encap_network, int idx_ipv4 = 2; int idx_rd = 4; int idx_word = 6; - return bgp_static_unset_safi (SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, argv[idx_word]->arg, + return bgp_static_unset_safi (AFI_IP, SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, argv[idx_word]->arg, 0, NULL, NULL, NULL); } diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index c133d7ba3..a51affc4f 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -705,7 +705,7 @@ DEFUN(evpnrt5_network, int idx_ethtag = 5; int idx_routermac = 13; int idx_rmap = 15; - return bgp_static_set_safi(SAFI_EVPN, vty, + return bgp_static_set_safi(AFI_L2VPN, SAFI_EVPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, @@ -739,7 +739,7 @@ DEFUN(no_evpnrt5_network, int idx_ethtag = 6; int idx_esi = 10; int idx_gwip = 12; - return bgp_static_unset_safi(SAFI_EVPN, vty, + return bgp_static_unset_safi(AFI_L2VPN, SAFI_EVPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_label]->arg, EVPN_IP_PREFIX, diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 97b40df28..60a48f506 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -471,7 +471,7 @@ DEFUN (vpnv4_network, int idx_ipv4_prefixlen = 1; int idx_ext_community = 3; int idx_word = 5; - return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, + return bgp_static_set_safi (AFI_IP, SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, NULL, 0, NULL, NULL, NULL, NULL); } @@ -491,7 +491,7 @@ DEFUN (vpnv4_network_route_map, int idx_ext_community = 3; int idx_word = 5; int idx_word_2 = 7; - return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, + return bgp_static_set_safi (AFI_IP, SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, argv[idx_word_2]->arg, 0, NULL, NULL, NULL, NULL); } @@ -510,7 +510,7 @@ DEFUN (no_vpnv4_network, int idx_ipv4_prefixlen = 2; int idx_ext_community = 4; int idx_word = 6; - return bgp_static_unset_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, + return bgp_static_unset_safi (AFI_IP, SAFI_MPLS_VPN, vty, argv[idx_ipv4_prefixlen]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, 0, NULL, NULL, NULL); } @@ -532,9 +532,9 @@ DEFUN (vpnv6_network, int idx_word = 5; int idx_word_2 = 7; if (argc == 8) - return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, argv[idx_word_2]->arg, 0, NULL, NULL, NULL, NULL); + return bgp_static_set_safi (AFI_IP6, SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, argv[idx_word_2]->arg, 0, NULL, NULL, NULL, NULL); else - return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, NULL, 0, NULL, NULL, NULL, NULL); + return bgp_static_set_safi (AFI_IP6, SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, NULL, 0, NULL, NULL, NULL, NULL); } /* For testing purpose, static route of MPLS-VPN. */ @@ -552,7 +552,7 @@ DEFUN (no_vpnv6_network, int idx_ipv6_prefix = 2; int idx_ext_community = 4; int idx_word = 6; - return bgp_static_unset_safi (SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, 0, NULL, NULL, NULL); + return bgp_static_unset_safi (AFI_IP6, SAFI_MPLS_VPN, vty, argv[idx_ipv6_prefix]->arg, argv[idx_ext_community]->arg, argv[idx_word]->arg, 0, NULL, NULL, NULL); } int diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index de51de7a6..cb4d88859 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4453,7 +4453,7 @@ bgp_purge_static_redist_routes (struct bgp *bgp) * I think it can probably be factored with bgp_static_set. */ int -bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str, +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 *rmap_str, int evpn_type, const char *esi, const char *gwip, const char *ethtag, const char *routermac) @@ -4467,14 +4467,8 @@ bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str, struct bgp_table *table; struct bgp_static *bgp_static; u_char tag[3]; - afi_t afi; struct prefix gw_ip; - if(safi == SAFI_EVPN) - afi = AFI_L2VPN; - else - afi = AFI_IP; - /* validate ip prefix */ ret = str2prefix (ip_str, &p); if (! ret) @@ -4599,7 +4593,7 @@ bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str, /* Configure static BGP network. */ int -bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str, +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, int evpn_type, const char *esi, const char *gwip, const char *ethtag) { @@ -4612,12 +4606,6 @@ bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str, struct bgp_table *table; struct bgp_static *bgp_static; u_char tag[3]; - afi_t afi; - - if(safi == SAFI_EVPN) - afi = AFI_L2VPN; - else - afi = AFI_IP; /* Convert IP prefix string to struct prefix. */ ret = str2prefix (ip_str, &p); diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index e75978d00..dbdcedd00 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -318,11 +318,11 @@ extern void bgp_static_update (struct bgp *, struct prefix *, struct bgp_static afi_t, safi_t); extern void bgp_static_withdraw (struct bgp *, struct prefix *, afi_t, safi_t); -extern int bgp_static_set_safi (safi_t safi, struct vty *vty, const char *, +extern int bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *, const char *, const char *, const char *, int, const char *, const char *, const char *, const char *); -extern int bgp_static_unset_safi (safi_t safi, struct vty *, const char *, +extern int bgp_static_unset_safi (afi_t afi, safi_t safi, struct vty *, const char *, const char *, const char *, int, const char *, const char *, const char *); |