You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ifreq functionality through the Ifreq interface and its IoctlIfreq interface currently do not offer the flexibility it could have.
A simple example would be to issue some ioctl where ifr should be a pointer.
There are of course workarounds for that (e.g. issuing raw ioctls via the syscall API and providing a byte slice) but adding a more robust interface like already supposed would be a good idea.
I currently don't see any reason why not to expose this already existing functionality, but maybe I miss a bigger structural point here.
If you do not have enough resources for implementing this change I'd be happy to help you out on that.
The code suggests that @mdlayher once thought about exporting access to IfreqData, but postponed it due accessibility through IoctlGetEthtoolDrvinfo. This although is read only.
The text was updated successfully, but these errors were encountered:
To clarify: what are you trying to do? IIRC my intent was to avoid exposing an unsafe.Pointer in the API, in favor of exposing type-safe wrappers for each type we need.
I want to issue an ioctl call that passes as an argument an Ifreq struct that holds custom ifr data that is a uintptr. The API calls for Ifreq although only expose methods to SetInet4Addr, SetUint16, SetUint32, none of which is suitable to set a pointer value (64bit) for https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/if.h#L253.
Alternatively, one could add an interface to set 64bit values or even arbitrary byte slices to ifr.raw.Ifru.
Proposal Details
The ifreq functionality through the Ifreq interface and its IoctlIfreq interface currently do not offer the flexibility it could have.
A simple example would be to issue some ioctl where ifr should be a pointer.
There are of course workarounds for that (e.g. issuing raw ioctls via the syscall API and providing a byte slice) but adding a more robust interface like already supposed would be a good idea.
I currently don't see any reason why not to expose this already existing functionality, but maybe I miss a bigger structural point here.
If you do not have enough resources for implementing this change I'd be happy to help you out on that.
The code suggests that @mdlayher once thought about exporting access to IfreqData, but postponed it due accessibility through IoctlGetEthtoolDrvinfo. This although is read only.
The text was updated successfully, but these errors were encountered: