summaryrefslogtreecommitdiffstats
path: root/translate.h
diff options
context:
space:
mode:
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>2015-10-26 18:45:04 -0600
committerSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>2015-11-15 13:21:45 -0700
commit32961d08e3abe5b4e81178bb8c37dd4df231306d (patch)
treec1e80bcbc7c1c0bb7792e1ac5fb4b0aa690bb633 /translate.h
parentb38ac868d20bb9c1cae087ab18691d242aad0c5c (diff)
downloadandroid_external_android-clat-32961d08e3abe5b4e81178bb8c37dd4df231306d.tar.gz
android_external_android-clat-32961d08e3abe5b4e81178bb8c37dd4df231306d.tar.bz2
android_external_android-clat-32961d08e3abe5b4e81178bb8c37dd4df231306d.zip
clatd: Relay checksum information from packet socket to TUN interface
With this change, we can notify network stack to disable checksum validation for GRO packets as well as other packets which have checksum validation completed earlier in a driver. GRO packets have the ip_summed field set to CHECKSUM_PARTIAL while checksum offloaded packets have the ip_summed field as CHECKSUM_UNNECESSARY. Kernel copies this ip_summed field to the status field in the tpacket filter. The information from the status field is then passed as part of the TUN header to the TUN interface. Any other packet will have the complete checksum validation done in the network stack. Note that this only applies to packets which are captured in packet sockets and passed onto the TUN interface. Change-Id: I536c0356cbbf30fed7ecda5fdd0d38fa0dfd7bf3
Diffstat (limited to 'translate.h')
-rw-r--r--translate.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/translate.h b/translate.h
index aa8b736..3c249eb 100644
--- a/translate.h
+++ b/translate.h
@@ -42,14 +42,14 @@ uint16_t packet_length(clat_packet packet, clat_packet_index pos);
int is_in_plat_subnet(const struct in6_addr *addr6);
// Functions to create tun, IPv4, and IPv6 headers.
-void fill_tun_header(struct tun_pi *tun_header, uint16_t proto);
+void fill_tun_header(struct tun_pi *tun_header, uint16_t proto, uint16_t skip_csum);
void fill_ip_header(struct iphdr *ip_targ, uint16_t payload_len, uint8_t protocol,
const struct ip6_hdr *old_header);
void fill_ip6_header(struct ip6_hdr *ip6, uint16_t payload_len, uint8_t protocol,
const struct iphdr *old_header);
// Translate and send packets.
-void translate_packet(int fd, int to_ipv6, const uint8_t *packet, size_t packetsize);
+void translate_packet(int fd, int to_ipv6, const uint8_t *packet, size_t packetsize, uint16_t skip_csum);
// Translate IPv4 and IPv6 packets.
int ipv4_packet(clat_packet out, clat_packet_index pos, const uint8_t *packet, size_t len);