diff options
author | Thomas Markwalder <tmark@isc.org> | 2019-11-22 13:39:45 -0500 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2019-11-22 13:39:45 -0500 |
commit | 0cd94b5ef4a078097fc2bd1dc72f5e80c2cf1844 (patch) | |
tree | e4dfe9a92d676a49b18ab547d781fb3fb10c8e6a /omapip | |
parent | 97c155273c0df0c8518f226e2b5e338e3ad63e87 (diff) | |
download | isc-dhcp-0cd94b5ef4a078097fc2bd1dc72f5e80c2cf1844.tar.gz |
[#64,!35] Restored work
Restored cummulative work.
Diffstat (limited to 'omapip')
-rw-r--r-- | omapip/Makefile.in | 160 | ||||
-rw-r--r-- | omapip/isclib.c | 57 |
2 files changed, 159 insertions, 58 deletions
diff --git a/omapip/Makefile.in b/omapip/Makefile.in index 619434f5..79593536 100644 --- a/omapip/Makefile.in +++ b/omapip/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -100,6 +100,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/includes/config.h CONFIG_CLEAN_FILES = Makefile.am CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -145,7 +146,6 @@ am_libomapi_a_OBJECTS = protocol.$(OBJEXT) buffer.$(OBJEXT) \ trace.$(OBJEXT) toisc.$(OBJEXT) iscprint.$(OBJEXT) \ isclib.$(OBJEXT) libomapi_a_OBJECTS = $(am_libomapi_a_OBJECTS) -PROGRAMS = $(noinst_PROGRAMS) am_svtest_OBJECTS = test.$(OBJEXT) svtest_OBJECTS = $(am_svtest_OBJECTS) svtest_DEPENDENCIES = libomapi.a $(BINDLIBIRSDIR)/libirs.a \ @@ -165,7 +165,18 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/alloc.Po ./$(DEPDIR)/array.Po \ + ./$(DEPDIR)/auth.Po ./$(DEPDIR)/buffer.Po \ + ./$(DEPDIR)/connection.Po ./$(DEPDIR)/convert.Po \ + ./$(DEPDIR)/dispatch.Po ./$(DEPDIR)/errwarn.Po \ + ./$(DEPDIR)/generic.Po ./$(DEPDIR)/handle.Po \ + ./$(DEPDIR)/hash.Po ./$(DEPDIR)/inet_addr.Po \ + ./$(DEPDIR)/isclib.Po ./$(DEPDIR)/iscprint.Po \ + ./$(DEPDIR)/listener.Po ./$(DEPDIR)/message.Po \ + ./$(DEPDIR)/protocol.Po ./$(DEPDIR)/result.Po \ + ./$(DEPDIR)/support.Po ./$(DEPDIR)/test.Po \ + ./$(DEPDIR)/toisc.Po ./$(DEPDIR)/trace.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -370,8 +381,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -384,6 +395,9 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): Makefile.am: $(top_builddir)/config.status $(srcdir)/Makefile.am.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ @@ -421,9 +435,6 @@ libomapi.a: $(libomapi_a_OBJECTS) $(libomapi_a_DEPENDENCIES) $(EXTRA_libomapi_a_ $(AM_V_AR)$(libomapi_a_AR) libomapi.a $(libomapi_a_OBJECTS) $(libomapi_a_LIBADD) $(AM_V_at)$(RANLIB) libomapi.a -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - svtest$(EXEEXT): $(svtest_OBJECTS) $(svtest_DEPENDENCIES) $(EXTRA_svtest_DEPENDENCIES) @rm -f svtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svtest_OBJECTS) $(svtest_LDADD) $(LIBS) @@ -434,28 +445,34 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errwarn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_addr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isclib.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscprint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toisc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errwarn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_addr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isclib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscprint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toisc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trace.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -566,7 +583,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -598,7 +618,7 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(MANS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -639,7 +659,28 @@ clean-am: clean-generic clean-libLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/alloc.Po + -rm -f ./$(DEPDIR)/array.Po + -rm -f ./$(DEPDIR)/auth.Po + -rm -f ./$(DEPDIR)/buffer.Po + -rm -f ./$(DEPDIR)/connection.Po + -rm -f ./$(DEPDIR)/convert.Po + -rm -f ./$(DEPDIR)/dispatch.Po + -rm -f ./$(DEPDIR)/errwarn.Po + -rm -f ./$(DEPDIR)/generic.Po + -rm -f ./$(DEPDIR)/handle.Po + -rm -f ./$(DEPDIR)/hash.Po + -rm -f ./$(DEPDIR)/inet_addr.Po + -rm -f ./$(DEPDIR)/isclib.Po + -rm -f ./$(DEPDIR)/iscprint.Po + -rm -f ./$(DEPDIR)/listener.Po + -rm -f ./$(DEPDIR)/message.Po + -rm -f ./$(DEPDIR)/protocol.Po + -rm -f ./$(DEPDIR)/result.Po + -rm -f ./$(DEPDIR)/support.Po + -rm -f ./$(DEPDIR)/test.Po + -rm -f ./$(DEPDIR)/toisc.Po + -rm -f ./$(DEPDIR)/trace.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -685,7 +726,28 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/alloc.Po + -rm -f ./$(DEPDIR)/array.Po + -rm -f ./$(DEPDIR)/auth.Po + -rm -f ./$(DEPDIR)/buffer.Po + -rm -f ./$(DEPDIR)/connection.Po + -rm -f ./$(DEPDIR)/convert.Po + -rm -f ./$(DEPDIR)/dispatch.Po + -rm -f ./$(DEPDIR)/errwarn.Po + -rm -f ./$(DEPDIR)/generic.Po + -rm -f ./$(DEPDIR)/handle.Po + -rm -f ./$(DEPDIR)/hash.Po + -rm -f ./$(DEPDIR)/inet_addr.Po + -rm -f ./$(DEPDIR)/isclib.Po + -rm -f ./$(DEPDIR)/iscprint.Po + -rm -f ./$(DEPDIR)/listener.Po + -rm -f ./$(DEPDIR)/message.Po + -rm -f ./$(DEPDIR)/protocol.Po + -rm -f ./$(DEPDIR)/result.Po + -rm -f ./$(DEPDIR)/support.Po + -rm -f ./$(DEPDIR)/test.Po + -rm -f ./$(DEPDIR)/toisc.Po + -rm -f ./$(DEPDIR)/trace.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -707,20 +769,20 @@ uninstall-man: uninstall-man3 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLIBRARIES clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLIBRARIES install-man install-man3 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-libLIBRARIES uninstall-man \ - uninstall-man3 +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLIBRARIES clean-noinstPROGRAMS \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLIBRARIES install-man install-man3 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLIBRARIES \ + uninstall-man uninstall-man3 .PRECIOUS: Makefile diff --git a/omapip/isclib.c b/omapip/isclib.c index fe306b08..4aca9130 100644 --- a/omapip/isclib.c +++ b/omapip/isclib.c @@ -134,6 +134,35 @@ handle_signal(int sig, void (*handler)(int)) { } } +/* Callback passed to isc_app_ctxonrun + * + * BIND9 context code will invoke this handler once the context has + * entered the running state. We use it to set a global marker so that + * we can tell if the context is running. Several of the isc_app_ + * calls REQUIRE that the context is running and we need a way to + * know that. + * + * We also check to see if we received a shutdown signal prior to + * the context entering the run state. If we did, then we can just + * simply shut the context down now. This closes the relatively + * small window between start up and entering run via the call + * to dispatch(). + * + */ +static void +set_ctx_running(isc_task_t *task, isc_event_t *event) { + IGNORE_UNUSED(task); + dhcp_gbl_ctx.actx_running = ISC_TRUE; + + if (shutdown_signal) { + // We got signaled shutdown before we entered running state. + // Now that we've reached running state, shut'er down. + isc_app_ctxsuspend(dhcp_gbl_ctx.actx); + } + + isc_event_free(&event); +} + isc_result_t dhcp_context_create(int flags, struct in_addr *local4, @@ -141,6 +170,9 @@ dhcp_context_create(int flags, isc_result_t result; if ((flags & DHCP_CONTEXT_PRE_DB) != 0) { + dhcp_gbl_ctx.actx_started = ISC_FALSE; + dhcp_gbl_ctx.actx_running = ISC_FALSE; + /* * Set up the error messages, this isn't the right place * for this call but it is convienent for now. @@ -204,15 +236,24 @@ dhcp_context_create(int flags, if (result != ISC_R_SUCCESS) goto cleanup; - result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task); + result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, + &dhcp_gbl_ctx.task); if (result != ISC_R_SUCCESS) goto cleanup; result = isc_app_ctxstart(dhcp_gbl_ctx.actx); if (result != ISC_R_SUCCESS) - return (result); + goto cleanup; + dhcp_gbl_ctx.actx_started = ISC_TRUE; + // Install the onrun callback. + result = isc_app_ctxonrun(dhcp_gbl_ctx.actx, dhcp_gbl_ctx.mctx, + dhcp_gbl_ctx.task, set_ctx_running, + dhcp_gbl_ctx.actx); + if (result != ISC_R_SUCCESS) + goto cleanup; + /* Not all OSs support suppressing SIGPIPE through socket * options, so set the sigal action to be ignore. This allows * broken connections to fail gracefully with EPIPE on writes */ @@ -335,19 +376,17 @@ isclib_make_dst_key(char *inname, * @param signal signal code that we received */ void dhcp_signal_handler(int signal) { - isc_appctx_t *ctx = dhcp_gbl_ctx.actx; - int prev = shutdown_signal; - - if (prev != 0) { + if (shutdown_signal != 0) { /* Already in shutdown. */ return; } + /* Possible race but does it matter? */ shutdown_signal = signal; - /* Use reload (aka suspend) for easier dispatch() reenter. */ - if (ctx && ctx->methods && ctx->methods->ctxsuspend) { - (void) isc_app_ctxsuspend(ctx); + /* If the application context is running tell it to shut down */ + if (dhcp_gbl_ctx.actx_running == ISC_TRUE) { + (void) isc_app_ctxsuspend(dhcp_gbl_ctx.actx); } } |