summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorMartin Xu <martin.xu@intel.com>2010-12-09 16:10:54 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-09 16:10:54 +0100
commit03d76c59d9a59d23515e9f5d5374591886563f5f (patch)
treec6a98eb74d98557dac7a6457e75d5bf34e1e3c98 /src/rtnl.c
parent4291c2095c6c6ee534dd6fbc0a66b1323fa5acc7 (diff)
downloadconnman-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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index 8fea0945..b10d8354 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -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;