Skip to content

Bgp capability common#22254

Open
donaldsharp wants to merge 2 commits into
FRRouting:masterfrom
donaldsharp:bgp_capability_common
Open

Bgp capability common#22254
donaldsharp wants to merge 2 commits into
FRRouting:masterfrom
donaldsharp:bgp_capability_common

bgpd: validate CAPABILITY_CODE_LINK_LOCAL length

38ec1b0
Select commit
Loading
Failed to load commit list.
frrbot / frrbot completed Jun 9, 2026 in 8s

Style and/or linter errors found

Style and/or linter errors found

Details

Thanks for your contribution to FRR!

Click for style suggestions

diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 59f27876b3..9607783aff 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -74,22 +74,14 @@ const size_t cap_minsizes[] = {
  * table should be set to 1.
  */
 const size_t cap_modsizes[] = {
-	[CAPABILITY_CODE_MP] = 4,
-	[CAPABILITY_CODE_REFRESH] = 1,
-	[CAPABILITY_CODE_ORF] = 1,
-	[CAPABILITY_CODE_RESTART] = 1,
-	[CAPABILITY_CODE_AS4] = 4,
-	[CAPABILITY_CODE_ADDPATH] = 4,
-	[CAPABILITY_CODE_DYNAMIC] = 1,
-	[CAPABILITY_CODE_ENHE] = 6,
-	[CAPABILITY_CODE_FQDN] = 1,
-	[CAPABILITY_CODE_ENHANCED_RR] = 1,
-	[CAPABILITY_CODE_EXT_MESSAGE] = 1,
-	[CAPABILITY_CODE_LLGR] = 7,
-	[CAPABILITY_CODE_ROLE] = 1,
-	[CAPABILITY_CODE_SOFT_VERSION] = 1,
-	[CAPABILITY_CODE_PATHS_LIMIT] = 5,
-	[CAPABILITY_CODE_LINK_LOCAL] = 1,
+	[CAPABILITY_CODE_MP] = 4,	   [CAPABILITY_CODE_REFRESH] = 1,
+	[CAPABILITY_CODE_ORF] = 1,	   [CAPABILITY_CODE_RESTART] = 1,
+	[CAPABILITY_CODE_AS4] = 4,	   [CAPABILITY_CODE_ADDPATH] = 4,
+	[CAPABILITY_CODE_DYNAMIC] = 1,	   [CAPABILITY_CODE_ENHE] = 6,
+	[CAPABILITY_CODE_FQDN] = 1,	   [CAPABILITY_CODE_ENHANCED_RR] = 1,
+	[CAPABILITY_CODE_EXT_MESSAGE] = 1, [CAPABILITY_CODE_LLGR] = 7,
+	[CAPABILITY_CODE_ROLE] = 1,	   [CAPABILITY_CODE_SOFT_VERSION] = 1,
+	[CAPABILITY_CODE_PATHS_LIMIT] = 5, [CAPABILITY_CODE_LINK_LOCAL] = 1,
 };
 
 bool bgp_capability_length_check(struct peer_connection *connection, uint8_t code, uint16_t length)

To apply the style suggestions:

curl https://gist.githubusercontent.com/polychaeta/f236da7f70b8d9c0391d8e87b04aed5b/raw/620fd8ba6142f652cd05f163eceb7df1caaf1450/style.diff | git apply -

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.