diff options
| author | zhangyuyang <[email protected]> | 2026-09-23 10:45:50 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-11-24 15:04:14 +0800 |
| commit | 04110ba74d7ed88ec4a65850109e8b3a00d87776 (patch) | |
| tree | 1274a98eb9e4507d1977158ac4193fdd23c7d970 /components/net/netdev/src | |
| parent | bf8719c23b313a2328d5f0f36b51492d1d78061e (diff) | |
[components][netdev] Fix AF_NETLINK build errors
Use each network device's ifindex when invoking the callback.
Add a forward declaration for struct msg_buf.
Signed-off-by: zhangyuyang <[email protected]>
Diffstat (limited to 'components/net/netdev/src')
| -rw-r--r-- | components/net/netdev/src/netdev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c index 93b6baf0e5..f64cbd4c49 100644 --- a/components/net/netdev/src/netdev.c +++ b/components/net/netdev/src/netdev.c @@ -449,16 +449,15 @@ int netdev_getnetdev(struct msg_buf *msg, int (*cb)(struct msg_buf *m_buf, struc nd_num = rt_slist_len(&cur_nd_list->list) + 1; rt_spin_unlock(&_spinlock); - err = cb(msg, cur_nd_list, nd_num, nd.ifindex, ROUTE_IPV4_TRUE); + err = cb(msg, cur_nd_list, nd_num, cur_nd_list->ifindex, ROUTE_IPV4_TRUE); if (err < 0) return err; - rt_spin_lock(&_spinlock); rt_slist_for_each_entry(nd_node, &(cur_nd_list->list), list) { rt_spin_unlock(&_spinlock); - err = cb(msg, nd_node, nd_num, nd.ifindex, ROUTE_IPV4_TRUE); + err = cb(msg, nd_node, nd_num, nd_node->ifindex, ROUTE_IPV4_TRUE); if (err < 0) { return err; |
