diff options
author | Kalle Valo <kalle.valo@canonical.com> | 2010-06-15 01:17:36 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-06-16 00:11:07 +0200 |
commit | 11281de04f7707ebcaf4050ae6ad5d48907b956a (patch) | |
tree | e51a31af617de0640059931c85b8602fd939811f /src/rtnl.c | |
parent | 460513c7edcbd14e830cb9f0dd9da3a7ee79f3db (diff) | |
download | connman-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.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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) { |