From ee2d30984f50e123d5eda882890c357543a297ca Mon Sep 17 00:00:00 2001 From: mischief Date: Mon, 8 Dec 2014 17:27:40 -0800 Subject: [PATCH] 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. --- sys/src/cmd/ip/ipconfig/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/src/cmd/ip/ipconfig/main.c b/sys/src/cmd/ip/ipconfig/main.c index 6d61db431..bbd718ca4 100644 --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -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);