16
16
*
17
17
*/
18
18
19
+ #include <linux/version.h>
19
20
#include <net/route.h>
21
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (4 ,19 ,0 )
22
+ #include <net/ipv6.h>
23
+ #else
20
24
#include <net/ipv6_frag.h>
21
- #include <linux/version.h>
25
+ #endif
22
26
#if IS_ENABLED (CONFIG_NF_CONNTRACK )
23
27
#include <net/netfilter/nf_conntrack.h>
24
28
#endif
@@ -282,7 +286,11 @@ int nat46_get_config(nat46_instance_t *nat46, char *buf, int count) {
282
286
* value if 'skb' is freed.
283
287
*/
284
288
static int try_reassembly (struct sk_buff * old_skb ) {
289
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,3 ,0 )
285
290
u16 zone_id = NF_CT_DEFAULT_ZONE_ID ;
291
+ #else
292
+ u16 zone_id = NF_CT_DEFAULT_ZONE ;
293
+ #endif
286
294
#if LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,4 ,0 )
287
295
struct net * net = dev_net (old_skb -> dev );
288
296
#else
@@ -291,11 +299,19 @@ static int try_reassembly(struct sk_buff *old_skb) {
291
299
int err ;
292
300
293
301
#if IS_ENABLED (CONFIG_NF_CONNTRACK )
302
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,11 ,0 )
294
303
if (skb_nfct (old_skb )) {
304
+ #else
305
+ if (old_skb -> nfct ) {
306
+ #endif
307
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 ,3 ,0 )
295
308
enum ip_conntrack_info ctinfo ;
296
309
const struct nf_conn * ct = nf_ct_get (old_skb , & ctinfo );
297
310
298
311
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
299
315
}
300
316
#endif
301
317
0 commit comments