diff options
author | Steve Kondik <steve@cyngn.com> | 2016-05-16 00:40:02 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-09-01 00:29:38 -0700 |
commit | 771a11bae461bccb23ee52f269c61c4bbdf4e152 (patch) | |
tree | c268c7d88ebdf6bbcb1d9362eef9d7ae4eec92b8 | |
parent | 243985eafc89e86eb8e2d8574e4ab57f5b14b83a (diff) | |
download | android_external_libnetfilter_conntrack-cm-14.0.tar.gz android_external_libnetfilter_conntrack-cm-14.0.tar.bz2 android_external_libnetfilter_conntrack-cm-14.0.zip |
conntrack: Fix Clang errorslineage-15.0cm-14.1cm-14.0
* error: fields must have a constant size: 'variable length array in
structure' extension will never be supported
Change-Id: Iad4e0452dcf636179227cfadba363a207f2fcb93
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | src/conntrack/api.c | 11 | ||||
-rw-r--r-- | src/expect/api.c | 11 |
3 files changed, 10 insertions, 13 deletions
@@ -68,7 +68,6 @@ LOCAL_CFLAGS += -include $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/linu LOCAL_SHARED_LIBRARIES := $(common_SHARED_LIBRARIES) libnfnetlink LOCAL_MODULE:= libnetfilter_conntrack -LOCAL_CLANG := false include $(BUILD_SHARED_LIBRARY) ### diff --git a/src/conntrack/api.c b/src/conntrack/api.c index 09270ee..439e884 100644 --- a/src/conntrack/api.c +++ b/src/conntrack/api.c @@ -950,20 +950,20 @@ int nfct_parse_conntrack(enum nf_conntrack_msg_type type, * On error, -1 is returned and errno is explicitely set. On success, 0 * is returned. */ +#define QUERY_SIZE 4096 int nfct_query(struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data) { - size_t size = 4096; /* enough for now */ union { - char buffer[size]; + char buffer[QUERY_SIZE]; struct nfnlhdr req; } u; assert(h != NULL); assert(data != NULL); - if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, size) == -1) + if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, QUERY_SIZE) == -1) return -1; return nfnl_query(h->nfnlh, &u.req.nlh); @@ -986,16 +986,15 @@ int nfct_send(struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data) { - size_t size = 4096; /* enough for now */ union { - char buffer[size]; + char buffer[QUERY_SIZE]; struct nfnlhdr req; } u; assert(h != NULL); assert(data != NULL); - if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, size) == -1) + if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, QUERY_SIZE) == -1) return -1; return nfnl_send(h->nfnlh, &u.req.nlh); diff --git a/src/expect/api.c b/src/expect/api.c index a1dbbff..4521f16 100644 --- a/src/expect/api.c +++ b/src/expect/api.c @@ -665,20 +665,20 @@ int nfexp_parse_expect(enum nf_conntrack_msg_type type, * On error, -1 is returned and errno is explicitely set. On success, 0 * is returned. */ +#define QUERY_SIZE 4096 int nfexp_query(struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data) { - size_t size = 4096; /* enough for now */ union { - char buffer[size]; + char buffer[QUERY_SIZE]; struct nfnlhdr req; } u; assert(h != NULL); assert(data != NULL); - if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1) + if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, QUERY_SIZE) == -1) return -1; return nfnl_query(h->nfnlh, &u.req.nlh); @@ -701,16 +701,15 @@ int nfexp_send(struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data) { - size_t size = 4096; /* enough for now */ union { - char buffer[size]; + char buffer[QUERY_SIZE]; struct nfnlhdr req; } u; assert(h != NULL); assert(data != NULL); - if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1) + if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, QUERY_SIZE) == -1) return -1; return nfnl_send(h->nfnlh, &u.req.nlh); |