summaryrefslogtreecommitdiffstats
path: root/ipv6.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 /ipv6.c
parent07fc7614a14f024857fcb4880b308df6e8c297d0 (diff)
downloadplatform_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.tar.gz
platform_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.tar.bz2
platform_external_android-clat-9477a464bd70849bcddcb8d11613cff117235cb0.zip
Fix compiler warnings and enable -Wall -Werror
Change-Id: I24847fa35644d92bff0fe31ccfc5c4b3e8705779
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipv6.c b/ipv6.c
index faf27ad..9eaa6ab 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -42,8 +42,7 @@
* len - size of ip payload
* returns: the highest position in the output clat_packet that's filled in
*/
-int icmp6_packet(clat_packet out, int pos, const struct icmp6_hdr *icmp6, uint32_t checksum,
- size_t len) {
+int icmp6_packet(clat_packet out, int pos, const struct icmp6_hdr *icmp6, size_t len) {
const char *payload;
size_t payload_size;
@@ -55,7 +54,7 @@ int icmp6_packet(clat_packet out, int pos, const struct icmp6_hdr *icmp6, uint32
payload = (const char *) (icmp6 + 1);
payload_size = len - sizeof(struct icmp6_hdr);
- return icmp6_to_icmp(out, pos, icmp6, checksum, payload, payload_size);
+ return icmp6_to_icmp(out, pos, icmp6, payload, payload_size);
}
/* function: log_bad_address
@@ -63,16 +62,18 @@ int icmp6_packet(clat_packet out, int pos, const struct icmp6_hdr *icmp6, uint32
* fmt - printf-style format, use %s to place the address
* badaddr - the bad address in question
*/
-void log_bad_address(const char *fmt, const struct in6_addr *src, const struct in6_addr *dst) {
#if CLAT_DEBUG
+void log_bad_address(const char *fmt, const struct in6_addr *src, const struct in6_addr *dst) {
char srcstr[INET6_ADDRSTRLEN];
char dststr[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, src, srcstr, sizeof(srcstr));
inet_ntop(AF_INET6, dst, dststr, sizeof(dststr));
logmsg_dbg(ANDROID_LOG_ERROR, fmt, srcstr, dststr);
-#endif
}
+#else
+#define log_bad_address(fmt, src, dst)
+#endif
/* function: ipv6_packet
* takes an ipv6 packet and hands it off to the layer 4 protocol function
@@ -137,8 +138,7 @@ int ipv6_packet(clat_packet out, int pos, const char *packet, size_t len) {
// does not support IPv6 extension headers, this will drop any packet with them
if(protocol == IPPROTO_ICMP) {
- iov_len = icmp6_packet(out, pos + 1, (const struct icmp6_hdr *) next_header, checksum,
- len_left);
+ iov_len = icmp6_packet(out, pos + 1, (const struct icmp6_hdr *) next_header, len_left);
} else if(ip6->ip6_nxt == IPPROTO_TCP) {
iov_len = tcp_packet(out, pos + 1, (const struct tcphdr *) next_header, checksum,
len_left);