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: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
When compiling SLOF with the -Wredundant-decls compiler flag,
there is currently a warning in the libnet code since the send_ip
pointer is currently declared twice, one time in ipv4.h and
one time in ipv6.h. To avoid this warning, let's move the
declaration to IP-version independent ethernet.h instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
When we want to link the network stack to other parts of the
firmware later (paflof), we've got to turn it into a proper
library first.
Note: Make sure to run "make distclean" after this patch, so that
the dependencies for the moved files get rebuilt properly.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>