From owner-svn-src-all@freebsd.org Sun Nov 20 17:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162FAC4C5F2; Sun, 20 Nov 2016 17:03:54 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DBC01190B; Sun, 20 Nov 2016 17:03:53 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAKH3rGd070453; Sun, 20 Nov 2016 17:03:53 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAKH3rVs070452; Sun, 20 Nov 2016 17:03:53 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201611201703.uAKH3rVs070452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 20 Nov 2016 17:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308891 - stable/11/sbin/etherswitchcfg X-SVN-Group: stable-11 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.23 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: Sun, 20 Nov 2016 17:03:54 -0000 Author: loos Date: Sun Nov 20 17:03:52 2016 New Revision: 308891 URL: https://svnweb.freebsd.org/changeset/base/308891 Log: Zero etherswitch_vlangroup structure before doing partial assignments. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sbin/etherswitchcfg/etherswitchcfg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- stable/11/sbin/etherswitchcfg/etherswitchcfg.c Sun Nov 20 16:16:55 2016 (r308890) +++ stable/11/sbin/etherswitchcfg/etherswitchcfg.c Sun Nov 20 17:03:52 2016 (r308891) @@ -274,7 +274,8 @@ set_vlangroup_vid(struct cfg *cfg, char { int v; etherswitch_vlangroup_t vg; - + + memset(&vg, 0, sizeof(vg)); v = strtol(argv[1], NULL, 0); if (v < 0 || v > IEEE802DOT1Q_VID_MAX) errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX); @@ -293,8 +294,9 @@ set_vlangroup_members(struct cfg *cfg, c int member, untagged; char *c, *d; int v; - + member = untagged = 0; + memset(&vg, 0, sizeof(vg)); if (strcmp(argv[1], "none") != 0) { for (c=argv[1]; *c; c=d) { v = strtol(c, &d, 0);