|
@@ -37,7 +37,6 @@ nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
|
|
|
NF_CT_ASSERT(hooknum == NF_INET_POST_ROUTING);
|
|
NF_CT_ASSERT(hooknum == NF_INET_POST_ROUTING);
|
|
|
|
|
|
|
|
ct = nf_ct_get(skb, &ctinfo);
|
|
ct = nf_ct_get(skb, &ctinfo);
|
|
|
- nat = nfct_nat(ct);
|
|
|
|
|
|
|
|
|
|
NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED ||
|
|
NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED ||
|
|
|
ctinfo == IP_CT_RELATED_REPLY));
|
|
ctinfo == IP_CT_RELATED_REPLY));
|
|
@@ -56,7 +55,9 @@ nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
|
|
|
return NF_DROP;
|
|
return NF_DROP;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- nat->masq_index = out->ifindex;
|
|
|
|
|
|
|
+ nat = nf_ct_nat_ext_add(ct);
|
|
|
|
|
+ if (nat)
|
|
|
|
|
+ nat->masq_index = out->ifindex;
|
|
|
|
|
|
|
|
/* Transfer from original range. */
|
|
/* Transfer from original range. */
|
|
|
memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
|
|
memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
|