[OpenWrt-Devel] [PATCH 1/1] netifd: add pre-up/down post-up/down callback handling

Florian Eckert fe at dev.tdt.de
Fri Mar 20 10:21:00 EDT 2020

>> With this change we can decide if this is a user interaction with 
>> CLI/LuCI,
>> because with the new callback mechanism I can set/delete a uci config 
>> flag so
>> that the connection should really disconnected. And so does not 
>> restart on a
>> failed connetion tracking again because the uci config flag is not 
>> set.
>> Signed-off-by: Florian Eckert <fe at dev.tdt.de>
> netifd already tracks for every interface if the user requested it to 
> be
> enabled or not via the 'autostart' flag, which you can query via ubus.

I know this is done wit the uci option auto for this interface.
But if I disable this flag, then on the next boot this interface does 
not start
on boot anymore. I have to start this manual. So I think this is not an 

> Is it enough for your use case to track that flag?

As far as I can tell at this point, it's not an option to use this flag.

> If not, please go into more detail, because I don't think hacking

In the LuCI and in the CLI the command ifup/ifdown is used, if the
user wants to start/stop this interface explicitly manual.
The auto option is not touched.

The ifup/ifdown script executes an ubus call to set the interface 
up/down [1].
After the execution is preformed by netifd (proto) then the hotplug 
scripts are
execute with different ACTION (up/down/ifup-failed.

If I want to know if the Command is execute by an
user interaction by the CLI (ifup/ifdown) or LuCI [2][3] the only 
I have is to hook into the ifup/ifdown command.

I would also like to point out that debian also has this possibility [4] 
in the
network configuration.

- Florian

[4] https://wiki.debian.org/NetworkConfiguration

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list