aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Mok <kmok@cyngn.com>2015-11-11 16:28:26 -0800
committerKeith Mok <kmok@cyngn.com>2015-11-11 16:28:26 -0800
commit484024be0704ff670076d6b9f0e1b04865c6c7e2 (patch)
tree72ff2995dd8edb13a9a6707917f1ccdf5c1c7edf
parent3d35db80e12107a9ab6e3eaadd47959d87e1bda3 (diff)
downloadandroid_external_libnetfilter_conntrack-stable/cm-13.0-ZNH0E.tar.gz
android_external_libnetfilter_conntrack-stable/cm-13.0-ZNH0E.tar.bz2
android_external_libnetfilter_conntrack-stable/cm-13.0-ZNH0E.zip
Fix warning implicit declaration of function __fswab64 That warning is treated as error. Change-Id: I1e13e6b759e9c21caf4b7ce107b7e9f1bcf3449a
-rw-r--r--Android.mk6
-rw-r--r--src/conntrack/build.c6
-rw-r--r--src/conntrack/parse.c11
3 files changed, 11 insertions, 12 deletions
diff --git a/Android.mk b/Android.mk
index a545d6c..fa2bd67 100644
--- a/Android.mk
+++ b/Android.mk
@@ -45,7 +45,7 @@ common_C_INCLUDES += \
#
#LOCAL_SRC_FILES := $(common_SRC_FILES)
#LOCAL_C_INCLUDES := $(common_C_INCLUDES)
-#LOCAL_C_INCLUDES += external/libnetfilter_conntrack/libmnl/libmnl.h
+#LOCAL_C_INCLUDES += external/libnetfilter_conntrack
#LOCAL_C_INCLUDES += external/libnfnetlink/include
#LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
#
@@ -60,7 +60,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_C_INCLUDES := $(common_C_INCLUDES)
-LOCAL_C_INCLUDES += external/libnetfilter_conntrack/libmnl/libmnl.h
+LOCAL_C_INCLUDES += external/libnetfilter_conntrack
LOCAL_C_INCLUDES += external/libnfnetlink/include
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
LOCAL_SHARED_LIBRARIES := $(common_SHARED_LIBRARIES) libnfnetlink
@@ -75,7 +75,7 @@ include $(BUILD_SHARED_LIBRARY)
### include $(CLEAR_VARS)
### LOCAL_SRC_FILES := $(common_SRC_FILES)
### LOCAL_C_INCLUDES := $(common_C_INCLUDES)
-### LOCAL_C_INCLUDES += external/libnetfilter_conntrack/libmnl/libmnl.h
+### LOCAL_C_INCLUDES += external/libnetfilter_conntrack
### LOCAL_C_INCLUDES += external/libnfnetlink/include
### LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
### LOCAL_MODULE:= libnetfilter_conntrack
diff --git a/src/conntrack/build.c b/src/conntrack/build.c
index 4852536..2147a3e 100644
--- a/src/conntrack/build.c
+++ b/src/conntrack/build.c
@@ -8,6 +8,7 @@
*/
#include "internal/internal.h"
+#include <endian.h>
static void __build_tuple_ip(struct nfnlhdr *req,
size_t size,
@@ -197,11 +198,8 @@ static void __build_protoinfo(struct nfnlhdr *req, size_t size,
&ct->protoinfo.dccp.role,
sizeof(u_int8_t));
if (test_bit(ATTR_DCCP_HANDSHAKE_SEQ, ct->head.set)) {
- /* FIXME: use __cpu_to_be64() instead which is the
- * correct operation. This is a semantic abuse but
- * we have no function to do it in libnfnetlink. */
u_int64_t handshake_seq =
- __be64_to_cpu(ct->protoinfo.dccp.handshake_seq);
+ htobe64(ct->protoinfo.dccp.handshake_seq);
nfnl_addattr_l(&req->nlh, size,
CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ,
diff --git a/src/conntrack/parse.c b/src/conntrack/parse.c
index c003744..686d6ae 100644
--- a/src/conntrack/parse.c
+++ b/src/conntrack/parse.c
@@ -10,6 +10,7 @@
#include "internal/internal.h"
#include <limits.h>
#include <libmnl/libmnl.h>
+#include <endian.h>
static void __parse_ip(const struct nfattr *attr,
struct __nfct_tuple *tuple,
@@ -284,7 +285,7 @@ static void __parse_protoinfo_dccp(const struct nfattr *attr,
memcpy(&tmp,
NFA_DATA(tb[CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ-1]),
sizeof(tmp));
- ct->protoinfo.dccp.handshake_seq = __be64_to_cpu(tmp);
+ ct->protoinfo.dccp.handshake_seq = be64toh(tmp);
set_bit(ATTR_DCCP_HANDSHAKE_SEQ, ct->head.set);
}
}
@@ -325,7 +326,7 @@ static void __parse_counters(const struct nfattr *attr,
memcpy(&tmp,
NFA_DATA(tb[CTA_COUNTERS_PACKETS-1]),
sizeof(tmp));
- ct->counters[dir].packets = __be64_to_cpu(tmp);
+ ct->counters[dir].packets = be64toh(tmp);
}
switch(dir) {
@@ -349,7 +350,7 @@ static void __parse_counters(const struct nfattr *attr,
memcpy(&tmp,
NFA_DATA(tb[CTA_COUNTERS_BYTES-1]),
sizeof(tmp));
- ct->counters[dir].bytes = __be64_to_cpu(tmp);
+ ct->counters[dir].bytes = be64toh(tmp);
}
switch(dir) {
@@ -466,13 +467,13 @@ __parse_timestamp(const struct nfattr *attr, struct nf_conntrack *ct)
if (tb[CTA_TIMESTAMP_START-1]) {
u_int64_t tmp;
memcpy(&tmp, NFA_DATA(tb[CTA_TIMESTAMP_START-1]), sizeof(tmp));
- ct->timestamp.start = __be64_to_cpu(tmp);
+ ct->timestamp.start = be64toh(tmp);
set_bit(ATTR_TIMESTAMP_START, ct->head.set);
}
if (tb[CTA_TIMESTAMP_STOP-1]) {
u_int64_t tmp;
memcpy(&tmp, NFA_DATA(tb[CTA_TIMESTAMP_STOP-1]), sizeof(tmp));
- ct->timestamp.stop = __be64_to_cpu(tmp);
+ ct->timestamp.stop = be64toh(tmp);
set_bit(ATTR_TIMESTAMP_STOP, ct->head.set);
}
}