-
-
Notifications
You must be signed in to change notification settings - Fork 658
[client] Use native facilities to add routes on BSD and Windows #3862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces use of external route
commands on Windows with direct IP Helper syscalls to manage routing entries.
- Introduces
addRoute
,deleteRoute
, and helper functions to set upMIB_IPFORWARD_ROW2
via Windows APIs - Removes exec-based command logic and related imports
- Adds syscall wrappers for creating, deleting, and querying route entries
Comments suppressed due to low confidence (3)
client/internal/routemanager/systemops/systemops_windows.go:3
- New code uses fmt.Errorf, binary.BigEndian, and unsafe.Pointer but the imports for "fmt", "encoding/binary", and "unsafe" are missing. Please add these imports to ensure the file compiles.
import (
client/internal/routemanager/systemops/systemops_windows.go:327
- [nitpick] The function name uses the acronym "LUID" while the type is declared as lowercase
luid
. Consider renaming the type toLUID
or the function toconvertInterfaceIndexToLuid
for consistency with Go naming conventions.
func convertInterfaceIndexToLUID(interfaceIndex uint32, interfaceLUID *luid) error {
client/internal/routemanager/systemops/systemops_windows.go:192
- New
addRoute
(and related syscall wrappers) lack unit tests. Consider adding tests or mocks to verify both successful execution paths and error handling.
func addRoute(prefix netip.Prefix, nexthop Nexthop) (err error) {
13b4c2b
to
e802c69
Compare
e802c69
to
79b6efc
Compare
ee29432
to
0dc0962
Compare
482ab2d
to
824ee96
Compare
824ee96
to
442330f
Compare
442330f
to
4edcaae
Compare
4f1f05d
to
9888287
Compare
ffbe32d
to
abe8f32
Compare
abe8f32
to
005cfc3
Compare
005cfc3
to
f3dafbd
Compare
4914ddf
to
86a3cc7
Compare
86a3cc7
to
3e026a8
Compare
19bddf7
to
d9b8098
Compare
@lixmal, please merge the main branch to fix the unit tests. |
|
Describe your changes
net.IP
andnet.IPNet
withnetip.Addr
andnetip.Prefix
inwgaddr.Address
Issue ticket number and link
Stack
Checklist