Browse Source

Apply global DHCP options when register_dhcp_options() is called. Do

not apply DHCP options in dhcp_configure_netdev().
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
934b70d62c
3 changed files with 13 additions and 7 deletions
  1. 1
    0
      src/include/gpxe/dhcp.h
  2. 12
    0
      src/net/dhcpopts.c
  3. 0
    7
      src/net/udp/dhcp.c

+ 1
- 0
src/include/gpxe/dhcp.h View File

504
 extern void delete_dhcp_option ( struct dhcp_option_block *options,
504
 extern void delete_dhcp_option ( struct dhcp_option_block *options,
505
 				 unsigned int tag );
505
 				 unsigned int tag );
506
 extern int apply_dhcp_options ( struct dhcp_option_block *options );
506
 extern int apply_dhcp_options ( struct dhcp_option_block *options );
507
+extern int apply_global_dhcp_options ( void );
507
 
508
 
508
 extern struct dhcp_option_block dhcp_request_options;
509
 extern struct dhcp_option_block dhcp_request_options;
509
 extern int create_dhcp_packet ( struct net_device *netdev, uint8_t msgtype,
510
 extern int create_dhcp_packet ( struct net_device *netdev, uint8_t msgtype,

+ 12
- 0
src/net/dhcpopts.c View File

289
 	}
289
 	}
290
 	dhcpopt_get ( options );
290
 	dhcpopt_get ( options );
291
 	list_add_tail ( &options->list, &existing->list );
291
 	list_add_tail ( &options->list, &existing->list );
292
+
293
+	/* Apply all registered DHCP options */
294
+	apply_global_dhcp_options();
292
 }
295
 }
293
 
296
 
294
 /**
297
 /**
609
 
612
 
610
 	return 0;
613
 	return 0;
611
 }
614
 }
615
+
616
+/**
617
+ * Apply global DHCP options
618
+ *
619
+ * @ret rc		Return status code
620
+ */
621
+int apply_global_dhcp_options ( void ) {
622
+	return apply_dhcp_options ( NULL );
623
+}

+ 0
- 7
src/net/udp/dhcp.c View File

855
 		return rc;
855
 		return rc;
856
 	}
856
 	}
857
 
857
 
858
-	/* Apply other DHCP options */
859
-	if ( ( rc = apply_dhcp_options ( options ) ) != 0 ) {
860
-		DBG ( "Could not apply %s DHCP result options: %s\n",
861
-		      netdev->name, strerror ( rc ) );
862
-		return rc;
863
-	}
864
-
865
 	return 0;
858
 	return 0;
866
 }
859
 }

Loading…
Cancel
Save