[ovs-dev] [PATCH 1/5] odp-execute: Fix unaligned eth_addr pointers.
Ben Pfaff
blp at ovn.org
Thu May 25 03:02:40 UTC 2017
On Tue, May 23, 2017 at 04:02:12PM -0700, Joe Stringer wrote:
> Clang 4.0 complains:
>
> ../lib/odp-execute.c:61:37: error: taking address of packed member 'eth_dst' of
> class or structure 'eth_header' may result in an unaligned pointer value
> [-Werror,-Waddress-of-packed-member]
> ether_addr_copy_masked(&eh->eth_src, key->eth_src, mask->eth_src);
> ^~~~~~~~~~~
> ../lib/odp-execute.c:62:37: error: taking address of packed member 'eth_dst' of
> class or structure 'eth_header' may result in an unaligned pointer value
> [-Werror,-Waddress-of-packed-member]
> ether_addr_copy_masked(&eh->eth_dst, key->eth_dst, mask->eth_dst);
>
> Ethernet source addresses are 48 bits offset into the Ethernet header,
> so taking a pointer for this is not guaranteed to be valid on all
> architectures. Fix this by referencing the memory direct from the
> Ethernet header pointer.
>
> Signed-off-by: Joe Stringer <joe at ovn.org>
I don't understand--why does Clang think that there's something packed
here? I don't see any packed annotation on struct eth_header (and I
don't think it needs one).
More information about the dev
mailing list