summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-05-18 12:34:34 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-05-18 12:34:34 +0200
commite2f30ad1c2087caf09cf163c7688750995733e04 (patch)
treed040c20d240161df51c234e1bbed3d6da517ba92
parent20ae26767d46289ad843e2ad87e93fafcf8bebc7 (diff)
parent201c3dac294e15ecc6673d88f5ca9c1842a71f88 (diff)
Merge branch 'frr/pull/569'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--bgpd/bgp_encap.c4
-rw-r--r--bgpd/bgp_evpn_vty.c4
-rw-r--r--bgpd/bgp_mplsvpn.c12
-rw-r--r--bgpd/bgp_route.c16
-rw-r--r--bgpd/bgp_route.h4
5 files changed, 14 insertions, 26 deletions
diff --git a/bgpd/bgp_encap.c b/bgpd/bgp_encap.c
index 2e58072bc5..a1a0c1710b 100644
--- a/bgpd/bgp_encap.c
+++ b/bgpd/bgp_encap.c
@@ -213,7 +213,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);
}
@@ -232,7 +232,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 4850a8f13a..e91a6d9bfd 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 4234934a6a..2d13d05c00 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 41966192d8..0f719d5536 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4540,7 +4540,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)
@@ -4554,14 +4554,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)
@@ -4686,7 +4680,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)
{
@@ -4699,12 +4693,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 96c9bd0035..3d179e07be 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -333,11 +333,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 *);