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

Florian Eckert fe at dev.tdt.de
Mon Mar 23 05:43:28 EDT 2020


>> 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
>> option.
> No, I'm talking about the internal per-interface 'autostart' variable,
> which gets set to false if the user does a manual ifdown of an 
> interface
> (but not if it just failed to start up).

That doesn't help me.
If I do an manual ifup (CLI) or an ubus call the value does change.
I could not difference if this is a manual command by CLI or a direct 
ubus call.

In my case a connection has been established by the protocol handler 
successfully by netif.
But in the course of the established connection there is an error.
To track this I am using the mwan3.
The error can have different reasons.
The problem I have especially with wireless cellular interfaces.

* Layer 3 problem by the provider or in his backend
* Bug in the Modem firmware

Netifd can't detect this, because the operstate does not change
on radio devices the firmware of the modem does not support this.
Or it is an other problem that does not have to do with the modem.

The only thing that helps me is to reestablish
the connection with an ifup (CLI) or an ubus call.

The Problem is now i can not stop the connection because it is for now
not possible to distinguish if the stop is a user interaction or a 
script
interaction.

So If I only use ubus call on my script and user interaction uses 
ifup/ifdown CLI command
and if I set a flag by ifup/ifdown I could solve my issue. So that if a 
user
uses ifup/ifdown set the flag and so could proper stop the connection.
The restart code could does test the flag an so does not restart on user 
interaction
by the ifup/ifdown CLI command.

I can also imagine that we extend the netifd so that we add a flag to 
the ubus call
if it is a user interaction via the script ifup/ifdown. This way I can 
distinguish
if the connection is coming from a script or the command ifup/ifdown.
This is a very precise solution. The other one is more a general 
solution
with which other things are possible.

@felix thanks for reply :-)

- Florian

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list