diff --git a/src/libs/compat/freebsd11_network/if.c b/src/libs/compat/freebsd11_network/if.c index 3a23dbcf53..1f0e38c3da 100644 --- a/src/libs/compat/freebsd11_network/if.c +++ b/src/libs/compat/freebsd11_network/if.c @@ -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; }