patch-2.1.127 linux/net/ipv4/ipconfig.c

Next file: linux/net/ipv4/proc.c
Previous file: linux/net/ipv4/ip_nat_dumb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/net/ipv4/ipconfig.c linux/net/ipv4/ipconfig.c
@@ -1,5 +1,5 @@
 /*
- *  $Id: ipconfig.c,v 1.15 1998/06/19 13:22:33 davem Exp $
+ *  $Id: ipconfig.c,v 1.16 1998/10/21 22:27:26 davem Exp $
  *
  *  Automatic Configuration of IP -- use BOOTP or RARP or user-supplied
  *  information to configure own IP address and routes.
@@ -260,12 +260,12 @@
 		root_server_addr = ic_servaddr;
 
 	if (ic_netmask == INADDR_NONE) {
-		if (IN_CLASSA(ic_myaddr))
-			ic_netmask = IN_CLASSA_NET;
-		else if (IN_CLASSB(ic_myaddr))
-			ic_netmask = IN_CLASSB_NET;
-		else if (IN_CLASSC(ic_myaddr))
-			ic_netmask = IN_CLASSC_NET;
+		if (IN_CLASSA(ntohl(ic_myaddr)))
+			ic_netmask = htonl(IN_CLASSA_NET);
+		else if (IN_CLASSB(ntohl(ic_myaddr)))
+			ic_netmask = htonl(IN_CLASSB_NET);
+		else if (IN_CLASSC(ntohl(ic_myaddr)))
+			ic_netmask = htonl(IN_CLASSC_NET);
 		else {
 			printk(KERN_ERR "IP-Config: Unable to guess netmask for address %08x\n", ic_myaddr);
 			return -1;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov