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,11 +200,6 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r
200 200
 	netdev->dev = &device->dev;
201 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 203
 	/* Look for the mandatory if setting */
209 204
 	if_setting = linux_find_setting("if", &request->settings);
210 205
 
@@ -224,6 +219,12 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r
224 219
 	/* Apply rest of the settings */
225 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 228
 	return 0;
228 229
 
229 230
 err_settings:

Loading…
Cancel
Save