Skip to content

netutils, system: include the protocol-specific netlink headers - #4177

Open
zhhyu7 wants to merge 2 commits into
apache:masterfrom
zhhyu7:upstream-genetlink
Open

zhhyu7 wants to merge 2 commits into
apache:masterfrom
zhhyu7:upstream-genetlink

Conversation

@zhhyu7

@zhhyu7 zhhyu7 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

include/netpacket/netlink.h in nuttx is being split, so that each
netlink protocol has its own header and a user includes only what it
speaks: the rtnetlink definitions move to netpacket/rtnetlink.h and the
netfilter ones to netpacket/nfnetlink.h.

Include the header each file actually needs. Six files, one include line
each, no functional change.

Impact

None on its own: the headers already exist in nuttx after the companion
pull request, and netpacket/netlink.h keeps everything these files use
until then. Afterwards, these files would no longer compile without this
change, so the two must land together.

Companion: apache/nuttx PR net/netlink: add the Generic Netlink protocol.

depends-on: apache/nuttx#22487

Testing

Built sim:dynconns (CI config, tools/ci/testlist/sim-02.dat) against
the companion nuttx branch, with gcc 13.4 and gcc 11. Without this change
the build fails on the netlib files:

netlib_getarptab.c:49:19: error: field 'gen' has incomplete type
netlib_getarptab.c:150:26: error: 'RTM_GETNEIGH' undeclared

With it, the build is clean and the netlink paths still work: the
RTM_GETLINK dump through netlib_get_devices() and the conntrack
listing through netlib_conntrack.c return the same results as before.

include/netpacket/netlink.h in nuttx is being split, so that each
netlink protocol has its own header and a user includes only what it
speaks: the rtnetlink definitions move to netpacket/rtnetlink.h and the
netfilter ones to netpacket/nfnetlink.h.

Include the header that each file actually needs.  No functional change.

Assisted-by: Kiro:claude-opus-4
Signed-off-by: daichuan <daichuan@xiaomi.com>
checkpatch reports a missing blank line after a declaration in each of
these files, and one misaligned brace in netlib_getdevs.c.  They are
pre-existing, but the previous commit touches every one of these files,
so fix them here rather than leave the series reporting errors.

Whitespace only: a blank line after seventeen declarations and the
indentation of one closing brace.

Assisted-by: Kiro:claude-opus-4
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants