summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@canonical.com>2010-06-15 01:17:36 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-06-16 00:11:07 +0200
commit11281de04f7707ebcaf4050ae6ad5d48907b956a (patch)
treee51a31af617de0640059931c85b8602fd939811f /src/rtnl.c
parent460513c7edcbd14e830cb9f0dd9da3a7ee79f3db (diff)
downloadconnman-11281de04f7707ebcaf4050ae6ad5d48907b956a.tar.gz
connman-11281de04f7707ebcaf4050ae6ad5d48907b956a.tar.bz2
connman-11281de04f7707ebcaf4050ae6ad5d48907b956a.zip
Support for ppp default route setting
When gateway is NULL, we need to properly set our connection and element string to 0.0.0.0 so that the interface is the default route.
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index edeae4ca..9238dde0 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -485,7 +485,12 @@ static void process_newroute(unsigned char family, unsigned char scope,
__connman_ipconfig_newroute(index, scope, dststr, gatewaystr);
- if (scope != RT_SCOPE_UNIVERSE || dst.s_addr != INADDR_ANY)
+ /* skip host specific routes */
+ if (scope != RT_SCOPE_UNIVERSE &&
+ !(scope == RT_SCOPE_LINK && dst.s_addr == INADDR_ANY))
+ return;
+
+ if (dst.s_addr != INADDR_ANY)
return;
for (list = rtnl_list; list; list = list->next) {
@@ -514,7 +519,12 @@ static void process_delroute(unsigned char family, unsigned char scope,
__connman_ipconfig_delroute(index, scope, dststr, gatewaystr);
- if (scope != RT_SCOPE_UNIVERSE || dst.s_addr != INADDR_ANY)
+ /* skip host specific routes */
+ if (scope != RT_SCOPE_UNIVERSE &&
+ !(scope == RT_SCOPE_LINK && dst.s_addr == INADDR_ANY))
+ return;
+
+ if (dst.s_addr != INADDR_ANY)
return;
for (list = rtnl_list; list; list = list->next) {