eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit e3921193f93cb26d2f7eed5749c1d55f8adbd1d3
parent c4771c4c5dbbe9db5941d7885c7864a4bafb4567
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date:   Fri, 16 Aug 2019 11:25:36 -0700

netconfig: Move removal of DNSs out of IPv4 specific logic

This way resolve_remove can be called once per interface and
remove IPv4 and IPv6 addresses at once.

In addition, this allows to remove the IP addresses and DNS
servers within the same main loop cycle. This will allow iwd
to make an attempt to remove the DNS servers on shutdown of iwd.

Diffstat:
Msrc/netconfig.c | 24++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/netconfig.c b/src/netconfig.c @@ -504,26 +504,20 @@ static void netconfig_ifaddr_del_cmd_cb(int error, uint16_t type, const void *data, uint32_t len, void *user_data) { - struct netconfig *netconfig; - if (error == -ENODEV) /* The device is unplugged, we are done. */ return; - if (error) { - l_error("netconfig: Failed to delete IP address. " - "Error %d: %s", error, strerror(-error)); + if (!error) + /* + * The kernel removes all of the routes associated with the + * deleted IP on its own. There is no need to explicitly remove + * them. + */ return; - } - - netconfig = user_data; - /* - * The kernel removes all of the routes associated with the deleted - * IP on its own. There is no need to explicitly remove them. - */ - - resolve_remove(netconfig->ifindex); + l_error("netconfig: Failed to delete IP address. " + "Error %d: %s", error, strerror(-error)); } static void netconfig_uninstall_address(struct netconfig *netconfig, @@ -690,6 +684,8 @@ static void netconfig_station_state_changed(enum station_state state, /* TODO: IPv6 addressing */ + resolve_remove(netconfig->ifindex); + break; case STATION_STATE_ROAMING: break;