From owner-svn-src-head@freebsd.org Fri Apr 14 11:41:10 2017 Return-Path: Delivered-To: svn-src-head@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 67D3FD3DDA2; Fri, 14 Apr 2017 11:41:10 +0000 (UTC) (envelope-from ae@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 34C21876; Fri, 14 Apr 2017 11:41:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EBf9jr097086; Fri, 14 Apr 2017 11:41:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EBf9MC097085; Fri, 14 Apr 2017 11:41:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704141141.v3EBf9MC097085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 11:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316825 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:41:10 -0000 Author: ae Date: Fri Apr 14 11:41:09 2017 New Revision: 316825 URL: https://svnweb.freebsd.org/changeset/base/316825 Log: Use address of specific union member instead of whole union address to fix PVS-Studio warnings. MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Apr 14 11:19:09 2017 (r316824) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Apr 14 11:41:09 2017 (r316825) @@ -526,7 +526,8 @@ ta_dump_radix_tentry(void *ta_state, str #ifdef INET6 } else { xn = (struct radix_addr_xentry *)e; - memcpy(&tent->k, &xn->addr6.sin6_addr, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &xn->addr6.sin6_addr, + sizeof(struct in6_addr)); tent->masklen = xn->masklen; tent->subtype = AF_INET6; tent->v.kidx = xn->value; @@ -1381,7 +1382,7 @@ ta_dump_chash_tentry(void *ta_state, str tent->v.kidx = ent->value; #ifdef INET6 } else { - memcpy(&tent->k, &ent->a.a6, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &ent->a.a6, sizeof(struct in6_addr)); tent->masklen = cfg->mask6; tent->subtype = AF_INET6; tent->v.kidx = ent->value; @@ -3983,7 +3984,8 @@ ta_dump_kfib_tentry_int(struct sockaddr if (paddr->sa_family == AF_INET6) { addr6 = (struct sockaddr_in6 *)paddr; mask6 = (struct sockaddr_in6 *)pmask; - memcpy(&tent->k, &addr6->sin6_addr, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &addr6->sin6_addr, + sizeof(struct in6_addr)); len = 128; if (mask6 != NULL) len = contigmask((uint8_t *)&mask6->sin6_addr, 128);