=== modified file 'Makefile' --- Makefile 2015-07-05 18:36:23 +0000 +++ Makefile 2015-07-06 20:09:47 +0000 @@ -360,7 +360,8 @@ install-client-nokey: all doc install --directory $(LIBDIR)/mandos $(CONFDIR) install --directory --mode=u=rwx $(KEYDIR) \ - $(LIBDIR)/mandos/plugins.d + $(LIBDIR)/mandos/plugins.d \ + $(LIBDIR)/mandos/plugin-helpers if [ "$(CONFDIR)" != "$(LIBDIR)/mandos" ]; then \ install --mode=u=rwx \ --directory "$(CONFDIR)/plugins.d"; \ @@ -390,6 +391,9 @@ install --mode=u=rwxs,go=rx \ --target-directory=$(LIBDIR)/mandos/plugins.d \ plugins.d/plymouth + install --mode=u=rwxs,go=rx \ + --target-directory=$(LIBDIR)/mandos/plugin-helpers \ + plugin-helpers/mandos-client-iprouteadddel install initramfs-tools-hook \ $(INITRAMFSTOOLS)/hooks/mandos install --mode=u=rw,go=r initramfs-tools-hook-conf \ === modified file 'TODO' --- TODO 2014-10-05 19:39:25 +0000 +++ TODO 2015-07-06 20:09:47 +0000 @@ -48,9 +48,6 @@ ** kernel command line option for debug info * mandos (server) -** TODO [#B] Work around Avahi issue - Avahi does not announce link-local addresses if any global - addresses exist: http://lists.freedesktop.org/archives/avahi/2010-March/001863.html ** TODO [#B] Log level :BUGS: *** TODO /etc/mandos/clients.d/*.conf Watch this directory and add/remove/update clients? === modified file 'initramfs-tools-hook' --- initramfs-tools-hook 2015-06-28 16:35:27 +0000 +++ initramfs-tools-hook 2015-07-06 20:09:47 +0000 @@ -70,7 +70,7 @@ CONFDIR="/conf/conf.d/mandos" MANDOSDIR="/lib/mandos" PLUGINDIR="${MANDOSDIR}/plugins.d" -PLUGINHELPERDIR="${MANDOSDIR}/plugins-helpers" +PLUGINHELPERDIR="${MANDOSDIR}/plugin-helpers" HOOKDIR="${MANDOSDIR}/network-hooks.d" # Make directories === modified file 'plugins.d/mandos-client.c' --- plugins.d/mandos-client.c 2015-07-05 18:36:23 +0000 +++ plugins.d/mandos-client.c 2015-07-06 20:09:47 +0000 @@ -702,15 +702,16 @@ return ret_errno; } -/* Helper function to add_local_route() and remove_local_route() */ +/* Helper function to add_local_route() and delete_local_route() */ __attribute__((nonnull, warn_unused_result)) -static bool add_remove_local_route(const bool add, +static bool add_delete_local_route(const bool add, const char *address, AvahiIfIndex if_index){ int ret; char helper[] = "mandos-client-iprouteadddel"; char add_arg[] = "add"; char delete_arg[] = "delete"; + char debug_flag[] = "--debug"; char *pluginhelperdir = getenv("MANDOSPLUGINHELPERDIR"); if(pluginhelperdir == NULL){ if(debug){ @@ -792,7 +793,8 @@ #endif if(fexecve(helper_fd, (char *const []) { helper, add ? add_arg : delete_arg, (char *)address, - interface, NULL }, environ) == -1){ + interface, debug ? debug_flag : NULL, NULL }, + environ) == -1){ #ifdef __GNUC__ #pragma GCC diagnostic pop #endif @@ -850,13 +852,19 @@ __attribute__((nonnull, warn_unused_result)) static bool add_local_route(const char *address, AvahiIfIndex if_index){ - return add_remove_local_route(true, address, if_index); + if(debug){ + fprintf_plus(stderr, "Adding route to %s\n", address); + } + return add_delete_local_route(true, address, if_index); } __attribute__((nonnull, warn_unused_result)) -static bool remove_local_route(const char *address, +static bool delete_local_route(const char *address, AvahiIfIndex if_index){ - return add_remove_local_route(false, address, if_index); + if(debug){ + fprintf_plus(stderr, "Removing route to %s\n", address); + } + return add_delete_local_route(false, address, if_index); } /* Called when a Mandos server is found */ @@ -1065,6 +1073,10 @@ http://lists.freedesktop.org/archives/avahi/2010-February/001833.html https://bugs.debian.org/587961 */ + if(debug){ + fprintf_plus(stderr, "Mandos server unreachable, trying" + " direct route\n"); + } int e = errno; route_added = add_local_route(ip, if_index); if(route_added){ @@ -1274,8 +1286,8 @@ mandos_end: { if(route_added){ - if(not remove_local_route(ip, if_index)){ - fprintf_plus(stderr, "Failed to remove local route to %s on" + if(not delete_local_route(ip, if_index)){ + fprintf_plus(stderr, "Failed to delete local route to %s on" " interface %d", ip, if_index); } }