From owner-svn-src-all@FreeBSD.ORG Wed Jan 28 21:33:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 404B7598; Wed, 28 Jan 2015 21:33:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20B72331; Wed, 28 Jan 2015 21:33:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0SLXorg069954; Wed, 28 Jan 2015 21:33:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0SLXnJu069948; Wed, 28 Jan 2015 21:33:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501282133.t0SLXnJu069948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 28 Jan 2015 21:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277857 - head/usr.sbin/ppp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2015 21:33:51 -0000 Author: dim Date: Wed Jan 28 21:33:49 2015 New Revision: 277857 URL: https://svnweb.freebsd.org/changeset/base/277857 Log: Fix multiple instances of the following clang 3.6.0 warning in ppp: usr.sbin/ppp/command.c:2054:74: error: address of array 'arg->bundle->radius.cfg.file' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] if (arg->bundle->radius.alive.interval && !arg->bundle->radius.cfg.file) { ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ In all cases, the file field of struct radius is a char array, but the intent was to check whether the string is empty, so add an indirection to achieve that. Use a similar approach for the sockname field of struct server. Modified: head/usr.sbin/ppp/command.c head/usr.sbin/ppp/ipcp.c head/usr.sbin/ppp/ipv6cp.c head/usr.sbin/ppp/radius.c head/usr.sbin/ppp/server.c Modified: head/usr.sbin/ppp/command.c ============================================================================== --- head/usr.sbin/ppp/command.c Wed Jan 28 21:21:35 2015 (r277856) +++ head/usr.sbin/ppp/command.c Wed Jan 28 21:33:49 2015 (r277857) @@ -2051,7 +2051,7 @@ SetVariable(struct cmdargs const *arg) res = 1; } else { arg->bundle->radius.alive.interval = atoi(argp); - if (arg->bundle->radius.alive.interval && !arg->bundle->radius.cfg.file) { + if (arg->bundle->radius.alive.interval && !*arg->bundle->radius.cfg.file) { log_Printf(LogWARN, "rad_alive requires radius to be configured\n"); res = 1; } else if (arg->bundle->ncp.ipcp.fsm.state == ST_OPENED) { @@ -2335,7 +2335,7 @@ SetVariable(struct cmdargs const *arg) res = 1; } - if (arg->bundle->radius.port_id_type && !arg->bundle->radius.cfg.file) { + if (arg->bundle->radius.port_id_type && !*arg->bundle->radius.cfg.file) { log_Printf(LogWARN, "rad_port_id requires radius to be configured\n"); res = 1; } Modified: head/usr.sbin/ppp/ipcp.c ============================================================================== --- head/usr.sbin/ppp/ipcp.c Wed Jan 28 21:21:35 2015 (r277856) +++ head/usr.sbin/ppp/ipcp.c Wed Jan 28 21:33:49 2015 (r277857) @@ -880,7 +880,7 @@ IpcpLayerDown(struct fsm *fp) radius_Account(&fp->bundle->radius, &fp->bundle->radacct, fp->bundle->links, RAD_STOP, &ipcp->throughput); - if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) + if (*fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) system_Select(fp->bundle, fp->bundle->radius.filterid, LINKDOWNFILE, NULL, NULL); radius_StopTimer(&fp->bundle->radius); @@ -949,7 +949,7 @@ IpcpLayerUp(struct fsm *fp) radius_Account(&fp->bundle->radius, &fp->bundle->radacct, fp->bundle->links, RAD_START, &ipcp->throughput); - if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) + if (*fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) system_Select(fp->bundle, fp->bundle->radius.filterid, LINKUPFILE, NULL, NULL); radius_StartTimer(fp->bundle); Modified: head/usr.sbin/ppp/ipv6cp.c ============================================================================== --- head/usr.sbin/ppp/ipv6cp.c Wed Jan 28 21:21:35 2015 (r277856) +++ head/usr.sbin/ppp/ipv6cp.c Wed Jan 28 21:33:49 2015 (r277857) @@ -486,7 +486,7 @@ ipv6cp_LayerUp(struct fsm *fp) * evaluated. */ if (!Enabled(fp->bundle, OPT_IPCP)) { - if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) + if (*fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) system_Select(fp->bundle, fp->bundle->radius.filterid, LINKUPFILE, NULL, NULL); } @@ -539,7 +539,7 @@ ipv6cp_LayerDown(struct fsm *fp) * evaluated. */ if (!Enabled(fp->bundle, OPT_IPCP)) { - if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) + if (*fp->bundle->radius.cfg.file && fp->bundle->radius.filterid) system_Select(fp->bundle, fp->bundle->radius.filterid, LINKDOWNFILE, NULL, NULL); } Modified: head/usr.sbin/ppp/radius.c ============================================================================== --- head/usr.sbin/ppp/radius.c Wed Jan 28 21:21:35 2015 (r277856) +++ head/usr.sbin/ppp/radius.c Wed Jan 28 21:33:49 2015 (r277857) @@ -1345,7 +1345,7 @@ radius_alive(void *v) void radius_StartTimer(struct bundle *bundle) { - if (bundle->radius.cfg.file && bundle->radius.alive.interval) { + if (*bundle->radius.cfg.file && bundle->radius.alive.interval) { bundle->radius.alive.timer.func = radius_alive; bundle->radius.alive.timer.name = "radius alive"; bundle->radius.alive.timer.load = bundle->radius.alive.interval * SECTICKS; Modified: head/usr.sbin/ppp/server.c ============================================================================== --- head/usr.sbin/ppp/server.c Wed Jan 28 21:21:35 2015 (r277856) +++ head/usr.sbin/ppp/server.c Wed Jan 28 21:33:49 2015 (r277857) @@ -248,7 +248,7 @@ server_LocalOpen(struct bundle *bundle, oldmask = (mode_t)-1; /* Silence compiler */ - if (server.cfg.sockname && !strcmp(server.cfg.sockname, name)) + if (server.cfg.sockname[0] != '\0' && !strcmp(server.cfg.sockname, name)) server_Close(bundle); memset(&ifsun, '\0', sizeof ifsun);