Skip to content

Commit b4263cc

Browse files
angus19ayourtch
authored andcommitted
"Fix build failures observed so far" - take two.
1 parent de595b4 commit b4263cc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

nat46/modules/nat46-core.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
*
1717
*/
1818

19+
#include <linux/version.h>
1920
#include <net/route.h>
21+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0)
22+
#include <net/ipv6.h>
23+
#else
2024
#include <net/ipv6_frag.h>
21-
#include <linux/version.h>
25+
#endif
2226
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
2327
#include <net/netfilter/nf_conntrack.h>
2428
#endif
@@ -282,7 +286,11 @@ int nat46_get_config(nat46_instance_t *nat46, char *buf, int count) {
282286
* value if 'skb' is freed.
283287
*/
284288
static int try_reassembly(struct sk_buff *old_skb) {
289+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
285290
u16 zone_id = NF_CT_DEFAULT_ZONE_ID;
291+
#else
292+
u16 zone_id = NF_CT_DEFAULT_ZONE;
293+
#endif
286294
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
287295
struct net *net = dev_net(old_skb->dev);
288296
#else
@@ -291,11 +299,19 @@ static int try_reassembly(struct sk_buff *old_skb) {
291299
int err;
292300

293301
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
302+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
294303
if (skb_nfct(old_skb)) {
304+
#else
305+
if (old_skb->nfct) {
306+
#endif
307+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
295308
enum ip_conntrack_info ctinfo;
296309
const struct nf_conn *ct = nf_ct_get(old_skb, &ctinfo);
297310

298311
zone_id = nf_ct_zone_id(nf_ct_zone(ct), CTINFO2DIR(ctinfo));
312+
#else
313+
zone_id = nf_ct_zone((struct nf_conn *)old_skb->nfct);
314+
#endif
299315
}
300316
#endif
301317

0 commit comments

Comments
 (0)