Skip to content

Commit cc1a551

Browse files
donaldsharpmergify[bot]
authored andcommitted
bgpd: Limit flowspec to no attribute means a implicit withdrawal
All other parsing functions done from bgp_nlri_parse() assume no attributes == an implicit withdrawal. Let's move bgp_nlri_parse_flowspec() into the same alignment. Reported-by: Matteo Memelli <[email protected]> Signed-off-by: Donald Sharp <[email protected]> (cherry picked from commit cfd04dc)
1 parent 1644076 commit cc1a551

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bgpd/bgp_flowspec.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
111111
afi = packet->afi;
112112
safi = packet->safi;
113113

114+
/*
115+
* All other AFI/SAFI's treat no attribute as a implicit
116+
* withdraw. Flowspec should as well.
117+
*/
118+
if (!attr)
119+
withdraw = 1;
120+
114121
if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT_EXTENDED) {
115122
flog_err(EC_BGP_FLOWSPEC_PACKET,
116123
"BGP flowspec nlri length maximum reached (%u)",

0 commit comments

Comments
 (0)