[NETFILTER]: Keep conntrack reference until IPsec policy checks are done
Keep the conntrack reference until policy checks have been performed for IPsec NAT support. The reference needs to be dropped before a packet is queued to avoid having the conntrack module unloadable. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5c901daaea
commit
b59c270104
@@ -185,7 +185,6 @@ int ip_call_ra_chain(struct sk_buff *skb)
|
||||
raw_rcv(last, skb2);
|
||||
}
|
||||
last = sk;
|
||||
nf_reset(skb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,10 +203,6 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
|
||||
|
||||
__skb_pull(skb, ihl);
|
||||
|
||||
/* Free reference early: we don't need it any more, and it may
|
||||
hold ip_conntrack module loaded indefinitely. */
|
||||
nf_reset(skb);
|
||||
|
||||
/* Point into the IP datagram, just past the header. */
|
||||
skb->h.raw = skb->data;
|
||||
|
||||
@@ -232,10 +227,12 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
|
||||
if ((ipprot = rcu_dereference(inet_protos[hash])) != NULL) {
|
||||
int ret;
|
||||
|
||||
if (!ipprot->no_policy &&
|
||||
!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
|
||||
kfree_skb(skb);
|
||||
goto out;
|
||||
if (!ipprot->no_policy) {
|
||||
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
|
||||
kfree_skb(skb);
|
||||
goto out;
|
||||
}
|
||||
nf_reset(skb);
|
||||
}
|
||||
ret = ipprot->handler(skb);
|
||||
if (ret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user