[BusyBox-cvs] busybox/networking/udhcp clientpacket.c, 1.3, 1.4 files.c, 1.4, 1.5 options.c, 1.5, 1.6 options.h, 1.3, 1.4 script.c, 1.5, 1.6

Russ Dill russ at busybox.net
Mon Dec 15 22:09:39 UTC 2003


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

Modified Files:
	clientpacket.c files.c options.c options.h script.c 
Log Message:
options is a pretty common symbol, bad idea to use as a global in udhcp when compiling into busybox

Index: options.h
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/options.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- options.h	11 Dec 2002 21:12:45 -0000	1.3
+++ options.h	15 Dec 2003 22:09:36 -0000	1.4
@@ -27,7 +27,7 @@
 	unsigned char code;
 };
 
-extern struct dhcp_option options[];
+extern struct dhcp_option dhcp_options[];
 extern int option_lengths[];
 
 unsigned char *get_option(struct dhcpMessage *packet, int code);

Index: options.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/options.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- options.c	10 Jun 2003 17:22:49 -0000	1.5
+++ options.c	15 Dec 2003 22:09:36 -0000	1.6
@@ -13,7 +13,7 @@
 
 
 /* supported options are easily added here */
-struct dhcp_option options[] = {
+struct dhcp_option dhcp_options[] = {
 	/* name[10]	flags					code */
 	{"subnet",	OPTION_IP | OPTION_REQ,			0x01},
 	{"timezone",	OPTION_S32,				0x02},
@@ -158,9 +158,9 @@
 	u16 = (u_int16_t *) &aligned;
 	u32 = &aligned;
 
-	for (i = 0; options[i].code; i++)
-		if (options[i].code == code) {
-			length = option_lengths[options[i].flags & TYPE_MASK];
+	for (i = 0; dhcp_options[i].code; i++)
+		if (dhcp_options[i].code == code) {
+			length = option_lengths[dhcp_options[i].flags & TYPE_MASK];
 		}
 		
 	if (!length) {

Index: script.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/script.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- script.c	10 Jun 2003 17:22:49 -0000	1.5
+++ script.c	15 Dec 2003 22:09:36 -0000	1.6
@@ -160,8 +160,8 @@
 	if (packet == NULL)
 		num_options = 0;
 	else {
-		for (i = 0; options[i].code; i++)
-			if (get_option(packet, options[i].code))
+		for (i = 0; dhcp_options[i].code; i++)
+			if (get_option(packet, dhcp_options[i].code))
 				num_options++;
 		if (packet->siaddr) num_options++;
 		if ((temp = get_option(packet, DHCP_OPTION_OVER)))
@@ -184,14 +184,15 @@
 	asprintip(&envp[j++], "ip=", (unsigned char *) &packet->yiaddr);
 
 
-	for (i = 0; options[i].code; i++) {
-		if (!(temp = get_option(packet, options[i].code)))
+	for (i = 0; dhcp_options[i].code; i++) {
+		if (!(temp = get_option(packet, dhcp_options[i].code)))
 			continue;
-		envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2], options[i].flags & TYPE_MASK) + strlen(options[i].name) + 2);
-		fill_options(envp[j++], temp, &options[i]);
+		envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2],
+			dhcp_options[i].flags & TYPE_MASK) + strlen(dhcp_options[i].name) + 2);
+		fill_options(envp[j++], temp, &dhcp_options[i]);
 
 		/* Fill in a subnet bits option for things like /24 */
-		if (options[i].code == DHCP_SUBNET) {
+		if (dhcp_options[i].code == DHCP_SUBNET) {
 			memcpy(&subnet, temp, 4);
 			asprintf(&envp[j++], "mask=%d", mton(&subnet));
 		}

Index: clientpacket.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/clientpacket.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- clientpacket.c	10 Jun 2003 17:22:49 -0000	1.3
+++ clientpacket.c	15 Dec 2003 22:09:36 -0000	1.4
@@ -90,9 +90,9 @@
 	int i, len = 0;
 
 	packet->options[end + OPT_CODE] = DHCP_PARAM_REQ;
-	for (i = 0; options[i].code; i++)
-		if (options[i].flags & OPTION_REQ)
-			packet->options[end + OPT_DATA + len++] = options[i].code;
+	for (i = 0; dhcp_options[i].code; i++)
+		if (dhcp_options[i].flags & OPTION_REQ)
+			packet->options[end + OPT_DATA + len++] = dhcp_options[i].code;
 	packet->options[end + OPT_LEN] = len;
 	packet->options[end + OPT_DATA + len] = DHCP_END;
 

Index: files.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/files.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- files.c	10 Jun 2003 17:22:49 -0000	1.4
+++ files.c	15 Dec 2003 22:09:36 -0000	1.5
@@ -82,7 +82,7 @@
 	
     if ((opt = strtok(strcpy(line, const_line), " \t="))) {
 		
-	for (option = options; option->code; option++)
+	for (option = dhcp_options; option->code; option++)
 		if (!strcasecmp(option->name, opt))
 			break;
 	




More information about the busybox-cvs mailing list