aboutsummaryrefslogtreecommitdiff
path: root/lib/libnet/ipv6.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-28Fix typos in the lib/libnet folderThomas Huth1-4/+4
Found with the "codespell" utility. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2023-02-28lib/libnet/ipv6: Silence compiler warning from ClangThomas Huth1-3/+2
When compiling the libnet code with Clang (e.g. for the s390-ccw bios), it complains with the following warning: ipv6.c:447:18: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant] unsigned short raw[ip6size]; ^ The warning is completely harmless, of course. Anyway let's rewrite the code a little bit to make the compiler silent again. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2019-10-22ipv6: Fix gcc9 warningsThomas Huth1-39/+33
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>
2017-09-26libnet/ipv6: assign times_asked value directlyNikunj A Dadhania1-1/+1
times_asked value remains same as the structure is zeroed, but it makes more sense to do that directly instead of adding with previous value. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-06-15libnet: Cosmetical clean-upThomas Huth1-2/+1
Replace indentation spaces with tabs, remove superfluous prototype (ip6addr_add() is declared in ipv6.h already) and fix the old-style declaration of ip6_create_prefix_info(). No functional changes done. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-06-27net: Move files from clients/net-snk/app/netlib/ to lib/libnet/Thomas Huth1-0/+775
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>