From owner-freebsd-arm@freebsd.org Wed Jan 27 14:03:56 2016 Return-Path: Delivered-To: freebsd-arm@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 212AAA6F563 for ; Wed, 27 Jan 2016 14:03:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 EA9891281 for ; Wed, 27 Jan 2016 14:03:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 27 Jan 2016 14:04:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0RE3r9C031128; Wed, 27 Jan 2016 07:03:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1453903433.42081.30.camel@freebsd.org> Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap From: Ian Lepore To: Jov Cc: freebsd-arm@freebsd.org Date: Wed, 27 Jan 2016 07:03:53 -0700 In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> Content-Type: multipart/mixed; boundary="=-lj0Q2vac0hEvyJoqIwhW" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:03:56 -0000 --=-lj0Q2vac0hEvyJoqIwhW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, 2016-01-27 at 20:34 +0800, Jov wrote: > Warning: Object directory not changed from original > /usr/src/sbin/pfctl > cc -O -pipe -mfloat-abi=softfp -Wall -Wmissing-prototypes > -Wno-uninitialized -Wstrict-prototypes -DENABLE_ALTQ > -I/usr/src/sbin/pfctl > -DWITH_INET6 -DWITH_INET -g -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological > -compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unuse function > -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch -Wno > -switch-enum > -Wno-knr-promoted-parameter -Qunused-arguments -c pf_print_state.c > -o > pf_print_state.o > pf_print_state.c:149:25: error: passing 'struct in_addr' to parameter > of > incompatible type 'const void *' > memcpy(&sin.sin_addr, addr->v4, > sizeof(sin.sin_addr)); > ^~~~~~~~ > /usr/include/string.h:62:56: note: passing argument to parameter here > void *memcpy(void * __restrict, const void * __restrict, size_t); > ^ > pf_print_state.c:160:27: error: passing 'struct in6_addr' to > parameter of > incompatible type 'const void *' > memcpy(&sin6.sin6_addr, addr->v6, > sizeof(sin6.sin6_addr)); > ^~~~~~~~ > /usr/include/string.h:62:56: note: passing argument to parameter here > void *memcpy(void * __restrict, const void * __restrict, size_t); > ^ > 2 errors generated. > *** Error code 1 > > Stop. > make: stopped in /usr/src/sbin/pfctl > Oops, sorry about that, try this one... -- Ian --=-lj0Q2vac0hEvyJoqIwhW Content-Disposition: inline; filename="pfctl_align2.diff" Content-Type: text/x-patch; name="pfctl_align2.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: sbin/pfctl/pf_print_state.c =================================================================== --- sbin/pfctl/pf_print_state.c (revision 294860) +++ sbin/pfctl/pf_print_state.c (working copy) @@ -146,7 +146,7 @@ print_name(struct pf_addr *addr, sa_family_t af) memset(&sin, 0, sizeof(sin)); sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; - sin.sin_addr = addr->v4; + memcpy(&sin.sin_addr, &addr->v4, sizeof(sin.sin_addr)); getnameinfo((struct sockaddr *)&sin, sin.sin_len, host, sizeof(host), NULL, 0, NI_NOFQDN); break; @@ -157,7 +157,7 @@ print_name(struct pf_addr *addr, sa_family_t af) memset(&sin6, 0, sizeof(sin6)); sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; - sin6.sin6_addr = addr->v6; + memcpy(&sin6.sin6_addr, &addr->v6, sizeof(sin6.sin6_addr)); getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, host, sizeof(host), NULL, 0, NI_NOFQDN); break; @@ -175,7 +175,7 @@ print_host(struct pf_addr *addr, u_int16_t port, s struct pf_addr_wrap aw; memset(&aw, 0, sizeof(aw)); - aw.v.a.addr = *addr; + memcpy(&aw.v.a.addr, addr, sizeof(aw.v.a.addr)); if (af == AF_INET) aw.v.a.mask.addr32[0] = 0xffffffff; else { --=-lj0Q2vac0hEvyJoqIwhW--