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

WireGuard and TUN interfaces should be ignored by default #302

Open
liweitianux opened this issue Mar 2, 2024 · 3 comments
Open

WireGuard and TUN interfaces should be ignored by default #302

liweitianux opened this issue Mar 2, 2024 · 3 comments

Comments

@liweitianux
Copy link

According to the current code, TAP interfaces are ignored by default, but TUN interfaces are not. Why?

In addition, given the availability of WireGuard on various OSes, the WireGuard interfaces should also be ignored by default.

Regards.

@liweitianux
Copy link
Author

Currently, dhcpcd ignores an interface by checking its name. However, the interface can be renamed, at least on FreeBSD and DragonFly BSD. And then the ignoring rules would just not work.

I think an interface should be ignored by checking its type (e.g., IFT_BRIDGE). However, it seems broken for TAP interfaces (with type IF_ETHER) and TUN interfaces (with type IF_PPP). In addition, it seems that BSDs don't provide an ioctl command to retrieve the interface type.

Any ideas?

@rsmarples
Copy link
Member

IFT_BRIDGE and others are checked here:
https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/if.c#L604

I'll remove bridge and others with a note that we check the IFT equivalent where we can.

As on interface renaming, yeah it's a nasty problem. IMO if an interface can be renamed is MUST have a mechanism to get the original name.

@liweitianux
Copy link
Author

Hi @rsmarples, thank you for the prompt reply 😄.

IFT_BRIDGE and others are checked here: https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/if.c#L604

Cool. I didn't know that sdl_type was equivalent to if_type before.

I'll remove bridge and others with a note that we check the IFT equivalent where we can.

That would be better and avoid such confusions.

As on interface renaming, yeah it's a nasty problem. IMO if an interface can be renamed is MUST have a mechanism to get the original name.

Yes, I totally agree. There should be an ioctl command to get this basic information by giving the interface name, including the base name (e.g., em) and unit number.

Do you have any ideas ready? I think we can propose such a request to FreeBSD and DragonFly BSD. I'll certainly implement it in DragonFly 😃.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants