From: Martin Xu <martin...@intel.com>

The device is created and attach technology at rtnl->newlink(), so
__connman_technology_add_interface() nees to be called after rtnl->newlink()
---
 src/rtnl.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/rtnl.c b/src/rtnl.c
index 1993493..ceb98fc 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -401,6 +401,7 @@ static void process_newlink(unsigned short type, int index, 
unsigned flags,
        struct ether_addr compare = {{ 0, 0, 0, 0, 0, 0 }};
        struct rtnl_link_stats stats;
        unsigned char operstate = 0xff;
+       struct interface_data *interface;
        const char *ifname = NULL;
        unsigned int mtu = 0;
        char ident[13], str[18];
@@ -446,7 +447,6 @@ static void process_newlink(unsigned short type, int index, 
unsigned flags,
 
        if (g_hash_table_lookup(interface_list,
                                        GINT_TO_POINTER(index)) == NULL) {
-               struct interface_data *interface;
 
                interface = g_new0(struct interface_data, 1);
                interface->index = index;
@@ -458,9 +458,6 @@ static void process_newlink(unsigned short type, int index, 
unsigned flags,
 
                if (type == ARPHRD_ETHER)
                        read_uevent(interface);
-
-               __connman_technology_add_interface(interface->service_type,
-                       interface->index, interface->name, interface->ident);
        }
 
        for (list = rtnl_list; list; list = list->next) {
@@ -470,6 +467,12 @@ static void process_newlink(unsigned short type, int 
index, unsigned flags,
                        rtnl->newlink(type, index, flags, change);
        }
 
+       interface = g_hash_table_lookup(interface_list,
+                                       GINT_TO_POINTER(index));
+       if (interface != NULL)
+               __connman_technology_add_interface(interface->service_type,
+                       interface->index, interface->name, interface->ident);
+
        for (list = watch_list; list; list = list->next) {
                struct watch_data *watch = list->data;
 
-- 
1.6.1.3

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to