From: Roy Marples Date: Tue, 20 Mar 2012 14:11:41 +0000 (+0000) Subject: If the CSR decode fails to return any routes, then use the older DHCP X-Git-Tag: v5.5.5~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1412cc52a26fc893752c73b3ca27351bab49a63;p=thirdparty%2Fdhcpcd.git If the CSR decode fails to return any routes, then use the older DHCP routing options if available. --- 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. */