net: ipv4: Remove in_addr from packed net_ipv4_hdr struct
Replace unpacked in_addr structures with raw buffers in net_ipv4_hdr struct, to prevent compiler warnings about unaligned access. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
bbdeef4ac4
commit
064200b420
18 changed files with 94 additions and 88 deletions
|
@ -86,10 +86,10 @@ static int loopback_send(const struct device *dev, struct net_pkt *pkt)
|
|||
} else {
|
||||
struct in_addr addr;
|
||||
|
||||
net_ipaddr_copy(&addr, &NET_IPV4_HDR(pkt)->src);
|
||||
net_ipaddr_copy(&NET_IPV4_HDR(pkt)->src,
|
||||
&NET_IPV4_HDR(pkt)->dst);
|
||||
net_ipaddr_copy(&NET_IPV4_HDR(pkt)->dst, &addr);
|
||||
net_ipv4_addr_copy_raw((uint8_t *)&addr, NET_IPV4_HDR(pkt)->src);
|
||||
net_ipv4_addr_copy_raw(NET_IPV4_HDR(pkt)->src,
|
||||
NET_IPV4_HDR(pkt)->dst);
|
||||
net_ipv4_addr_copy_raw(NET_IPV4_HDR(pkt)->dst, (uint8_t *)&addr);
|
||||
}
|
||||
|
||||
/* We should simulate normal driver meaning that if the packet is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue