From: Roy Marples Date: Mon, 30 Jun 2014 11:28:14 +0000 (+0000) Subject: Add debugging messages for interface arrival/departure. X-Git-Tag: v6.4.1~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=942a8ffcf790b8ba796e1dadfb583c010e208144;p=thirdparty%2Fdhcpcd.git Add debugging messages for interface arrival/departure. Only init state and run preinit for new interfaces. --- diff --git a/dhcpcd.c b/dhcpcd.c index d950c354..11b07b8c 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -743,6 +743,7 @@ dhcpcd_handleinterface(void *arg, int action, const char *ifname) errno = ESRCH; return -1; } + syslog(LOG_DEBUG, "%s: interface departed", ifp->name); ifp->options->options |= DHCPCD_DEPARTED; stop_interface(ifp); return 0; @@ -766,20 +767,21 @@ dhcpcd_handleinterface(void *arg, int action, const char *ifname) /* Check if we already have the interface */ ifl = if_find(ctx, ifp->name); if (ifl) { + syslog(LOG_DEBUG, "%s: interface updated", ifl->name); /* The flags and hwaddr could have changed */ ifl->flags = ifp->flags; ifl->hwlen = ifp->hwlen; if (ifp->hwlen != 0) memcpy(ifl->hwaddr, ifp->hwaddr, ifl->hwlen); } else { + syslog(LOG_DEBUG, "%s: interface added", ifp->name); TAILQ_REMOVE(ifs, ifp, next); TAILQ_INSERT_TAIL(ctx->ifaces, ifp, next); - } - if (action > 0) { init_state(ifp, ctx->argc, ctx->argv); run_preinit(ifp); - dhcpcd_startinterface(ifp); } + if (action > 0) + dhcpcd_startinterface(ifp); } /* Free our discovered list */