{ 1, IPV4 | REQUEST, "subnet_mask" },
/* RFC 3442 states that the CSR has to come before all other
* routes. For completeness, we also specify static routes,
- * then routers. */
+ * then routers. */
{ 121, RFC3442, "classless_static_routes" },
{ 249, RFC3442, "ms_classless_static_routes" },
{ 33, IPV4 | ARRAY | REQUEST, "static_routes" },
* If we have a CSR then we only use that.
* Otherwise we add static routes and then routers. */
struct rt *
-get_option_routes(const char *ifname, const struct dhcp_message *dhcp)
+get_option_routes(const struct dhcp_message *dhcp,
+ const char *ifname, int *opts)
{
const uint8_t *p;
const uint8_t *e;
p = get_option(dhcp, DHO_MSCSR, &len, NULL);
if (p) {
routes = decode_rfc3442_rt(len, p);
- if (routes) {
+ if (routes && !(*opts & DHCPCD_CSR_WARNED)) {
syslog(LOG_DEBUG,
"%s: using Classless Static Routes (RFC3442)",
ifname);
+ *opts |= DHCPCD_CSR_WARNED;
return routes;
}
}
return p - dst;
}
-#define PUTADDR(_type, _val) \
- { \
- *p++ = _type; \
- *p++ = 4; \
- memcpy(p, &_val.s_addr, 4); \
- p += 4; \
+#define PUTADDR(_type, _val) \
+ { \
+ *p++ = _type; \
+ *p++ = 4; \
+ memcpy(p, &_val.s_addr, 4); \
+ p += 4; \
}
int
case '\'': /* FALLTHROUGH */
case '$': /* FALLTHROUGH */
case '`': /* FALLTHROUGH */
- case '\\': /* FALLTHROUGH */
+ case '\\':
if (s) {
if (len < 3) {
errno = ENOBUFS;
#define is_bootp(m) (m && \
!IN_LINKLOCAL(htonl((m)->yiaddr)) && \
get_option_uint8(NULL, m, DHO_MESSAGETYPE) == -1)
-struct rt *get_option_routes(const char *, const struct dhcp_message *);
+struct rt *get_option_routes(const struct dhcp_message *, const char *, int *);
ssize_t configure_env(char **, const char *, const struct dhcp_message *,
const struct if_options *);