Browse Source

[linux] Apply MAC address prior to registering network device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
8a2dc7a588
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      src/drivers/linux/tap.c

+ 6
- 5
src/drivers/linux/tap.c View File

200
 	netdev->dev = &device->dev;
200
 	netdev->dev = &device->dev;
201
 	memset(nic, 0, sizeof(*nic));
201
 	memset(nic, 0, sizeof(*nic));
202
 
202
 
203
-	if ((rc = register_netdev(netdev)) != 0)
204
-		goto err_register;
205
-
206
-	netdev_link_up(netdev);
207
-
208
 	/* Look for the mandatory if setting */
203
 	/* Look for the mandatory if setting */
209
 	if_setting = linux_find_setting("if", &request->settings);
204
 	if_setting = linux_find_setting("if", &request->settings);
210
 
205
 
224
 	/* Apply rest of the settings */
219
 	/* Apply rest of the settings */
225
 	linux_apply_settings(&request->settings, &netdev->settings.settings);
220
 	linux_apply_settings(&request->settings, &netdev->settings.settings);
226
 
221
 
222
+	/* Register network device */
223
+	if ((rc = register_netdev(netdev)) != 0)
224
+		goto err_register;
225
+
226
+	netdev_link_up(netdev);
227
+
227
 	return 0;
228
 	return 0;
228
 
229
 
229
 err_settings:
230
 err_settings:

Loading…
Cancel
Save