Skip to content

fix(orchestrator): prevent nil panic when finding default gateway#3146

Open
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/orchestrator-network-nil-route-dst
Open

fix(orchestrator): prevent nil panic when finding default gateway#3146
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/orchestrator-network-nil-route-dst

Conversation

@AdaAibaby

Copy link
Copy Markdown
Contributor

In Linux, the default route (0.0.0.0/0) has a nil Dst field in the netlink.Route struct. The previous code called route.Dst.String() without a nil check, which would panic on systems where the default route's Dst is nil.

Fix by checking route.Dst == nil directly, which is the canonical way to identify the default route.

/cc @jakubno @dobrac @ValentaTomas Would appreciate your review on this change, thanks!

In Linux, the default route (0.0.0.0/0) has a nil Dst field in the
netlink.Route struct. The previous code called route.Dst.String() without
a nil check, which would panic on systems where the default route's Dst
is nil.

Fix by checking route.Dst == nil directly, which is the canonical way to
identify the default route.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

No feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants