]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[linux] Apply MAC address prior to registering network device
authorMichael Brown <mcb30@ipxe.org>
Sun, 1 Sep 2013 16:38:40 +0000 (17:38 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 3 Sep 2013 01:02:58 +0000 (02:02 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/linux/tap.c

index 99937d74d0f06407d2a6d64ff8111359cebaf3c1..979436654cdfe3a1e8db5f960880ffb438629423 100644 (file)
@@ -200,11 +200,6 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r
        netdev->dev = &device->dev;
        memset(nic, 0, sizeof(*nic));
 
-       if ((rc = register_netdev(netdev)) != 0)
-               goto err_register;
-
-       netdev_link_up(netdev);
-
        /* Look for the mandatory if setting */
        if_setting = linux_find_setting("if", &request->settings);
 
@@ -224,6 +219,12 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r
        /* Apply rest of the settings */
        linux_apply_settings(&request->settings, &netdev->settings.settings);
 
+       /* Register network device */
+       if ((rc = register_netdev(netdev)) != 0)
+               goto err_register;
+
+       netdev_link_up(netdev);
+
        return 0;
 
 err_settings: