From c1412cc52a26fc893752c73b3ca27351bab49a63 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 20 Mar 2012 14:11:41 +0000 Subject: [PATCH] If the CSR decode fails to return any routes, then use the older DHCP routing options if available. --- dhcp.c | 14 ++++++++------ 1 file 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. */ -- 2.47.2