Parcourir la source

[linux] Apply MAC address prior to registering network device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown il y a 10 ans
Parent
révision
8a2dc7a588
1 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 6
    5
      src/drivers/linux/tap.c

+ 6
- 5
src/drivers/linux/tap.c Voir le fichier

@@ -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:

Chargement…
Annuler
Enregistrer