From 0cd5aa540389cfd8a9be13e680c1ca34c4e85bc8 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 9 Dec 2021 15:05:52 +0900 Subject: [PATCH] Clatd changes for move of libipchecksum. libipchecksum is becoming its own library in frameworks/libs/net and its include files are no longer under netutils/. Adjust clatd code accordingly. Also reorder some include files as suggested by clang-format. Test: m Test: atest clatd_test Test: connects to IPv6-only wifi, testipv4.com shows 10/10 Change-Id: I5e4c73065ce828123aef7e8851227f9bdf444ff9 --- Android.bp | 4 ++-- clatd_test.cpp | 2 +- dump.c | 11 +++++------ ipv4.c | 3 +-- ipv6.c | 6 ++---- translate.c | 6 +++--- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Android.bp b/Android.bp index 6df30786ea..9d2d85e878 100644 --- a/Android.bp +++ b/Android.bp @@ -66,7 +66,7 @@ cc_binary { "main.c" ], static_libs: [ - "libipchecksum", + "libip_checksum", "libnl", ], shared_libs: [ @@ -106,7 +106,7 @@ cc_test { ], static_libs: [ "libbase", - "libipchecksum", + "libip_checksum", "libnetd_test_tun_interface", "libnl", ], diff --git a/clatd_test.cpp b/clatd_test.cpp index 9b7a3e7554..d6d7e66aa8 100644 --- a/clatd_test.cpp +++ b/clatd_test.cpp @@ -30,10 +30,10 @@ #include "tun_interface.h" extern "C" { +#include "checksum.h" #include "clatd.h" #include "config.h" #include "getaddr.h" -#include "netutils/checksum.h" #include "translate.h" } diff --git a/dump.c b/dump.c index 7332d6c652..289f161742 100644 --- a/dump.c +++ b/dump.c @@ -15,9 +15,7 @@ * * dump.c - print various headers for debugging */ -#include -#include -#include +#include "dump.h" #include #include @@ -29,12 +27,13 @@ #include #include #include +#include +#include +#include -#include "netutils/checksum.h" - +#include "checksum.h" #include "clatd.h" #include "debug.h" -#include "dump.h" #include "logging.h" #if CLAT_DEBUG diff --git a/ipv4.c b/ipv4.c index c052d03e89..2be02e34c2 100644 --- a/ipv4.c +++ b/ipv4.c @@ -17,8 +17,7 @@ */ #include -#include "netutils/checksum.h" - +#include "checksum.h" #include "debug.h" #include "dump.h" #include "logging.h" diff --git a/ipv6.c b/ipv6.c index ca3e4c68a5..05cd3ab116 100644 --- a/ipv6.c +++ b/ipv6.c @@ -15,12 +15,10 @@ * * ipv6.c - takes ipv6 packets, finds their headers, and then calls translation functions on them */ +#include #include -#include - -#include "netutils/checksum.h" - +#include "checksum.h" #include "config.h" #include "debug.h" #include "dump.h" diff --git a/translate.c b/translate.c index 728acc3045..22830d890c 100644 --- a/translate.c +++ b/translate.c @@ -15,17 +15,17 @@ * * translate.c - CLAT functions / partial implementation of rfc6145 */ +#include "translate.h" + #include -#include "netutils/checksum.h" - +#include "checksum.h" #include "clatd.h" #include "common.h" #include "config.h" #include "debug.h" #include "icmp.h" #include "logging.h" -#include "translate.h" /* function: packet_checksum * calculates the checksum over all the packet components starting from pos