Skip to content
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

wireguardctrl: consider eliminating Client.DeviceByIndex #6

Closed
mdlayher opened this issue Aug 7, 2018 · 2 comments

Comments

2 participants
@mdlayher
Copy link
Member

commented Aug 7, 2018

This function is arguably less friendly than Client.DeviceByName. On top of this, there is no concept of an interface index in the userspace interface, so in wguser, it is implemented by calling net.InterfaceByIndex and then Client.DeviceByName immediately after.

Removing this function also means that the method Client.DeviceByName could be shortened to just Client.Device.

@olemd

This comment has been minimized.

Copy link

commented Aug 10, 2018

I agree, remove it. It simplifies the code, both because of less code and because I don't expect anyone would ever use DeviceByIndex via wireguardctrl.

@mdlayher

This comment has been minimized.

Copy link
Member Author

commented Aug 10, 2018

SGTM, I think I'll just do it. Anybody who cares about interface index can do a lookup on their own and then use Device(name string). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.