summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-03-20 14:11:41 +0000
committerRoy Marples <roy@marples.name>2012-03-20 14:11:41 +0000
commitc1412cc52a26fc893752c73b3ca27351bab49a63 (patch)
tree6caccad5a9e3aafba72fcb938039deda935fce97
parentcbcc6643e118ec51abf869852ecd0393e72ba4bc (diff)
downloaddhcpcd-c1412cc52a26fc893752c73b3ca27351bab49a63.tar.xz
If the CSR decode fails to return any routes, then use the older DHCP
routing options if available.
-rw-r--r--dhcp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/dhcp.c b/dhcp.c
index 91a60092..6745180a 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -787,13 +787,15 @@ get_option_routes(const struct dhcp_message *dhcp,
p = get_option(dhcp, DHO_MSCSR, &len, NULL);
if (p) {
routes = decode_rfc3442_rt(len, p);
- if (routes && !(*opts & DHCPCD_CSR_WARNED)) {
- syslog(LOG_DEBUG,
- "%s: using Classless Static Routes (RFC3442)",
- ifname);
- *opts |= DHCPCD_CSR_WARNED;
+ if (routes) {
+ if (!(*opts & DHCPCD_CSR_WARNED)) {
+ syslog(LOG_DEBUG,
+ "%s: using Classless Static Routes",
+ ifname);
+ *opts |= DHCPCD_CSR_WARNED;
+ }
+ return routes;
}
- return routes;
}
/* OK, get our static routes first. */