PERFORCE change 39807 for review
Sam Leffler
sam at FreeBSD.org
Thu Oct 16 14:14:40 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=39807
Change 39807 by sam at sam_ebb on 2003/10/16 14:14:03
handle module unload cleanup when loading+unloading w/o
starting a routing process
Affected files ...
.. //depot/projects/netperf/sys/netinet/ip_mroute.c#14 edit
Differences ...
==== //depot/projects/netperf/sys/netinet/ip_mroute.c#14 (text+ko) ====
@@ -3370,15 +3370,21 @@
legal_vif_num = X_legal_vif_num;
mrt_ioctl = X_mrt_ioctl;
rsvp_input_p = X_rsvp_input;
- splx(s);
break;
case MOD_UNLOAD:
- /* XXX shutdown on module unload? */
+ /*
+ * Typically module unload happens after the user-level
+ * process has shutdown the kernel services (the check
+ * below insures someone can't just yank the module out
+ * from under a running process). But if the module is
+ * just loaded and then unloaded w/o starting up a user
+ * process we still need to cleanup.
+ */
if (ip_mrouter)
return EINVAL;
- s = splnet();
+ X_ip_mrouter_done();
ip_mcast_src = NULL;
ip_mforward = NULL;
ip_mrouter_done = NULL;
@@ -3389,7 +3395,6 @@
legal_vif_num = NULL;
mrt_ioctl = NULL;
rsvp_input_p = NULL;
- splx(s);
break;
}
return 0;
More information about the p4-projects
mailing list