Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Virtual private networks
»
Wireguard interface numbers
« previous
next »
Print
Pages: [
1
]
Author
Topic: Wireguard interface numbers (Read 1089 times)
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Wireguard interface numbers
«
on:
July 31, 2023, 03:25:55 pm »
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 ...
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
CJ
Hero Member
Posts: 832
Karma: 30
Re: Wireguard interface numbers
«
Reply #1 on:
July 31, 2023, 04:22:32 pm »
Did this change? My wireguard interface is wg0 and has been since the initial setup a couple of years ago.
Logged
Have Answer, Will Blog
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Re: Wireguard interface numbers
«
Reply #2 on:
July 31, 2023, 04:25:25 pm »
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.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
CJ
Hero Member
Posts: 832
Karma: 30
Re: Wireguard interface numbers
«
Reply #3 on:
July 31, 2023, 04:31:29 pm »
Interesting. I'll have to keep an eye out for that as I work on my tutorials now that 23.7 is out.
Logged
Have Answer, Will Blog
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Wireguard interface numbers
«
Reply #4 on:
July 31, 2023, 05:05:42 pm »
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
Logged
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Re: Wireguard interface numbers
«
Reply #5 on:
July 31, 2023, 06:23:35 pm »
You could have switched to the === operator where appropriate.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Wireguard interface numbers
«
Reply #6 on:
July 31, 2023, 07:30:07 pm »
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
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Virtual private networks
»
Wireguard interface numbers