Remove useless ifdef KLD_MODULE from dummynet module unload path. This
fixes panic on unload. Reported by: pho
This commit is contained in:
parent
2da1028f21
commit
ccddbf9365
@ -2170,7 +2170,6 @@ ip_dn_init(void)
|
|||||||
getmicrouptime(&dn_cfg.prev_t);
|
getmicrouptime(&dn_cfg.prev_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KLD_MODULE
|
|
||||||
static void
|
static void
|
||||||
ip_dn_destroy(int last)
|
ip_dn_destroy(int last)
|
||||||
{
|
{
|
||||||
@ -2194,7 +2193,6 @@ ip_dn_destroy(int last)
|
|||||||
|
|
||||||
DN_LOCK_DESTROY();
|
DN_LOCK_DESTROY();
|
||||||
}
|
}
|
||||||
#endif /* KLD_MODULE */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dummynet_modevent(module_t mod, int type, void *data)
|
dummynet_modevent(module_t mod, int type, void *data)
|
||||||
@ -2210,13 +2208,8 @@ dummynet_modevent(module_t mod, int type, void *data)
|
|||||||
ip_dn_io_ptr = dummynet_io;
|
ip_dn_io_ptr = dummynet_io;
|
||||||
return 0;
|
return 0;
|
||||||
} else if (type == MOD_UNLOAD) {
|
} else if (type == MOD_UNLOAD) {
|
||||||
#if !defined(KLD_MODULE)
|
|
||||||
printf("dummynet statically compiled, cannot unload\n");
|
|
||||||
return EINVAL ;
|
|
||||||
#else
|
|
||||||
ip_dn_destroy(1 /* last */);
|
ip_dn_destroy(1 /* last */);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user