From e6ed2afd1ea69f72438c7e2b44a63ebd4ea19f58 Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Thu, 1 Feb 1996 16:25:29 +0000 Subject: [PATCH] Make routed use real netmasks when installing routes; for unknown class B and C networks routed would use the network number as the netmask. This can cause some real interesting behaviour. --- usr.sbin/routed/inet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/routed/inet.c b/usr.sbin/routed/inet.c index 925472c287b4..9b1c9fdda680 100644 --- a/usr.sbin/routed/inet.c +++ b/usr.sbin/routed/inet.c @@ -143,13 +143,13 @@ inet_maskof(inaddr) } else if (IN_CLASSA(i)) { mask = IN_CLASSA_NET; } else if (IN_CLASSB(i)) { - mask = i & IN_CLASSB_NET; + mask = IN_CLASSB_NET; } else - mask = i & IN_CLASSC_NET; + mask = IN_CLASSC_NET; /* - * Check whether network is a subnet; - * if so, use the modified interpretation of `host'. + * Check whether network is subnetted; + * if so, use the subnet's netmask. */ for (ifp = ifnet; ifp; ifp = ifp->int_next) if ((ifp->int_netmask & i) == ifp->int_net)