-
-
Notifications
You must be signed in to change notification settings - Fork 586
Refactor(dialer): with socket options #525
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
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
Refactors the dialing layer from a mutable DefaultDialer with atomic fields into a socket-option registration model, and updates engine/DNS integration to use the new dialer entrypoints.
Changes:
- Replace
DefaultDialer’s per-field configuration (interface/mark) with aSocketOptioninterface and registration API. - Implement
WithBindToInterface/WithRoutingMarkper-OS usingsyscall.RawConncontrol hooks. - Update engine and DNS resolver to use
dialer.RegisterSockOpt(...)anddialer.DialContext.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| engine/engine.go | Switches interface binding + fwmark configuration to socket-option registration. |
| dns/resolver.go | Points the Go DNS resolver dialer at the new dialer.DialContext wrapper. |
| dialer/dialer.go | Introduces option registration, storage, and application via net.Dialer / net.ListenConfig control hooks. |
| dialer/sockopt.go | Adds SocketOption/SocketOptionFunc, an unsupported sentinel, and a shared RawConn.Control helper. |
| dialer/sockopt_linux.go | Adds Linux implementations for bind-to-device and SO_MARK via socket options. |
| dialer/sockopt_darwin.go | Adds Darwin bind-to-interface socket option; routing mark is unsupported. |
| dialer/sockopt_windows.go | Adds Windows bind-to-interface socket option; routing mark is unsupported. |
| dialer/sockopt_freebsd.go | Keeps routing-mark behavior via socket option; bind-to-interface is unsupported. |
| dialer/sockopt_openbsd.go | Keeps routing-mark behavior via socket option; bind-to-interface is unsupported. |
| dialer/sockopt_others.go | Removes the previous non-unix/non-windows no-op implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.