diff --git a/kernel/init.c b/kernel/init.c index b227e5cc..d5a7b07d 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -43,6 +43,7 @@ #include #endif #include +#include #include #include #ifdef CONFIG_ROCKCREEK @@ -161,10 +162,15 @@ static int init_netifs(void) netif_add(&default_netif, &ipaddr, &netmask, &gw, NULL, rtl8139if_init, ethernet_input); netif_set_default(&default_netif); #else - if ((err = netifapi_netif_add(&default_netif, &ipaddr, &netmask, &gw, NULL, rtl8139if_init, tcpip_input)) != ERR_OK) { - kprintf("Unable to add the network interface: err = %d\n", err); - return -ENODEV; - } + if ((err = netifapi_netif_add(&default_netif, &ipaddr, &netmask, &gw, NULL, rtl8139if_init, tcpip_input)) == ERR_OK) + goto success; + if ((err = netifapi_netif_add(&default_netif, &ipaddr, &netmask, &gw, NULL, e1000if_init, tcpip_input)) == ERR_OK) + goto success; + + kprintf("Unable to add the network interface: err = %d\n", err); + return -ENODEV; + +success: netifapi_netif_set_default(&default_netif); #endif