[BusyBox-cvs] busybox/networking/udhcp script.c,1.10,1.11

Russ Dill russ at busybox.net
Wed Dec 24 19:57:00 UTC 2003


Update of /var/cvs/busybox/networking/udhcp
In directory nail:/tmp/cvs-serv17294

Modified Files:
	script.c 
Log Message:
fix a long standing underallocation bug

Index: script.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/script.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- script.c	24 Dec 2003 19:30:27 -0000	1.10
+++ script.c	24 Dec 2003 19:56:58 -0000	1.11
@@ -146,8 +146,11 @@
 		num_options = 0;
 	else {
 		for (i = 0; dhcp_options[i].code; i++)
-			if (get_option(packet, dhcp_options[i].code))
+			if (get_option(packet, dhcp_options[i].code)) {
 				num_options++;
+				if (dhcp_options[i].code == DHCP_SUBNET)
+					num_options++; /* for mton */
+			}
 		if (packet->siaddr) num_options++;
 		if ((temp = get_option(packet, DHCP_OPTION_OVER)))
 			over = *temp;
@@ -194,7 +197,7 @@
 		/* watch out for invalid packets */
 		packet->sname[sizeof(packet->sname) - 1] = '\0';
 		asprintf(&envp[j++], "sname=%s", packet->sname);
-	}	
+	}
 	return envp;
 }
 




More information about the busybox-cvs mailing list