summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:24:06 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-04-28 20:24:06 +0000
commit98747ecf684bf6c46ad62a54cae7ea9a9f1fc33c (patch)
treeac9a90d6280e22785aaca68db210bf5612ea1b13
parent6da918a284be3ff45f943baa99bcba53c9fbf8df (diff)
parent8addcc0f6360cc3762e9ef27437ded250e785da3 (diff)
downloadandroid-clat-android10-mainline-tzdata-release.tar.gz
Change-Id: I2a65fadc52cc5eb6b1db7cac4f9f3ad58059417e
-rw-r--r--Android.bp1
-rw-r--r--BUGS2
-rw-r--r--TEST_MAPPING10
-rw-r--r--clatd.c5
-rw-r--r--config.c2
-rw-r--r--ipv4.c2
-rw-r--r--ipv6.c2
7 files changed, 12 insertions, 12 deletions
diff --git a/Android.bp b/Android.bp
index 1d21c24..b495dac 100644
--- a/Android.bp
+++ b/Android.bp
@@ -94,7 +94,6 @@ cc_test {
"libnetutils",
],
test_suites: ["device-tests"],
- require_root: true,
}
// Microbenchmark.
diff --git a/BUGS b/BUGS
index 24e6639..70aeb9f 100644
--- a/BUGS
+++ b/BUGS
@@ -1,5 +1,5 @@
known problems/assumptions:
- - does not handle protocols other than ICMP, UDP, TCP and GRE/ESP
+ - does not handle protocols other than ICMP, UDP, TCP and GRE
- assumes the handset has its own (routed) /64 ipv6 subnet
- assumes the /128 ipv6 subnet it generates can use the nat64 gateway
- assumes the nat64 gateway has the ipv4 address in the last 32 bits of the ipv6 address (that it uses a /96 plat subnet)
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 873ff2f..c6d599d 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,11 +1,7 @@
{
"presubmit": [
- { "name": "clatd_test" },
- { "name": "libnetdbpf_test" },
- { "name": "netd_integration_test" },
- { "name": "netd_unit_test" },
- { "name": "netdutils_test" },
- { "name": "resolv_integration_test" },
- { "name": "resolv_unit_test" }
+ {
+ "name": "clatd_test"
+ }
]
}
diff --git a/clatd.c b/clatd.c
index 019ce7c..d332e1e 100644
--- a/clatd.c
+++ b/clatd.c
@@ -417,6 +417,11 @@ void read_packet(int read_fd, int write_fd, int to_ipv6) {
}
uint16_t proto = ntohs(tun_header->proto);
+ if (proto == ETH_P_IPV6) {
+ // kernel IPv6 stack spams us with router/neighbour solication,
+ // multicast group joins, etc. which otherwise fills the log...
+ return;
+ }
if (proto != ETH_P_IP) {
logmsg(ANDROID_LOG_WARN, "%s: unknown packet type = 0x%x", __func__, proto);
return;
diff --git a/config.c b/config.c
index c370770..f84a61f 100644
--- a/config.c
+++ b/config.c
@@ -234,7 +234,7 @@ int connect_is_ipv4_address_free(in_addr_t addr) {
// Attempt to connect to the address. If the connection succeeds and getsockname returns the same
// the address then the address is already assigned to the system and we can't use it.
- struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr = { addr }, .sin_port = htons(53) };
+ struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr = { addr }, .sin_port = 53 };
socklen_t len = sizeof(sin);
int inuse = connect(s, (struct sockaddr *)&sin, sizeof(sin)) == 0 &&
getsockname(s, (struct sockaddr *)&sin, &len) == 0 && (size_t)len >= sizeof(sin) &&
diff --git a/ipv4.c b/ipv4.c
index c052d03..56d83ac 100644
--- a/ipv4.c
+++ b/ipv4.c
@@ -131,7 +131,7 @@ int ipv4_packet(clat_packet out, clat_packet_index pos, const uint8_t *packet, s
} else if (nxthdr == IPPROTO_UDP) {
iov_len =
udp_packet(out, pos + 2, (const struct udphdr *)next_header, old_sum, new_sum, len_left);
- } else if (nxthdr == IPPROTO_GRE || nxthdr == IPPROTO_ESP) {
+ } else if (nxthdr == IPPROTO_GRE) {
iov_len = generic_packet(out, pos + 2, next_header, len_left);
} else {
#if CLAT_DEBUG
diff --git a/ipv6.c b/ipv6.c
index ca3e4c6..c9b547e 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -163,7 +163,7 @@ int ipv6_packet(clat_packet out, clat_packet_index pos, const uint8_t *packet, s
} else if (protocol == IPPROTO_UDP) {
iov_len =
udp_packet(out, pos + 2, (const struct udphdr *)next_header, old_sum, new_sum, len_left);
- } else if (protocol == IPPROTO_GRE || protocol == IPPROTO_ESP) {
+ } else if (protocol == IPPROTO_GRE) {
iov_len = generic_packet(out, pos + 2, next_header, len_left);
} else {
#if CLAT_DEBUG