Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2016 07:03:53 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Jov <amutu@amutu.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap
Message-ID:  <1453903433.42081.30.camel@freebsd.org>
In-Reply-To: <CADyrUxO-X3f6gXDHSKZ1Xy5PFxtZrsM0kiJrnN5MPhaAC5MZkA@mail.gmail.com>
References:  <bug-206658-7@https.bugs.freebsd.org/bugzilla/> <1453862939.42081.25.camel@freebsd.org> <CADyrUxPcndOaeUn_UcDN4F=N5XHsby-wQmLvRfUcYNTjNJPUiQ@mail.gmail.com> <1453867724.42081.28.camel@freebsd.org> <CADyrUxO-X3f6gXDHSKZ1Xy5PFxtZrsM0kiJrnN5MPhaAC5MZkA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-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--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1453903433.42081.30.camel>