From: Roy Marples Date: Thu, 4 Sep 2014 16:23:36 +0000 (+0000) Subject: --getinterfaces no longer supports an option interface list. X-Git-Tag: v6.4.4~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6dcd7daee55d86ec7befa13e8390abff9b1afb8b;p=thirdparty%2Fdhcpcd.git --getinterfaces no longer supports an option interface list. --- diff --git a/dhcpcd.c b/dhcpcd.c index 8141b46a..b19f22bf 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1083,52 +1083,23 @@ dhcpcd_handleargs(struct dhcpcd_ctx *ctx, struct fd_list *fd, return 0; } else if (strcmp(*argv, "--getinterfaces") == 0) { len = 0; - if (argc == 1) { - TAILQ_FOREACH(ifp, ctx->ifaces, next) { + TAILQ_FOREACH(ifp, ctx->ifaces, next) { + len++; + if (D_STATE_RUNNING(ifp)) + len++; + if (D6_STATE_RUNNING(ifp)) + len++; + if (ipv6nd_hasra(ifp)) len++; - if (D_STATE_RUNNING(ifp)) - len++; - if (D6_STATE_RUNNING(ifp)) - len++; - if (ipv6nd_hasra(ifp)) - len++; - } - if (write(fd->fd, &len, sizeof(len)) != - sizeof(len)) - return -1; - TAILQ_FOREACH(ifp, ctx->ifaces, next) { - if (send_interface(fd->fd, ifp) == -1) - syslog(LOG_ERR, - "send_interface %d: %m", - fd->fd); - } - return 0; - } - opt = 0; - while (argv[++opt] != NULL) { - TAILQ_FOREACH(ifp, ctx->ifaces, next) { - if (strcmp(argv[opt], ifp->name) == 0) { - len++; - if (D_STATE_RUNNING(ifp)) - len++; - if (D6_STATE_RUNNING(ifp)) - len++; - if (ipv6nd_hasra(ifp)) - len++; - } - } } - if (write(fd->fd, &len, sizeof(len)) != sizeof(len)) + if (write(fd->fd, &len, sizeof(len)) != + sizeof(len)) return -1; - opt = 0; - while (argv[++opt] != NULL) { - TAILQ_FOREACH(ifp, ctx->ifaces, next) { - if (strcmp(argv[opt], ifp->name)== 0 && - send_interface(fd->fd, ifp) == -1) - syslog(LOG_ERR, - "send_interface %d: %m", - fd->fd); - } + TAILQ_FOREACH(ifp, ctx->ifaces, next) { + if (send_interface(fd->fd, ifp) == -1) + syslog(LOG_ERR, + "send_interface %d: %m", + fd->fd); } return 0; } else if (strcmp(*argv, "--listen") == 0) {