]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If the CSR decode fails to return any routes, then use the older DHCP
authorRoy Marples <roy@marples.name>
Tue, 20 Mar 2012 14:11:41 +0000 (14:11 +0000)
committerRoy Marples <roy@marples.name>
Tue, 20 Mar 2012 14:11:41 +0000 (14:11 +0000)
routing options if available.

dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 91a60092bc5d8b15881fcb9dfbea49371c4da5fb..6745180abc808d4ed11f67d4d45f671c89916bc0 100644 (file)
--- 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. */