summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorVAUTRIN Emmanuel (Canal Plus Prestataire) <Emmanuel.VAUTRIN@cpexterne.org>2021-10-01 12:13:49 +0000
committerDaniel Wagner <wagi@monom.org>2021-10-04 08:03:46 +0200
commitdd7d4be53b9a6ca58cf8880d605fb5711ba5325b (patch)
tree8e32d9ec36d7f3ee94d3dedaa4cbcf832ee436ff /plugins
parent0faafb007b0c061f7e4d35f8356416966caad99e (diff)
downloadconnman-dd7d4be53b9a6ca58cf8880d605fb5711ba5325b.tar.gz
iwd: Fix missing Ethernet attributes
The Interface, Address and MTU attributes of Ethernet Service property were not retrieved because the interface index was specified to late (at network connection instead of creation), preventing the access to the corresponding ipconfig.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/iwd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/iwd.c b/plugins/iwd.c
index 14a442a7..9f2114f4 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -209,18 +209,13 @@ static int cm_network_probe(struct connman_network *network)
static void update_network_connected(struct iwd_network *iwdn)
{
struct iwd_device *iwdd;
- int index;
iwdd = g_hash_table_lookup(devices, iwdn->device);
if (!iwdd)
return;
- index = connman_inet_ifindex(iwdd->name);
- if (index < 0)
- return;
-
- DBG("interface name %s index %d", iwdd->name, index);
- connman_network_set_index(iwdn->network, index);
+ DBG("interface name %s index %d", iwdd->name,
+ connman_network_get_index(iwdn->network));
connman_network_set_connected(iwdn->network, true);
}
@@ -912,6 +907,7 @@ static void add_network(const char *path, struct iwd_network *iwdn)
{
struct iwd_device *iwdd;
char *identifier;
+ int index;
iwdd = g_hash_table_lookup(devices, iwdn->device);
if (!iwdd)
@@ -920,6 +916,11 @@ static void add_network(const char *path, struct iwd_network *iwdn)
identifier = create_identifier(path, iwdn->type);
iwdn->network = connman_network_create(identifier,
CONNMAN_NETWORK_TYPE_WIFI);
+
+ index = connman_inet_ifindex(iwdd->name);
+ if (index >= 0)
+ connman_network_set_index(iwdn->network, index);
+
connman_network_set_data(iwdn->network, iwdn);
connman_network_set_name(iwdn->network, iwdn->name);