diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-10-25 11:24:39 +0300 |
---|---|---|
committer | Chengyi Zhao <chengyi1.zhao@archermind.com> | 2013-11-01 09:23:32 +0800 |
commit | 2caafa5dee4a668953f04b6b939d05b70d0b9abe (patch) | |
tree | 2db5b17d7c6298812e6f6b3bf1b74268126405d2 | |
parent | 9b0177687eaa09a07b48b9ef7aaedb0a8ea4a5e4 (diff) | |
download | connman-2caafa5dee4a668953f04b6b939d05b70d0b9abe.tar.gz connman-2caafa5dee4a668953f04b6b939d05b70d0b9abe.tar.bz2 connman-2caafa5dee4a668953f04b6b939d05b70d0b9abe.zip |
Upstream/technology: Do not use interface name when removing interface
Use always the interface index and only when interface name
is needed, then fetch the name. This minimizes races when
interface name changes because of udev rules.
Upstream commit Id: 168b6d8db09d348e82399a68ec4a94b62fd2f54f
Change-Id: Ia5059189372260196751f879156175db9f28c4c7
Signed-off-by: Chengyi Zhao <chengyi1.zhao@archermind.com>
-rw-r--r-- | src/connman.h | 2 | ||||
-rw-r--r-- | src/rtnl.c | 2 | ||||
-rw-r--r-- | src/technology.c | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/connman.h b/src/connman.h index c61a872f..495eef4e 100644 --- a/src/connman.h +++ b/src/connman.h @@ -473,7 +473,7 @@ void __connman_technology_scan_stopped(struct connman_device *device); void __connman_technology_add_interface(enum connman_service_type type, int index, const char *name, const char *ident); void __connman_technology_remove_interface(enum connman_service_type type, - int index, const char *name, const char *ident); + int index, const char *ident); void __connman_technology_notify_regdom_by_device(struct connman_device *device, int result, const char *alpha2); @@ -78,7 +78,7 @@ static void free_interface(gpointer data) struct interface_data *interface = data; __connman_technology_remove_interface(interface->service_type, - interface->index, interface->name, interface->ident); + interface->index, interface->ident); g_free(interface->ident); g_free(interface->name); diff --git a/src/technology.c b/src/technology.c index 8bbd3276..6dfdb6a5 100644 --- a/src/technology.c +++ b/src/technology.c @@ -1297,11 +1297,12 @@ void __connman_technology_add_interface(enum connman_service_type type, } void __connman_technology_remove_interface(enum connman_service_type type, - int index, const char *name, const char *ident) + int index, const char *ident) { struct connman_technology *technology; GSList *tech_drivers; struct connman_technology_driver *driver; + char *name; switch (type) { case CONNMAN_SERVICE_TYPE_UNKNOWN: @@ -1317,8 +1318,10 @@ void __connman_technology_remove_interface(enum connman_service_type type, break; } + name = connman_inet_ifname(index); connman_info("Remove interface %s [ %s ]", name, __connman_service_type2string(type)); + g_free(name); technology = technology_find(type); |