summaryrefslogtreecommitdiff
path: root/bgpd/bgp_flowspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_flowspec.c')
-rw-r--r--bgpd/bgp_flowspec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c
index f9debe43cd..70bdbaf035 100644
--- a/bgpd/bgp_flowspec.c
+++ b/bgpd/bgp_flowspec.c
@@ -82,7 +82,7 @@ static int bgp_fs_nlri_validate(uint8_t *nlri_content, uint32_t len,
}
int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
- struct bgp_nlri *packet, int withdraw)
+ struct bgp_nlri *packet, bool withdraw)
{
uint8_t *pnt;
uint8_t *lim;
@@ -98,6 +98,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
afi = packet->afi;
safi = packet->safi;
+ /*
+ * All other AFI/SAFI's treat no attribute as a implicit
+ * withdraw. Flowspec should as well.
+ */
+ if (!attr)
+ withdraw = true;
+
if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT_EXTENDED) {
flog_err(EC_BGP_FLOWSPEC_PACKET,
"BGP flowspec nlri length maximum reached (%u)",