[netifd] error code language semantics misleads
Username: n8v8R
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=2372
I would have preferred to submit a patch but my coding skills are not up to speed/standard...
Trying to debug a PPPoE issue it was not possible to utilize –verbose with ifup || ifdown since it would appear not being implemented. Thus started to look at what LuCI has on display when stopping || starting the
WAN
iface via LuCI:
Unknown error (USER_REQUEST)
Whilst USER_REQUEST would seem logical as being manually initiated by the user the Unknown error however led me down the garden path until having traced its source
https://openwrt-devel.openwrt.narkive.com/piBGMKkc/patch-ppp-detailed-last-error-support
To my understanding
*) echo "UNKNOWN_ERROR" ;;
gets tagged to any of the potential error codes (1 - 21), even to
- echo "OK" ;;
Which could introduce some sort of confusion to a simple minded user (being me).
- echo "OK" ;;
- echo "USER_REQUEST" ;;
would not appear to warrant an error tag at all. And the remainder, except 21, would appear to be rather specific than to be labelled as Unknown error.
Perhaps
*) echo "UNKNOWN_ERROR" ;;
is meant to be anything else that is not covered by codes 1 - 21 but that is not how it turns out on (LuCI) display.
I would thus humbly suggest to sort non-errors from actual errors and not tag the Unknown error to any of the specific error codes. It may help others that find themselves in a similar situation.
Whilst not being part of the topic but in a way related perhaps implementing
--verbose
for ifup || ifdown might go a long way in debugging connectivity issues.