net: ipv6: Remove in6_addr from packed net_ipv6_hdr struct

Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.

Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2021-10-05 12:23:57 +02:00 committed by Anas Nashif
commit 666e9f80d6
28 changed files with 403 additions and 317 deletions

View file

@ -415,11 +415,11 @@ static bool ethernet_fill_in_dst_on_ipv6_mcast(struct net_pkt *pkt,
struct net_eth_addr *dst)
{
if (net_pkt_family(pkt) == AF_INET6 &&
net_ipv6_is_addr_mcast(&NET_IPV6_HDR(pkt)->dst)) {
net_ipv6_is_addr_mcast((struct in6_addr *)NET_IPV6_HDR(pkt)->dst)) {
memcpy(dst, (uint8_t *)multicast_eth_addr.addr,
sizeof(struct net_eth_addr) - 4);
memcpy((uint8_t *)dst + 2,
(uint8_t *)(&NET_IPV6_HDR(pkt)->dst) + 12,
NET_IPV6_HDR(pkt)->dst + 12,
sizeof(struct net_eth_addr) - 2);
return true;
@ -446,7 +446,7 @@ static enum net_verdict set_vlan_tag(struct ethernet_context *ctx,
if (net_pkt_family(pkt) == AF_INET6) {
struct net_if *target;
if (net_if_ipv6_addr_lookup(&NET_IPV6_HDR(pkt)->src,
if (net_if_ipv6_addr_lookup((struct in6_addr *)NET_IPV6_HDR(pkt)->src,
&target)) {
if (target != iface) {
NET_DBG("Iface %p should be %p", iface,