From: Sepherosa Ziehau Date: Tue, 16 Sep 2008 11:48:01 +0000 (+0000) Subject: ip_dn_stop() and ip_dn_stop_dispatch() is used only if dummynet(4) is compiled X-Git-Url: https://gitweb.dragonflybsd.org/~lentferj/dragonfly.git/commitdiff_plain/7f798f0951f5faf80768a141b043feb5ea86eb4d ip_dn_stop() and ip_dn_stop_dispatch() is used only if dummynet(4) is compiled as module. --- diff --git a/sys/net/dummynet/ip_dummynet.c b/sys/net/dummynet/ip_dummynet.c index 244e4db666..35648b3cd5 100644 --- a/sys/net/dummynet/ip_dummynet.c +++ b/sys/net/dummynet/ip_dummynet.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_dummynet.c,v 1.24.2.22 2003/05/13 09:31:06 maxim Exp $ - * $DragonFly: src/sys/net/dummynet/ip_dummynet.c,v 1.53 2007/12/08 04:33:58 sephe Exp $ + * $DragonFly: src/sys/net/dummynet/ip_dummynet.c,v 1.54 2008/09/16 11:48:01 sephe Exp $ */ #ifdef DUMMYNET_DEBUG @@ -1945,6 +1945,24 @@ back: lwkt_replymsg(&msg->nm_lmsg, error); } +static int +ip_dn_init(void) +{ + struct netmsg smsg; + + if (ip_dn_cpu >= ncpus) { + kprintf("%s: CPU%d does not exist, switch to CPU0\n", + __func__, ip_dn_cpu); + ip_dn_cpu = 0; + } + + netmsg_init(&smsg, &curthread->td_msgport, 0, ip_dn_init_dispatch); + lwkt_domsg(cpu_portfn(ip_dn_cpu), &smsg.nm_lmsg, 0); + return smsg.nm_lmsg.ms_error; +} + +#ifdef KLD_MODULE + static void ip_dn_stop_dispatch(struct netmsg *msg) { @@ -1961,21 +1979,6 @@ ip_dn_stop_dispatch(struct netmsg *msg) lwkt_replymsg(&msg->nm_lmsg, 0); } -static int -ip_dn_init(void) -{ - struct netmsg smsg; - - if (ip_dn_cpu >= ncpus) { - kprintf("%s: CPU%d does not exist, switch to CPU0\n", - __func__, ip_dn_cpu); - ip_dn_cpu = 0; - } - - netmsg_init(&smsg, &curthread->td_msgport, 0, ip_dn_init_dispatch); - lwkt_domsg(cpu_portfn(ip_dn_cpu), &smsg.nm_lmsg, 0); - return smsg.nm_lmsg.ms_error; -} static void ip_dn_stop(void) @@ -1988,6 +1991,8 @@ ip_dn_stop(void) netmsg_service_sync(); } +#endif /* KLD_MODULE */ + static int dummynet_modevent(module_t mod, int type, void *data) {