Wireguard interface numbers

Started by Patrick M. Hausen, July 31, 2023, 03:25:55 PM

Previous topic - Next topic
Hi!

Since when do the WireGuard interfaces start with wg1 instead of wg0? And why? Drives me up the walls. Network engineers count from 0.

Seriously this is just cosmetic but I spent a good half an hour searching for some leftover wg0 or some other mistake ...
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Did this change?  My wireguard interface is wg0 and has been since the initial setup a couple of years ago.

I deleted mine because of a completely new setup, created a new one - oops, "wg1". WTF? Any leftovers from the old "wg0"? Delete wg1, reboot, create new configuration - "wg1". Delete, search config directories for and config file remnants ... nothing.

So the change seems to be intentional.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Interesting.  I'll have to keep an eye out for that as I work on my tutorials now that 23.7 is out.

https://github.com/opnsense/changelog/blob/6e864439f8e95e693deed1f7b1827ee6537b7e77/community/22.1/22.1.10#L32 ;)

It was done to appease PHP's increasing need to validate everything and throw warnings around like a strict typed language.


Cheers,
Franco

You could have switched to the === operator where appropriate.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Unfortunately PHP 7 sort of forced us into using empty() as a general check method for various reasons. One of the downsides of empty() is that "0" is evaluated to true making "0" handling harder than expect and with new restrictions in PHP 8 it tries to tie it down further and we don't want to change idioms for each major PHP iteration or write our own boilerplate access function library.


Cheers,
Franco