diff options
author | Martin Xu <martin.xu@intel.com> | 2010-12-09 16:10:54 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-09 16:10:54 +0100 |
commit | 03d76c59d9a59d23515e9f5d5374591886563f5f (patch) | |
tree | c6a98eb74d98557dac7a6457e75d5bf34e1e3c98 /src/rtnl.c | |
parent | 4291c2095c6c6ee534dd6fbc0a66b1323fa5acc7 (diff) | |
download | connman-03d76c59d9a59d23515e9f5d5374591886563f5f.tar.gz connman-03d76c59d9a59d23515e9f5d5374591886563f5f.tar.bz2 connman-03d76c59d9a59d23515e9f5d5374591886563f5f.zip |
rtnl: Call __connman_technology_add_interface() after rtnl->newlink()
The device is created and the underlying technology attached from
the rtnl newlink hook, so __connman_technology_add_interface() needs
to be called after it.
Diffstat (limited to 'src/rtnl.c')
-rw-r--r-- | src/rtnl.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -406,6 +406,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]; @@ -449,10 +450,8 @@ static void process_newlink(unsigned short type, int index, unsigned flags, ifname, index, operstate, operstate2str(operstate)); - if (g_hash_table_lookup(interface_list, - GINT_TO_POINTER(index)) == NULL) { - struct interface_data *interface; - + interface = g_hash_table_lookup(interface_list, GINT_TO_POINTER(index)); + if (interface == NULL) { interface = g_new0(struct interface_data, 1); interface->index = index; interface->name = g_strdup(ifname); @@ -463,9 +462,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) { @@ -475,6 +471,9 @@ static void process_newlink(unsigned short type, int index, unsigned flags, rtnl->newlink(type, index, flags, change); } + __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; |