Closed citronalco closed 4 years ago
Shouldn't this only change, in case there is no batman mac
Shouldn't this only change, in case there is no batman mac
The order is intentionally: At first try to get the machine-id, and only if's not availablle (means: no systemd on the machine) use the batman mac. If you don't give your batman interface a mac manually it gets a new mac on every boot, while the machine-id is set during OS installation and is fixed after that. As the node_id should identify a node, a fixed node_id that survives reboots is what's required.
I guess @rubo77 intended to mention that upgrading mesh-announce to this change will change the node_id of already existing setups.
I think this solution makes sense for Babel setups.
For batadv, I consider any setup that doesn't fix all MAC addresses broken, so this change would not be necessary - and, as already pointed out by others, problematic for existing setups.
OK. Seems I underestimated the dimension of this topic.
If you want to avoid a breaking switch to machine-id, maybe a command line option could be added to enable the usage of machine-id instead of batman's MAC. Or one to set the node_id manually. But that's something you have to decide.
@NeoRaider: Can you explain why you consider setups without fixed MAC addresses on the batman interfaces broken? During the last few months I checked many publicly available saltstack/ansible setups, and only a minority of them manually sets them (while most of them do for the connected bridge devices), so it's not that obvious.
Closing PR since the current approach presented does not make any sense. Choosing the nodeid is not the job of mesh-announce. The nodeid is a configuration feature of the gateway. Using the systemd machine id is not a proper implementation since the identity of a gateway should be independent from the host it is deployed on. I might consider adding a (per domain) config option for it instead.
If available use systemd's machine-id as node_id. Fixes #37 and, for non babel setups, the necessity of having fixed MAC addresses on the bat interfaces.