Date: Thu, 16 Oct 2003 14:14:39 -0700 (PDT) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 39807 for review Message-ID: <200310162114.h9GLEdlh026157@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=39807 Change 39807 by sam@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310162114.h9GLEdlh026157>