summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-08 23:33:08 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-08-08 23:33:08 -0700
commit8848491dc945938e9b664eab3b560b9da39bc97e (patch)
treeea1ec47bfb0b2b2711614c41a7361c4037263c4b /src/rtnl.c
parent8b068ec0ab46809b4d7beafe3eaaa8eb1a74db75 (diff)
downloadconnman-8848491dc945938e9b664eab3b560b9da39bc97e.tar.gz
connman-8848491dc945938e9b664eab3b560b9da39bc97e.tar.bz2
connman-8848491dc945938e9b664eab3b560b9da39bc97e.zip
Add support for storing default gateway information
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index b0366201..b13061cb 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -139,7 +139,7 @@ void connman_rtnl_remove_watch(unsigned int id)
}
}
-static void trigger_newlink(gpointer key, gpointer value, gpointer user_data)
+static void trigger_rtnl(gpointer key, gpointer value, gpointer user_data)
{
struct connman_rtnl *rtnl = user_data;
struct connman_ipconfig *ipconfig = value;
@@ -154,6 +154,13 @@ static void trigger_newlink(gpointer key, gpointer value, gpointer user_data)
rtnl->newlink(type, index, flags, 0);
}
+
+ if (rtnl->newgateway) {
+ const char *gateway = __connman_ipconfig_get_gateway(ipconfig);
+
+ if (gateway != NULL)
+ rtnl->newgateway(index, gateway);
+ }
}
static GSList *rtnl_list = NULL;
@@ -181,7 +188,7 @@ int connman_rtnl_register(struct connman_rtnl *rtnl)
rtnl_list = g_slist_insert_sorted(rtnl_list, rtnl,
compare_priority);
- g_hash_table_foreach(ipconfig_hash, trigger_newlink, rtnl);
+ g_hash_table_foreach(ipconfig_hash, trigger_rtnl, rtnl);
return 0;
}
@@ -934,7 +941,7 @@ static int send_getaddr(void)
return queue_request(req);
}
-int connman_rtnl_send_getroute(void)
+static int send_getroute(void)
{
struct rtnl_request *req;
@@ -992,7 +999,7 @@ void __connman_rtnl_start(void)
send_getlink();
send_getaddr();
- connman_rtnl_send_getroute();
+ send_getroute();
}
void __connman_rtnl_cleanup(void)