mirror of https://gitee.com/openkylin/linux.git
[NETFILTER]: Do not be clever about SKB ownership in ip_ct_gather_frags().
Just do an skb_orphan() and be done with it. Based upon discussions with Herbert Xu on netdev. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d9fa0f392b
commit
8be58932ca
|
@ -940,37 +940,25 @@ void ip_ct_refresh_acct(struct ip_conntrack *ct,
|
||||||
struct sk_buff *
|
struct sk_buff *
|
||||||
ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
|
ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
|
||||||
{
|
{
|
||||||
struct sock *sk = skb->sk;
|
|
||||||
#ifdef CONFIG_NETFILTER_DEBUG
|
#ifdef CONFIG_NETFILTER_DEBUG
|
||||||
unsigned int olddebug = skb->nf_debug;
|
unsigned int olddebug = skb->nf_debug;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sk) {
|
|
||||||
sock_hold(sk);
|
|
||||||
skb_orphan(skb);
|
skb_orphan(skb);
|
||||||
}
|
|
||||||
|
|
||||||
local_bh_disable();
|
local_bh_disable();
|
||||||
skb = ip_defrag(skb, user);
|
skb = ip_defrag(skb, user);
|
||||||
local_bh_enable();
|
local_bh_enable();
|
||||||
|
|
||||||
if (!skb) {
|
if (skb) {
|
||||||
if (sk)
|
|
||||||
sock_put(sk);
|
|
||||||
return skb;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sk) {
|
|
||||||
skb_set_owner_w(skb, sk);
|
|
||||||
sock_put(sk);
|
|
||||||
}
|
|
||||||
|
|
||||||
ip_send_check(skb->nh.iph);
|
ip_send_check(skb->nh.iph);
|
||||||
skb->nfcache |= NFC_ALTERED;
|
skb->nfcache |= NFC_ALTERED;
|
||||||
#ifdef CONFIG_NETFILTER_DEBUG
|
#ifdef CONFIG_NETFILTER_DEBUG
|
||||||
/* Packet path as if nothing had happened. */
|
/* Packet path as if nothing had happened. */
|
||||||
skb->nf_debug = olddebug;
|
skb->nf_debug = olddebug;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return skb;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue