bgpd: allow flowspec entries to be announced to zebra

Flowspec entries are allowed to be announced.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2018-01-26 18:36:24 +01:00
parent 70eabd1286
commit 529efa2346
3 changed files with 11 additions and 1 deletions

View file

@ -30,6 +30,7 @@
#include "bgpd/bgp_route.h" #include "bgpd/bgp_route.h"
#include "bgpd/bgp_attr.h" #include "bgpd/bgp_attr.h"
#include "bgpd/bgp_zebra.h" #include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_mplsvpn.h"
DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH_ENTRY, "PBR match entry") DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH_ENTRY, "PBR match entry")
DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH, "PBR match") DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH, "PBR match")

View file

@ -319,7 +319,8 @@ static inline void bgp_bump_version(struct bgp_node *node)
static inline int bgp_fibupd_safi(safi_t safi) static inline int bgp_fibupd_safi(safi_t safi)
{ {
if (safi == SAFI_UNICAST || safi == SAFI_MULTICAST if (safi == SAFI_UNICAST || safi == SAFI_MULTICAST
|| safi == SAFI_LABELED_UNICAST) || safi == SAFI_LABELED_UNICAST
|| safi == SAFI_FLOWSPEC)
return 1; return 1;
return 0; return 0;
} }

View file

@ -1174,6 +1174,10 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
if (bgp_debug_zebra(p)) if (bgp_debug_zebra(p))
prefix2str(&api.prefix, buf_prefix, sizeof(buf_prefix)); prefix2str(&api.prefix, buf_prefix, sizeof(buf_prefix));
if (safi == SAFI_FLOWSPEC)
return bgp_pbr_update_entry(bgp, &rn->p,
info, afi, safi, true);
/* /*
* vrf leaking support (will have only one nexthop) * vrf leaking support (will have only one nexthop)
*/ */
@ -1467,6 +1471,10 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
if (!bgp_install_info_to_zebra(bgp)) if (!bgp_install_info_to_zebra(bgp))
return; return;
if (safi == SAFI_FLOWSPEC)
return bgp_pbr_update_entry(peer->bgp, p,
info, AFI_IP, safi, false);
memset(&api, 0, sizeof(api)); memset(&api, 0, sizeof(api));
memcpy(&api.rmac, &(info->attr->rmac), sizeof(struct ethaddr)); memcpy(&api.rmac, &(info->attr->rmac), sizeof(struct ethaddr));
api.vrf_id = bgp->vrf_id; api.vrf_id = bgp->vrf_id;