ctdb-scripts: Drop assumption that there are VLANs with no '@'
commit517f09eb6f325af0d69b14d5b6b0e6b84616c6ce
authorMartin Schwenke <martin@meltin.net>
Wed, 17 Aug 2022 01:04:10 +0000 (17 11:04 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 16 Sep 2022 03:36:32 +0000 (16 03:36 +0000)
tree3559b178ee41a3b1916e7048badd546daf04224b
parentcc64ea24daa649dc8de4a212c7abfbe111095655
ctdb-scripts: Drop assumption that there are VLANs with no '@'

VLAN configuration on Linux often uses a convention of naming a VLAN
on <iface> with VLAN ID <tag> as <iface>.<tag>.  To be able to monitor
the underlying interface, the original 10.interface code naively
simply stripped off the '.' and everything after (i.e. ".*", as a glob
pattern).

Some users do not use the above convention.  A VLAN can be named
without including the underlying interface, but still with a
tag (e.g. vlan<tag> - the word "vlan" following by the tag) or, more
generally, perhaps without a tag (e.g. <vlan> - an arbitrary name).
The ip(8) command lists a VLAN as <vlan>@<iface>.  The underlying
interface can be found by stripping everything up to and including an
'@' (i.e. "*@").

Commit bc71251433ce618c95c674d7cbe75b01a94adad9 added support for
stripping "*@".  However, on suspicion, it kept support for the case
where there is no '@', falling back to stripping ".*".  If ip(8) ever
did this then it was a long time ago - it has been printing a format
including '@' since at least 2004.

Stripping ".*" interferes with interesting administrative decisions,
like having '.' in interface names.

So, drop the fallback to stripping ".*" because it appears to be
unnecessary and can cause inconvenience.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions