diff options
| author | Roy Marples <roy@marples.name> | 2012-03-20 14:11:41 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2012-03-20 14:11:41 +0000 |
| commit | c1412cc52a26fc893752c73b3ca27351bab49a63 (patch) | |
| tree | 6caccad5a9e3aafba72fcb938039deda935fce97 | |
| parent | cbcc6643e118ec51abf869852ecd0393e72ba4bc (diff) | |
| download | dhcpcd-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.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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. */ |
