fix(vpcnatgateway): bgp speaker would crash if no ipv4 is available#6059
fix(vpcnatgateway): bgp speaker would crash if no ipv4 is available#6059oilbeater merged 1 commit intokubeovn:masterfrom
Conversation
Summary of ChangesHello @SkalaNetworks, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request provides a crucial fix to prevent the BGP speaker from crashing in scenarios where an IPv4 address is not available for its RouterID. It ensures that the RouterID defaults to '0.0.0.0' to maintain compatibility and stability with GoBGP v4. Additionally, the change includes making the pod's IP addresses explicitly accessible to the speaker container via an environment variable, which is essential for the updated RouterID determination logic. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix a crash in the BGP speaker when no IPv4 address is available by falling back to 0.0.0.0 as the router ID. While the intent is correct, the implementation introduces two critical issues. In pkg/speaker/config.go, a necessary nil check is removed, which can lead to a panic. In pkg/util/vpc_nat_gateway.go, a missing comma in a struct literal will cause a compilation failure. I have provided suggestions to fix both of these critical issues.
aa3e8d6 to
6bc7423
Compare
Pull Request Test Coverage Report for Build 20243397977Details
💛 - Coveralls |
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 <contact@skala.network>
6bc7423 to
03bab4f
Compare
…ubeovn#6059) 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 <contact@skala.network> Signed-off-by: donghee-park-rsk <donghee.park@rakuten.com>
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.
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #(issue-number)