Skip to content

rtnl, nl80211: return true on successful acknowledgment without data - #473

Open
ptpt52 wants to merge 1 commit into
ucode-lang:masterfrom
x-wrt:master
Open

ptpt52 wants to merge 1 commit into
ucode-lang:masterfrom
x-wrt:master

Conversation

@ptpt52

@ptpt52 ptpt52 commented Oct 8, 2026

Copy link
Copy Markdown

When a netlink request is acknowledged by the kernel (e.g. NL_CB_ACK received), cb_done() transitions the request state to STATE_REPLIED. However, because standard ACK messages carry no payload attributes, st.res remains NULL.

Previously, both uc_nl_request() in rtnl and uc_nl_request_common() in nl80211 returned st.res directly under STATE_REPLIED, evaluating to null in ucode script context. This contradicts both the documented return type (@returns {Object|boolean} ... or true for successful acknowledgment without data) and the STATE_UNREPLIED case which already returns true. As a result, scripts checking if (!ret) or comparing against true falsely treat a successful request as a failure.

Return ucv_boolean_new(true) when st.state is STATE_REPLIED and st.res is NULL, properly signaling success when acknowledged by the kernel.

When a netlink request is acknowledged by the kernel (e.g. NL_CB_ACK
received), cb_done() transitions the request state to STATE_REPLIED.
However, because standard ACK messages carry no payload attributes,
st.res remains NULL.

Previously, both uc_nl_request() in rtnl and uc_nl_request_common() in
nl80211 returned st.res directly under STATE_REPLIED, evaluating to null
in ucode script context. This contradicts both the documented return
type (@returns {Object|boolean} ... or true for successful acknowledgment
without data) and the STATE_UNREPLIED case which already returns true.
As a result, scripts checking if (!ret) or comparing against true
falsely treat a successful request as a failure.

Return ucv_boolean_new(true) when st.state is STATE_REPLIED and st.res is
NULL, properly signaling success when acknowledged by the kernel.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
@ptpt52

ptpt52 commented Oct 8, 2026

Copy link
Copy Markdown
Author

@nbd168 cc

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant