Ticket #3124: patch.3.fbdscompat.diff

File patch.3.fbdscompat.diff, 682 bytes (added by Adek336, 11 years ago)
  • src/libs/compat/freebsd_network/if.c

     
    6767void
    6868if_free(struct ifnet *ifp)
    6969{
     70    // if_index may be uninitialized
     71    if (gDeviceNameList[ifp->if_index] == ifp->device_name) {
     72        if (ifp->if_index != gDeviceCount - 1)
     73            panic("if_free on interior entry \"%s\"", ifp->device_name);
     74
     75        gDeviceNameList[ifp->if_index] = NULL;
     76        gDevices[ifp->if_index] = NULL;
     77        gDeviceCount--;
     78    }
     79
    7080    IF_ADDR_LOCK_DESTROY(ifp);
    7181    if (ifp->if_type == IFT_ETHER)
    7282        _kernel_free(ifp->if_l2com);