summaryrefslogtreecommitdiffstats
path: root/translate.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-11-18 15:56:02 +0900
committerLorenzo Colitti <lorenzo@google.com>2013-11-18 16:07:45 +0900
commit9477a464bd70849bcddcb8d11613cff117235cb0 (patch)
tree087a8bda1163867ed35f99d4bf8ec15e1c23237e /translate.c
parent07fc7614a14f024857fcb4880b308df6e8c297d0 (diff)
downloadandroid_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.tar.gz
android_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.tar.bz2
android_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.zip
Fix compiler warnings and enable -Wall -Werror
Change-Id: I24847fa35644d92bff0fe31ccfc5c4b3e8705779
Diffstat (limited to 'translate.c')
-rw-r--r--translate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/translate.c b/translate.c
index fc70f3d..75ad08a 100644
--- a/translate.c
+++ b/translate.c
@@ -149,7 +149,7 @@ void fill_ip_header(struct iphdr *ip, uint16_t payload_len, uint8_t protocol,
// Third-party ICMPv6 message. This may have been originated by an native IPv6 address.
// In that case, the source IPv6 address can't be translated and we need to make up an IPv4
// source address. For now, use 255.0.0.<ttl>, which at least looks useful in traceroute.
- if (ip->saddr == (uint32_t) INADDR_NONE) {
+ if ((uint32_t) ip->saddr == INADDR_NONE) {
ttl_guess = icmp_guess_ttl(old_header->ip6_hlim);
ip->saddr = htonl((0xff << 24) + ttl_guess);
}
@@ -236,12 +236,11 @@ int icmp_to_icmp6(clat_packet out, int pos, const struct icmphdr *icmp, uint32_t
* translate ipv6 icmp to ipv4 icmp
* out - output packet
* icmp6 - source packet icmp6 header
- * checksum - pseudo-header checksum (unused)
* payload - icmp6 payload
* payload_size - size of payload
* returns: the highest position in the output clat_packet that's filled in
*/
-int icmp6_to_icmp(clat_packet out, int pos, const struct icmp6_hdr *icmp6, uint32_t checksum,
+int icmp6_to_icmp(clat_packet out, int pos, const struct icmp6_hdr *icmp6,
const char *payload, size_t payload_size) {
struct icmphdr *icmp_targ = out[pos].iov_base;
uint8_t icmp_type;