Skip to content

Commit

Permalink
bgpd: allow flowspec entries to be announced to zebra
Browse files Browse the repository at this point in the history
Flowspec entries are allowed to be announced.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Apr 30, 2018
1 parent 70eabd1 commit 529efa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions bgpd/bgp_pbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_attr.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, "PBR match")
Expand Down
3 changes: 2 additions & 1 deletion bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ static inline void bgp_bump_version(struct bgp_node *node)
static inline int bgp_fibupd_safi(safi_t safi)
{
if (safi == SAFI_UNICAST || safi == SAFI_MULTICAST
|| safi == SAFI_LABELED_UNICAST)
|| safi == SAFI_LABELED_UNICAST
|| safi == SAFI_FLOWSPEC)
return 1;
return 0;
}
Expand Down
8 changes: 8 additions & 0 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,10 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
if (bgp_debug_zebra(p))
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)
*/
Expand Down Expand Up @@ -1467,6 +1471,10 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
if (!bgp_install_info_to_zebra(bgp))
return;

if (safi == SAFI_FLOWSPEC)
return bgp_pbr_update_entry(peer->bgp, p,
info, AFI_IP, safi, false);

memset(&api, 0, sizeof(api));
memcpy(&api.rmac, &(info->attr->rmac), sizeof(struct ethaddr));
api.vrf_id = bgp->vrf_id;
Expand Down

0 comments on commit 529efa2

Please sign in to comment.