[SLOF] [PATCH] ipv6: Fix gcc9 warnings

Alexey Kardashevskiy aik at ozlabs.ru
Tue Oct 22 12:05:51 AEDT 2019

How do you test ipv6? I spent an hour with dnsmasq and could not get it working (ipv4 works nicely), tftp part fails.

On 17/10/2019 16:54, Alexey Kardashevskiy wrote:
> On 16/10/2019 22:54, Thomas Huth wrote:
>> On 30/09/2019 09.43, Thomas Huth wrote:
>>> GCC 9 introduced some new compiler warnings that occur when taking the
>>> address of a packed struct, e.g.:
>>>  lib/libnet/icmpv6.c:173:21: warning: taking address of packed member of
>>>  ‘struct ip6hdr’ may result in an unaligned pointer value [-Waddress-of-packed-member]
>>>   173 |  rtr = find_router (&(ip6h->src));
>>>       |                     ^~~~~~~~~~~~
>>> Since these warnings are mainly about the ip6_addr_t values that are
>>> embedded in these packed structs, and ip6_addr_t is reasonable small
>>> (just 128 bit), let's fix it by passing around the IPv6 addresses by
>>> value instead of pointer, which looks a little bit nicer anyway.
>>> Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
>>> [thuth: Fixed more spots, adjusted the coding style, added patch description]
>>> Signed-off-by: Thomas Huth <thuth at redhat.com>
>>> ---
>>>  Alexey, can you additionally commit your "ipv6: Fix more gcc9 warnings"
>>>  patch? ... with both patches applied, the libnet code is then finally
>>>  free from compiler warnings for me.
>> Ping?
> I was off for 1.5 weeks, I'll test and push in the next couple of days. Cheers.


More information about the SLOF mailing list