sitnl: replace NLMSG_TAIL macro with noinline function
The NLMSG_TAIL macro is confusing gcc when compiling with -O3, leading
to warnings like:
networking_sitnl.c:143:9: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=]
143 | memcpy(RTA_DATA(rta), data, alen);
| ^
networking_sitnl.c:101:21: note: at offset [72, 88] into destination object ānā of size 16
101 | struct nlmsghdr n;
| ^
Replacing the macro with a function is also not effective because gcc
will inline it and get confused again.
The only way out is to write a function that never gets inline'd and
replace the macro with it.
Tested on linux with gcc and clang.
Change-Id: I9306a590a10a7d5cba32abe06d269494fec41ba6
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <
20241106131705.11069-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29710.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>