Commit 6a07ba5c authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Correction - failed to interpret 136.170.32/21 correctly.

parent 37a26229
......@@ -22,7 +22,7 @@ RM= remove
WFLAGS= fr~c~v
WIPE= -wipe
CFLAGS= -W -I$(INCLUDES) -c ${THROWBACK} -depend !Depend
CFLAGS= -pcc -I$(INCLUDES) -c ${THROWBACK} -depend !Depend
OBJS= o.${TARGET}
......
......@@ -784,12 +784,13 @@ newroute(argc, argv)
}
void
inet_makenetandmask(net, sin)
u_long net;
inet_makenetandmask(net, sin, bits)
u_long net, bits;
register struct sockaddr_in *sin;
{
u_long addr, mask = 0;
register char *cp;
printf("inet_makenetandmask(0x%lx, %p, %lu)\n", net, sin, bits);
rtm_addrs |= RTA_NETMASK;
if (net == 0)
......@@ -814,6 +815,9 @@ inet_makenetandmask(net, sin)
else
mask = -1;
}
if (net != 0 && bits) {
mask = 0xffffffff << (32 - bits);
}
sin->sin_addr.s_addr = htonl(addr);
sin = &so_mask.sin;
sin->sin_addr.s_addr = htonl(mask);
......@@ -856,7 +860,7 @@ getaddr(which, s, hpp)
case RTA_GATEWAY:
su = &so_gate;
if (iflag) {
#define MAX_IFACES 400
# define MAX_IFACES 400
int sock;
struct ifreq iflist[MAX_IFACES];
struct ifconf ifconf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment