summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-25 14:47:50 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-26 12:31:45 +0300
commitd1ae988ca517c82a7345b8147b651866ca6df527 (patch)
treed11fee41e1c6ecc81e00262477da3354cfdc9db4 /src/rtnl.c
parent409f346fbf0cc54c04682fdb8982a76e1ce53b21 (diff)
downloadconnman-d1ae988ca517c82a7345b8147b651866ca6df527.tar.gz
connman-d1ae988ca517c82a7345b8147b651866ca6df527.tar.bz2
connman-d1ae988ca517c82a7345b8147b651866ca6df527.zip
rtnl: Interface was added to technology too early
The __connman_technology_add_interface() needs to be called after we have created the technology which is done by rtnl->newlink() callback. If this is done the old way, the ethernet devices will not get their interfaces set properly.
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index ef7f3433..af8ab707 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -460,10 +460,8 @@ 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);
- }
+ } else
+ interface = NULL;
for (list = rtnl_list; list; list = list->next) {
struct connman_rtnl *rtnl = list->data;
@@ -472,6 +470,16 @@ static void process_newlink(unsigned short type, int index, unsigned flags,
rtnl->newlink(type, index, flags, change);
}
+ /*
+ * The interface needs to be added after the newlink call.
+ * The newlink will create the technology when needed and
+ * __connman_technology_add_interface() expects the
+ * technology to be there already.
+ */
+ 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;