Common/Network: Use std::array in IPv4Header.

This commit is contained in:
Admiral H. Curtiss 2022-05-23 02:01:59 +02:00
commit f68c3b758e
No known key found for this signature in database
GPG key ID: F051B4C4044F33FB
2 changed files with 4 additions and 4 deletions

View file

@ -102,8 +102,8 @@ IPv4Header::IPv4Header(u16 data_size, u8 ip_proto, const sockaddr_in& from, cons
flags_fragment_offset = htons(0x4000);
ttl = 0x40;
protocol = ip_proto;
std::memcpy(&source_addr, &from.sin_addr, IPV4_ADDR_LEN);
std::memcpy(&destination_addr, &to.sin_addr, IPV4_ADDR_LEN);
std::memcpy(source_addr.data(), &from.sin_addr, IPV4_ADDR_LEN);
std::memcpy(destination_addr.data(), &to.sin_addr, IPV4_ADDR_LEN);
header_checksum = htons(ComputeNetworkChecksum(this, Size()));
}