if ((rt = rt_new(ifp)) == NULL)
return -1;
- rt->rt_dflags |= RTDF_DHCP;
/* If we have ocets then we have a destination and netmask */
dest.s_addr = 0;
continue;
if ((rt = rt_new(ifp)) == NULL)
return -1;
- rt->rt_dflags |= RTDF_DHCP;
/* A host route is normally set by having the
* gateway match the destination or assigned address */
while (p < e) {
if ((rt = rt_new(ifp)) == NULL)
return -1;
- rt->rt_dflags |= RTDF_DHCP;
memcpy(&gateway.s_addr, p, sizeof(gateway.s_addr));
p += 4;
sa_in_init(&rt->rt_dest, &dest);
/* First, add a subnet route. */
if (!(ifp->flags & IFF_POINTOPOINT) &&
#ifndef BSD
- /* BSD adds a route in this instance */
+ /* BSD adds a route in this instance */
state->addr->mask.s_addr != INADDR_BROADCAST &&
#endif
state->addr->mask.s_addr != INADDR_ANY)
break;
if ((rt = rt_new(ifp)) == NULL)
return -1;
+ rt->rt_dflags = RTDF_STATIC;
memcpy(rt, r, sizeof(*rt));
TAILQ_INSERT_TAIL(&nroutes, rt, rt_next);
}
n = 0;
TAILQ_FOREACH(rt, &nroutes, rt_next) {
rt->rt_mtu = mtu;
+ if (!(rt->rt_dflags & RTDF_STATIC))
+ rt->rt_dflags |= RTDF_DHCP;
sa_in_init(&rt->rt_ifa, &state->addr->addr);
n++;
}
#define RTDF_FAKE 0x04 /* Maybe us on lease reboot */
#define RTDF_RA 0x08 /* Router Advertisement */
#define RTDF_DHCP 0x10 /* DHCP route */
+#define RTDF_STATIC 0x20 /* Configured in dhcpcd */
};
TAILQ_HEAD(rt_head, rt);