|
@@ -675,6 +675,14 @@ int register_netdev ( struct net_device *netdev ) {
|
675
|
675
|
goto err_duplicate;
|
676
|
676
|
}
|
677
|
677
|
|
|
678
|
+ /* Reject named network devices that already exist */
|
|
679
|
+ if ( netdev->name[0] && ( duplicate = find_netdev ( netdev->name ) ) ) {
|
|
680
|
+ DBGC ( netdev, "NETDEV rejecting duplicate name %s\n",
|
|
681
|
+ duplicate->name );
|
|
682
|
+ rc = -EEXIST;
|
|
683
|
+ goto err_duplicate;
|
|
684
|
+ }
|
|
685
|
+
|
678
|
686
|
/* Record device index and create device name */
|
679
|
687
|
if ( netdev->name[0] == '\0' ) {
|
680
|
688
|
snprintf ( netdev->name, sizeof ( netdev->name ), "net%d",
|