3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

netconfig: Store pointer to netdev instead of ifindex

To avoid repeated lookups by ifindex, replace the ifindex member in
struct netconfig with a struct netdev pointer.  A struct netconfig
always lives shorter than the struct netdev.
This commit is contained in:
Andrew Zaborowski 2022-08-29 19:35:56 +02:00 committed by Denis Kenzior
parent 98ba09562e
commit a8b1139dcb

View File

@ -54,7 +54,7 @@
struct netconfig { struct netconfig {
struct l_netconfig *nc; struct l_netconfig *nc;
uint32_t ifindex; struct netdev *netdev;
char *mdns; char *mdns;
struct ie_fils_ip_addr_response_info *fils_override; struct ie_fils_ip_addr_response_info *fils_override;
@ -581,7 +581,7 @@ struct netconfig *netconfig_new(uint32_t ifindex)
netconfig = l_new(struct netconfig, 1); netconfig = l_new(struct netconfig, 1);
netconfig->nc = l_netconfig_new(ifindex); netconfig->nc = l_netconfig_new(ifindex);
netconfig->ifindex = ifindex; netconfig->netdev = netdev;
netconfig->resolve = resolve_new(ifindex); netconfig->resolve = resolve_new(ifindex);
debug_level = getenv("IWD_DHCP_DEBUG"); debug_level = getenv("IWD_DHCP_DEBUG");