From 03bab4f15dc364750497cc1b5bde5f5dc6265a9c Mon Sep 17 00:00:00 2001 From: SkalaNetworks Date: Mon, 15 Dec 2025 19:14:25 +0100 Subject: [PATCH] fix(vpcnatgateway): bgp speaker would crash if no ipv4 is available GoBGP v4 seems to crash when serializing with an invalid RouterID, whereas on older version, it defaulted to 0.0.0.0. There's functionally no problem with multiple peers having the same RouterID when doing eBGP. If using route reflectors, it might be more of a problem. In that case, users can use the --router-id parameter. Note that this case should not occur anyway, the NAT GW doesn't support IPv6 only networks right now as it cannot do NATv6. This is purely a failover to prevent crashes. Signed-off-by: SkalaNetworks --- pkg/speaker/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/speaker/config.go b/pkg/speaker/config.go index d7b8aef5666..4a95ebe0622 100644 --- a/pkg/speaker/config.go +++ b/pkg/speaker/config.go @@ -183,11 +183,11 @@ func ParseFlags() (*Configuration, error) { if config.RouterID == nil { if podIPv4 != "" { config.RouterID = net.ParseIP(podIPv4) - } else { - config.RouterID = net.ParseIP(podIPv6) } + if config.RouterID == nil { - return nil, errors.New("no router id or POD_IPS") + // RouterID must be an IPv4. If no IPv4 exists on the speaker, fallback to 0.0.0.0 to avoid GoBGP crashing. + config.RouterID = net.ParseIP("0.0.0.0") } }