On Sunday, 2 January 2022 15:20:20 CET Sven Eckelmann wrote:
This now causes the "--force" option (+its storage in the globals data structure) to be completely useless.
Why would global->force be useless ? The alfred_server() function still uses the global->force state to determine if globals->mesh_iface is configured correctly.
I would prefer to have this handling still be there when !list_empty(&globals->interfaces).
To be honest, I hadn't fully understood what use case global->force is trying to address. What do you have in mind ? Checking for list_empty() will require alfred to be always started with an interface configured while alfred could be used without any interface at all and operate as local data storage between 2 processes on the same system or the interface could be configured at a later time (via unix socket).
And why is it necessary to not open the sockets on startup when interfaces are already given?
The main while loop calls netsock_reopen() in each round which will open all necessary sockets (unless I am mistaken). My guess is that this was added when the ALFRED_CHANGE_INTERFACE call was added. Therefore, the netsock_open() call is somewhat redundant unless alfred is meant to always require an interface at startup time and alfred is meant to bail out whenever that configured interface isn't available at startup time.
Cheers, Marek