Преглед изворни кода

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 година
родитељ
комит
934b70d62c
3 измењених фајлова са 13 додато и 7 уклоњено
  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 Прегледај датотеку

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

+ 12
- 0
src/net/dhcpopts.c Прегледај датотеку

@@ -289,6 +289,9 @@ void register_dhcp_options ( struct dhcp_option_block *options ) {
289 289
 	}
290 290
 	dhcpopt_get ( options );
291 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,3 +612,12 @@ int apply_dhcp_options ( struct dhcp_option_block *options ) {
609 612
 
610 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 Прегледај датотеку

@@ -855,12 +855,5 @@ int dhcp_configure_netdev ( struct net_device *netdev,
855 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 858
 	return 0;
866 859
 }

Loading…
Откажи
Сачувај