]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)
authorStephane Poignant <stephane.poignant@proton.ch>
Tue, 1 Apr 2025 16:56:27 +0000 (18:56 +0200)
committerStephane Poignant <stephane.poignant@proton.ch>
Fri, 4 Apr 2025 11:29:02 +0000 (13:29 +0200)
commit2cee5567bc49c603de3a142a9cb5a4fab560cb6c
treef9b7b387e4aee1c930b864a6b454893265875529
parent9f8027b8a4e9c54c196ddc80af9d732b212aedda
bgpd: flowspec: remove sizelimit check applied to the wrong length field (issue 18557)

Section 4.1 of RFC8955 defines how the length field of flowspec NLRIs is encoded.
The method use implies a maximum length of 4095 for a single flowspec NLRI.
However, in bgp_flowspec.c, we check the length attribute of the bgp_nlri structure against this maximum value, which actually is the *total* length of all NLRI included in the considered MP_REACH_NLRI path attribute.
Due to this confusion, frr would reject valid announces that contain many flowspec NLRIs, when their cummulative length exceeds 4095, and close the session.
The proposed change removes that check entirely. Indeed, there is no need to check the length field of each invidual NLRI because the method employed make it impossible to encode a length greater than 4095.

Signed-off-by: Stephane Poignant <stephane.poignant@proton.ch>
bgpd/bgp_flowspec.c
bgpd/bgp_flowspec_private.h
bgpd/bgp_route.h