[LEDE-DEV] [PATCH] netifd: propagate error code on netifd_reload()

Felix Fietkau nbd at nbd.name
Fri Mar 10 01:40:42 PST 2017


On 2017-03-10 10:38, Alexandru Ardelean wrote:
> The context is that we generate some of the UCI config
> for netifd via scripts/programs.
> 
> Every once in a while, there's a goof when doing that
> UCI generation, and netifd prints out the error at
> stderr, but returns 0 (success) err-code.
> 
> This change will fail the ubus call if UCI config
> is invalid for /etc/config/network & /etc/config/wireless,
> or could not be loaded (via uci_load()).
> 
> Admittedly, failing the entire ubus call could
> be a bit much [depending on various views].
> Probably one idea, would be to return the err-code
> as a ubus reply data (via ubus_send_reply()).
> Not sure.
> 
> Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
When you return error codes from the ubus handler, please make sure you
return proper ubus error codes instead of things like -1.

- Felix




More information about the Lede-dev mailing list