Subject: bin/6059: sysinst class C default netmask wrong
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bgrayson@ece.utexas.edu>
List: netbsd-bugs
Date: 08/27/1998 14:05:10
>Number:         6059
>Category:       bin
>Synopsis:       sysinst class C default netmask wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 27 12:20:00 1998
>Last-Modified:
>Originator:     Brian Grayson
>Organization:
	Parallel and Distributed Systems
	Electrical and Computer Engineering
	The University of Texas at Austin
>Release:        Aug 26, 1998
>Environment:
NetBSD marvin 1.3G NetBSD 1.3G (MARVIN) #44: Mon Aug 10 09:25:33 CDT 1998     bgrayson@marvin:/usr/src/sys/arch/i386/compile/MARVIN i386

>Description:
	The default netmask for class C networks should be
	0xffffff00, not 0xffff0000.  Also, the tests currently
	overlap, and 127.*.*.* is not a valid IP.  Should there
	be a final `else' to trap weird addresses, like 127.*
	or 224.* and above?
	
>How-To-Repeat:
	
>Fix:
--- net.c       Wed Aug  5 06:04:16 1998
+++ net.c.fixed Thu Aug 27 14:02:15 1998
@@ -182,12 +182,12 @@
                msg_prompt_add(MSG_net_ip, net_ip, net_ip, STRSIZE);
                octet0 = atoi(net_ip);
                if (!pass) {
-                       if (0 <= octet0 && octet0 <= 127)
+                       if (0 <= octet0 && octet0 <= 126)
                                strcpy(net_mask, "0xff000000");
-                       else if (127 <= octet0 && octet0 <= 191)
+                       else if (128 <= octet0 && octet0 <= 191)
                                strcpy(net_mask, "0xffff0000");
                        else if (192 <= octet0 && octet0 <= 223)
-                               strcpy(net_mask, "0xffff0000");
+                               strcpy(net_mask, "0xffffff00");
                }
                msg_prompt_add(MSG_net_mask, net_mask, net_mask, STRSIZE);
                msg_prompt_add(MSG_net_defroute, net_defroute, net_defroute,
	
>Audit-Trail:
>Unformatted: