Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/net/netlink, vendor/golang.org/x/net/netlink: new package #20637
I propose to have a x/net/netlink package and vendor it to the standard library for maintenance purposes.
Netlink is a Linux-specific service for manipulating networking facilities inside the kernel. Fortunately, unlike routing messages and sockets on BSD variants, it doesn't have much ABI incompatibility between major kernel releases, but its complexity like TLV-in-AVP-in-TLV data representation could be a root cause of issues like #18714, #16681. So I think it's better to have and maintain a small separated package like the existing x/net/route package.
The exposed API would be like the following:
What bug is that?
Which existing functions/methods don't work?
Got a sample program?
I've got a netlink package that does its best to just focus on pure netlink: not conflating it with rtnetlink, genetlink, etc. I would be happy to contribute parts or all of it to become
That being said, because of #10565, I don't have an easy way of configuring timeouts without doing all of the epoll work myself. This isn't such a big deal because netlink is Linux only, but I'd be happy to see that issue solved for the sake of other sockets packages which may attempt to provide some cross platform functionality. 
As for the original point, I think it could make sense to provide a high quality netlink package in x/net that could be useful both inside and outside the standard library.
The biggest potential problem I can think of with the existing netlink functionality in
I'm happy to help make this happen if there is a consensus that this proposal should move forward.
More info on my concurrency woes with netlink and Go: http://lists.infradead.org/pipermail/libnl/2017-February/002293.html