genode/repos/os/include/net
Martin Stein 49184fb938 net: circumvent stringop-overflow error
With the update to GCC 10, the compiler stopped with an error when compiling
places where a MAC address is copied from outside into a packed object using
the Net::Netaddress::copy method (e.g. in
Net::Arp_packet::dst_mac(Mac_address)):

! error: writing 6 bytes into a region of size 4 [-Werror=stringop-overflow=]

While trying to find a clean solution for this error, I found posts on
gcc.gnu.org and github that stated that the size calculations that cause these
errors are incorrect. Indeed, I could verify that the actual size of the two
regions was static and exactly the same in places were the error occured.

Furthermore, I couldn't find a way of making it more clear to the compiler
that the sizes are the same. By accident, we found that using the address of
the first element of the array that forms the second region instead of the
array address itself, somehow circumvents the error.

Fixes #4109
2021-05-05 11:35:31 +02:00
..
arp.h net: use Size_guard for packet-data accessors 2018-05-30 13:36:11 +02:00
dhcp.h net/dhcp.h: more specific include guards 2020-12-09 14:02:10 +01:00
ethernet.h os: avoid warning in ethernet.h 2019-01-07 12:25:45 +01:00
icmp.h net: use Size_guard for packet-data accessors 2018-05-30 13:36:11 +02:00
internet_checksum.h net: fix packed-conversion compiler warning 2021-05-05 11:35:31 +02:00
ipv4.h net: move ascii_to() into Net namespace 2020-09-17 10:13:22 +02:00
mac_address.h net: move ascii_to() into Net namespace 2020-09-17 10:13:22 +02:00
netaddress.h net: circumvent stringop-overflow error 2021-05-05 11:35:31 +02:00
port.h net: move ascii_to() into Net namespace 2020-09-17 10:13:22 +02:00
size_guard.h net: use Size_guard for packet-data accessors 2018-05-30 13:36:11 +02:00
sntp.h sntp_client: report received transmit timestamp 2019-08-21 12:37:02 +02:00
tcp.h net: use generic internet checksum 2018-05-03 15:31:56 +02:00
udp.h net: use Size_guard for packet-data accessors 2018-05-30 13:36:11 +02:00