freebsd11_network: Add NULL check to if_getdrvflags.

This is the proper fix for #14182, as discussed on the mailing list.
This commit is contained in:
Augustin Cavalier 2018-08-20 21:06:24 -04:00
parent ac3431d6e1
commit 4c00d515f1

View File

@ -1052,6 +1052,8 @@ if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags)
int
if_getdrvflags(if_t ifp)
{
if ((struct ifnet *)ifp == NULL)
return 0;
return ((struct ifnet *)ifp)->if_drv_flags;
}