diff options
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r-- | src/net/netdevice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c index 889b00c..7c40a2a 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -676,11 +676,11 @@ int register_netdev ( struct net_device *netdev ) { } /* Record device index and create device name */ - netdev->index = netdev_index++; if ( netdev->name[0] == '\0' ) { snprintf ( netdev->name, sizeof ( netdev->name ), "net%d", - netdev->index ); + netdev_index ); } + netdev->index = ++netdev_index; /* Use least significant bits of the link-layer address to * improve the randomness of the (non-cryptographic) random |