Skip to content

Commit

Permalink
[linux] Apply MAC address prior to registering network device
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Sep 3, 2013
1 parent 0f787df commit 8a2dc7a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/drivers/linux/tap.c
Expand Up @@ -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);

Expand All @@ -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:
Expand Down

0 comments on commit 8a2dc7a

Please sign in to comment.