summaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-06-24 03:45:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-06-24 03:45:44 +0000
commit2c595ddcac63062c46e367dc576614a1dce32706 (patch)
tree5061ed8985caf642f2a63c160e34d1451664e950 /sbin/route
parentbe3de05a7c78f939275f24624ac6d6895cdf2b63 (diff)
Make mask and subnetshift in_addr_t and bring back a cast of
mask to make it signed for the shift.
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index d9ec3f159f8..4110eada270 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.20 1997/06/24 03:15:23 millert Exp $ */
+/* $OpenBSD: route.c,v 1.21 1997/06/24 03:45:43 millert Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: route.c,v 1.20 1997/06/24 03:15:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: route.c,v 1.21 1997/06/24 03:45:43 millert Exp $";
#endif
#endif /* not lint */
@@ -414,8 +414,7 @@ netname(sa)
char *cp = NULL;
static char line[MAXHOSTNAMELEN];
struct netent *np = 0;
- in_addr_t net;
- int mask, subnetshift;
+ in_addr_t net, mask, subnetshift;
char *ns_print();
char *ipx_print();
@@ -446,7 +445,7 @@ netname(sa)
* width subnet fields.
*/
while (in.s_addr &~ mask)
- mask = mask >> subnetshift;
+ mask = (int)mask >> subnetshift;
net = in.s_addr & mask;
while ((mask & 1) == 0)
mask >>= 1, net >>= 1;