Skip to contentSkip to conversation

package/bird: fix build failure with bfd

Buildroot Thomas Perale via buildroot 1 participant 1 message May 16, 2025

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=6e18929f04d3f2506f047600f8fa34ce9447a59b
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2025.02.x

The 'bird' package with only the BR2_PACKAGE_BIRD_BFD=y protocol enabled fails to build with the following error

```
bison  -Dparse.lac=full -Dparse.error=verbose -dv -pcf_ -b obj/conf/cf-parse obj/conf/cf-parse.y
proto/bfd/config.Y:204.27-33: error: symbol 'ADDRESS' is used, but is not defined as a token and has no rules
  204 |  | bfd_show_sessions_args ADDRESS net_or_ipa { net_copy(&($$->address...
      |                           ^~~~~~~
```

The ADDRESS token is defined only when certain protocols (e.g. OSPF, RIP, RPKI, or BGP) are enabled. As a result, builds including any of these protocols do not encounter the issue.

The issue can be reproduced with the commands:

cat >.config <<EOF
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_BIRD=y
BR2_PACKAGE_BIRD_BFD=y
# BR2_PACKAGE_BIRD_BGP is not set
EOF
make olddefconfig
make bird

This patch backports upstream commits that define the ADDRESS token for the BFD protocol.

Fixes:
https://autobuild.buildroot.org/results/68c5dd84585a7018ad57ea3e7134748c08858ef7/

[Julien: add commands to reproduce the issue]
(cherry picked from commit 80cfdcb86ba455ed286bea1f557ff351ac6ce263)
---
 ...0002-BFD-Fix-missing-keyword-declarations.patch | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
package/bird/0002-BFD-Fix-missing-keyword-declarations.patch new file +31 -0
new file mode 100644
index 0000000000..29ec8abf7b
@@ -0,0 +1,31 @@
+From e5b582868c5fa7e185a12023784adc8df7b8c7a2 Mon Sep 17 00:00:00 2001
+From: Ondrej Zajicek <[email protected]>
+Date: Thu, 9 Jan 2025 00:30:37 +0100
+Subject: [PATCH] BFD: Fix missing keyword declarations
+
+Some keywords were missing for BFD-only build.
+
+Upstream: https://gitlab.nic.cz/labs/bird/-/commit/c386369645e584facaad88ec292f2fe0bc70d974
+[tperale: backport v2.15.1]
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ proto/bfd/config.Y | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/proto/bfd/config.Y b/proto/bfd/config.Y
+index 1a7474b0..70b09ad8 100644
+--- a/proto/bfd/config.Y
++++ b/proto/bfd/config.Y
+@@ -21,8 +21,8 @@ extern struct bfd_config *bfd_cf;
+ 
+ CF_DECLS
+ 
+-CF_KEYWORDS(BFD, MIN, IDLE, RX, TX, INTERVAL, MULTIPLIER, PASSIVE,
+-	INTERFACE, MULTIHOP, NEIGHBOR, DEV, LOCAL, AUTHENTICATION,
++CF_KEYWORDS(BFD, MIN, IDLE, RX, TX, INTERVAL, MULTIPLIER, PASSIVE, ADDRESS,
++	INTERFACE, MULTIHOP, NEIGHBOR, DEV, ALL, LOCAL, AUTHENTICATION,
+ 	NONE, SIMPLE, METICULOUS, KEYED, MD5, SHA1, IPV4, IPV6, DIRECT,
+ 	STRICT, BIND)
+ 
+-- 
+2.49.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot