jsimonetti/rtnetlink

rtnetlink: add Conn.Address.Get APIs for filtering by interface

mdlayher opened this issue · 2 comments

There are a few moving pieces here.

  • For historical reasons, rtnetlink message filtering has been hazardous due to lacking request validation on the kernel end. Setting netlink.GetStrictCheck will transparently opt-in to more advanced checks but may cause ENOPROTOOPT on older kernels.
  • With GetStrictCheck on, it seems the current empty AddressAttributes sent on requests causes EINVAL. This can be more easily troubleshooted by also setting netlink.ExtendedAcknowledge on for better errors.
  • Finally, the actual "get by interface index/name" code should be implemented. I kind of like the approach I took in ethtool (https://pkg.go.dev/github.com/mdlayher/ethtool#Client.LinkInfo) where one or both of index and name can be set rather than having duplicate methods.

I'll work on this as able and see what we can do about also properly supporting older kernels, even with reduced functionality.

@mdlayher are you stil interested in implementing this? If so, Ill keep this open, otherwise i would like to close this issue for now. We can always reopen if applicable.

No sorry, ended up not needing these.