ip/ipconfig: treat /32 mask as /0

some dhcp servers send a mask of 255.255.255.255 to indicate the gateway is directly routeable.

thanks to david du colombier for this patch.
This commit is contained in:
mischief 2014-12-08 17:27:40 -08:00
parent 469a10f1d9
commit ee2d30984f

View file

@ -1233,6 +1233,8 @@ dhcprecv(void)
if(!validip(conf.mask) || !Oflag){
if(!optgetaddr(bp->optdata, OBmask, conf.mask))
ipmove(conf.mask, IPnoaddr);
if(ipcmp(conf.mask, IPv4bcast) == 0)
ipmove(conf.mask, IPnoaddr);
}
DEBUG("ipaddr=%I ipmask=%M ", conf.laddr, conf.mask);