-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Consider using github.com/mdlayher/netlink #499
Comments
@mdlayher Thanks for dropping in! If you're interested, a lot of us are hanging out in #mgmtconfig on Freenode IRC. I'd love to join you, but I don't have slack. If you'd like to help us patch our current code to improve it as you suggest, we'd love that! |
Good to know! I'd like to loop back and make some contributions at some point. What you're doing in your netlink syscall code seems sane. If you're interested in making use of timeout support and such, my package is in good shape to handle that. |
@mdlayher Had a very quick look just now at your new lib...
Assuming I understand correctly (which is most possibly not the case) wouldn't you instead want:
Which could replace both of those? My knowledge of system networking internals is a bit weak, so any help you can provide to this project would be appreciated! We'd love to have more robust and featureful network resources and functions in mgmt! |
Basically, the netlink stack under the hood is leaning on https://golang.org/pkg/os/#File.SetDeadline to leverage the runtime network poller's ability to handle non-blocking system calls, timeouts, etc. Having Receive take a context is an interesting idea, but there's no runtime hook for doing so at this point. Perhaps it'd be worth adding a |
@mdlayher The two tricky things which we always need to be able to do are:
Is that possible with your Receive method? AFAICT, I'd have to set a small deadline and poll. Unless the Close causes the Receive call to unblock, but then I'd have to keep making them... |
This is a problem many Golang users have faced, including myself. Even the Golang community can't decide: The cancellation of blocking IO operations in Go is a really tricky problem to solve, afaik. I think the "most accepted" option is to set the deadline to https://golang.org/pkg/os/#File.SetDeadline says
|
I'm going to reopen this as we should eventually take some time to revisit and see about if a port to this would make sense. Thanks again for your library Matt! |
No worries! I was just closing out things I had no intent of following up on. I do believe the current v1 should suit your needs, but if not, feel free to open an issue. |
Hey folks! I was browsing through GitHub search and came across this blog by @jonathangold that talks about using netlink sockets in this project:
https://github.com/jonathangold/jonathangold.ca/blob/706d0af6aa568cbd1524b56543410227d466d0db/content/blog/go-netlink-and-select.md
Just wanted to let you all know that as of Go 1.12, https://github.com/mdlayher/netlink is fully integrated with the runtime network poller, so we get full support for timeouts, cancelation of receive, etc.
You may also be interested in https://github.com/mdlayher/kobject for kobject uevents, and https://github.com/jsimonetti/rtnetlink as an alternative to vishvananda/netlink.
Finally, a group of us who work on various low-level networking and netlink related things can be found in #networking on Gophers Slack, and we'd love to have you join us if possible!
Thanks for your time, and feel free to close this out if you'd like.
The text was updated successfully, but these errors were encountered: