aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-filter/libnetfilter/files/replace-VLAs-in-union.patch
blob: 16e4af405d14b0306b65f7a22aee1164a277a225 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
VLAs in structs and unions (non-PODs) is unsupported in non-gcc compilers
therefore convert it to not use VLAs instead use fixed arrays

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: libnetfilter_conntrack-1.0.4/src/conntrack/api.c
===================================================================
--- libnetfilter_conntrack-1.0.4.orig/src/conntrack/api.c
+++ libnetfilter_conntrack-1.0.4/src/conntrack/api.c
@@ -954,16 +954,15 @@ 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[4096];
 		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, 4096) == -1)
 		return -1;
 
 	return nfnl_query(h->nfnlh, &u.req.nlh);
@@ -986,16 +985,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[4096];
 		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, 4096) == -1)
 		return -1;
 
 	return nfnl_send(h->nfnlh, &u.req.nlh);
Index: libnetfilter_conntrack-1.0.4/src/expect/api.c
===================================================================
--- libnetfilter_conntrack-1.0.4.orig/src/expect/api.c
+++ libnetfilter_conntrack-1.0.4/src/expect/api.c
@@ -669,16 +669,15 @@ 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[4096];
 		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, 4096) == -1)
 		return -1;
 
 	return nfnl_query(h->nfnlh, &u.req.nlh);
@@ -701,16 +700,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[4096];
 		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, 4096) == -1)
 		return -1;
 
 	return nfnl_send(h->nfnlh, &u.req.nlh);