Commit Graph

4 Commits

Author SHA1 Message Date
Thomas Huth ac9eac3875 Fix typos in the lib/libnet folder
Found with the "codespell" utility.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2023-02-28 16:08:50 +11:00
Thomas Huth 8c6d468210 ipv6: Fix gcc9 warnings
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>
2019-10-22 14:35:36 +11:00
Thomas Huth 14df554937 libnet: Move the external declaration of send_ip to ethernet.h
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>
2017-07-07 16:40:53 +10:00
Thomas Huth 3c1fe653f5 net: Move files from clients/net-snk/app/netlib/ to lib/libnet/
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>
2016-06-27 12:31:06 +10:00