+If we're on a different subnet from the one we get DHCP for, don't
+use our current address in messages. Thanks to Wilson Callan.
Skip over bogus EINTR error on select when arp checking for a
different address from what we already have. This should not
happen, so a better fix is probably needed.
/* Just incase we haven't actually configured the address yet */
if (type == DHCP_INFORM && iface->previous_address.s_addr == 0)
message.ciaddr = dhcp->address.s_addr;
+
+ /* Zero the address if we're currently on a different subnet */
+ if (type == DHCP_REQUEST &&
+ iface->previous_netmask.s_addr != dhcp->netmask.s_addr)
+ message->ciaddr = from.s_addr = 0;
}
message.op = DHCP_BOOTREQUEST;