diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2013-11-18 12:59:44 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2013-11-25 18:45:45 +0900 |
commit | c9f4c89da6c76ebc59a0ec1047853a13ce5f5d96 (patch) | |
tree | 9110629c337588c00c67a64b05fa498bd37423bc /ipv6.c | |
parent | 9fe1673c316988d0fb8dd85e9d86642e0ac6d1b4 (diff) | |
download | android_external_android-clat-c9f4c89da6c76ebc59a0ec1047853a13ce5f5d96.tar.gz android_external_android-clat-c9f4c89da6c76ebc59a0ec1047853a13ce5f5d96.tar.bz2 android_external_android-clat-c9f4c89da6c76ebc59a0ec1047853a13ce5f5d96.zip |
Add generic IP packet code and use it for GRE.
Bug: 11542311
Change-Id: I174e0b268869bc77927feeee57003580c47c30f2
Diffstat (limited to 'ipv6.c')
-rw-r--r-- | ipv6.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -137,14 +137,16 @@ int ipv6_packet(clat_packet out, int pos, const char *packet, size_t len) { checksum = ipv4_pseudo_header_checksum(0, ip_targ, len_left); // does not support IPv6 extension headers, this will drop any packet with them - if(protocol == IPPROTO_ICMP) { + if (protocol == IPPROTO_ICMP) { iov_len = icmp6_packet(out, pos + 1, (const struct icmp6_hdr *) next_header, len_left); - } else if(ip6->ip6_nxt == IPPROTO_TCP) { + } else if (ip6->ip6_nxt == IPPROTO_TCP) { iov_len = tcp_packet(out, pos + 1, (const struct tcphdr *) next_header, checksum, len_left); - } else if(ip6->ip6_nxt == IPPROTO_UDP) { + } else if (ip6->ip6_nxt == IPPROTO_UDP) { iov_len = udp_packet(out, pos + 1, (const struct udphdr *) next_header, checksum, len_left); + } else if (ip6->ip6_nxt == IPPROTO_GRE) { + iov_len = generic_packet(out, pos + 1, next_header, len_left); } else { #if CLAT_DEBUG logmsg(ANDROID_LOG_ERROR, "ipv6_packet/unknown next header type: %x", ip6->ip6_nxt); |