Page MenuHomeFreeBSD

wg: change module name to if_wg
ClosedPublic

Authored by kp on Apr 27 2023, 3:50 PM.
Tags
None
Referenced Files
F88384558: D39853.id121230.diff
Sun, Jul 14, 4:01 PM
F88380738: D39853.id121144.diff
Sun, Jul 14, 2:56 PM
F88380681: D39853.id121230.diff
Sun, Jul 14, 2:54 PM
Unknown Object (File)
Tue, Jul 9, 10:03 PM
Unknown Object (File)
May 2 2024, 5:19 PM
Unknown Object (File)
May 2 2024, 5:03 PM
Unknown Object (File)
May 2 2024, 2:26 PM
Unknown Object (File)
May 2 2024, 1:20 PM
Subscribers

Details

Summary

Other virtual interface drivers (e.g. if_gif, if_stf, if_ovpn) all start
with if_. The wireguard file is also named if_wg, but the module name
was 'wg'.

Fix this inconsistency.

Reported by: Christian McDonald <cmcdonald@netgate.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Apr 27 2023, 3:50 PM

Does it deserve an alias wg -> if_wg ?
Or this change is only for current/14 and will not be MFCed to stable13 ?

In D39853#907226, @zlei wrote:

Does it deserve an alias wg -> if_wg ?

I'm not finding any alias mechanism for modules.

I don't think it's actually an issue for loading the module either, because kldload looks for the file name. We're not changing that, because it already is 'if_wg.ko' and will stay 'if_wg.ko'. The only difference is that the module name, shown with kldstat -m if_wg will now match the file name, whereas before this change it would respond to kldstat -m wg.

Or this change is only for current/14 and will not be MFCed to stable13 ?

I only care about current/14. I'm agnostic about MFC-ing this.

IIRC, the 'aliasing' mechanism for modules is to declare module alias as depending the actual module. The alias does nothing.

I tend to agree, though, that we likely don't need this.

zlei accepted this revision as: zlei.EditedApr 29 2023, 12:41 PM

Looks good to me.

Currently ,

  1. ifconfig wg create automatically infer the driver to if_wg.
  2. kldload wg is OK, but kldunload wg is NOT OK.

After this change, kldload wg will be unavailable.

As the man doc wg(4) says:

To load the driver as a module at boot time, place the following line in
    loader.conf(5):

          if_wg_load="YES"

I presume users will read the manpage then this change should have no impacts.

This revision is now accepted and ready to land.Apr 29 2023, 12:41 PM
This revision was automatically updated to reflect the committed changes.