push_mac_acl and push_radio_channel ignore failed commands #35

Closed
opened 2026-11-07 18:42:33 +00:00 by christianmanivong · 0 comments
Owner

push_mac_acl and push_radio_channel (napalm_openwrt/wireless_mixin.py, at e2eda54) send each step through _send_command and never look at the result:

  • a refused uci set …macfilter, uci add_list …maclist, uci commit wireless or wifi reload passes silently;
  • push_mac_acl with an SSID name that matches no wifi-iface section does nothing and returns normally;
  • push_radio_channel restarts wifi even if the uci set was refused.

STANDARDS §3/§4: a write is an action, and "a refused or failed step" must raise. The caller cannot tell an applied ACL from one that never landed: NetOrk/netork#2145 makes NetOrk push SSID MAC ACLs again (the tasks had been unregistered), so this now decides whether a blacklist the user set is really enforced.

Fix (test first, with recorded output): run each uci step so that its exit status is checked (e.g. append ; echo __rc=$? or use the driver's run_command with a status), raise on a non-zero status naming the step, and raise when no wifi-iface carries the SSID. Same for push_radio_channel.

Related: NetOrk/netork#695 / #408 move more UCI writes into this driver later (with NetOrk/netork#1105); they will use the same checked step runner.

prio/P2: an ACL change can fail silently on the device while NetOrk shows it as applied.

`push_mac_acl` and `push_radio_channel` (`napalm_openwrt/wireless_mixin.py`, at e2eda54) send each step through `_send_command` and never look at the result: - a refused `uci set …macfilter`, `uci add_list …maclist`, `uci commit wireless` or `wifi reload` passes silently; - `push_mac_acl` with an SSID name that matches no `wifi-iface` section does nothing and returns normally; - `push_radio_channel` restarts wifi even if the `uci set` was refused. STANDARDS §3/§4: a write is an action, and "a refused or failed step" must raise. The caller cannot tell an applied ACL from one that never landed: NetOrk/netork#2145 makes NetOrk push SSID MAC ACLs again (the tasks had been unregistered), so this now decides whether a blacklist the user set is really enforced. **Fix (test first, with recorded output):** run each `uci` step so that its exit status is checked (e.g. append `; echo __rc=$?` or use the driver's `run_command` with a status), raise on a non-zero status naming the step, and raise when no `wifi-iface` carries the SSID. Same for `push_radio_channel`. Related: NetOrk/netork#695 / #408 move more UCI writes into this driver later (with NetOrk/netork#1105); they will use the same checked step runner. prio/P2: an ACL change can fail silently on the device while NetOrk shows it as applied.
christianmanivong added the
prio
P2
bug
labels 2026-11-07 18:42:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-openwrt#35