Hello all,
I experienced some strangeness setting the description on an interface:
root@gateway [~] # ifconfig tap0 create
================
root@gateway [~] # ifconfig tap0 inet 1.2.3.4
================
root@gateway [~] # ifconfig tap0
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr fe:e1:ba:d2:33:56
index 9 priority 0 llprio 3
groups: tap
status: no carrier
inet 1.2.3.4 netmask 0xff000000 broadcast 1.255.255.255
================
root@gateway [~] # ifconfig tap0 description iPhone 14
================
root@gateway [~] # ================
root@gateway [~] # ifconfig tap0
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr fe:e1:ba:d2:33:56
description: iPhone
index 9 priority 0 llprio 3
groups: tap
status: no carrier
inet 0.0.0.14 netmask 0xff000000 broadcast 0.255.255.255
================
Note that the last command changed the net address from 1.2.3.4 to 0.0.0.14
Of course, I should have put iPhone 14 in quotes. But anyway, the address
change should not have happened.
According to “man ifconfig”:
SYNOPSIS
ifconfig [-AaC] [-M lladdr] [interface] [address_family]
[address [dest_address]] [parameters]
The command string after the interface definition is “description iPhone 14”.
Obviously, the 14 has been interpreted as an inet address, hence -> 0.0.0.14.
But then “iPhone” would need to be the address family, given the order of
parameters defined by the man page. But it has been taken as “description” and
shown in the ifconfig output above. Or, to put it otherwise, no address
specification should be accepted after “description”.
This may seem a bit of nitpicking and I am not sure if this a bug, a
documentation bug or a misunderstanding on my side.
Anyway, since altering the address of an interface might well render your
system unreachable, I figured this issue worth noting.
OpenBSD 7.9, running under FreeBSD bhyve.
Kind regards,
Heinrich