mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-20 13:24:00 +00:00
net: skb_orphan() changes
It is illegal to set skb->sk without corresponding destructor. Its therefore safe for skb_orphan() to not clear skb->sk if skb->destructor is not set. Also avoid clearing skb->destructor if already NULL. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f2f872f927
commit
c34a761231
1 changed files with 4 additions and 3 deletions
|
@ -1805,10 +1805,11 @@ static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
|
||||||
*/
|
*/
|
||||||
static inline void skb_orphan(struct sk_buff *skb)
|
static inline void skb_orphan(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
if (skb->destructor)
|
if (skb->destructor) {
|
||||||
skb->destructor(skb);
|
skb->destructor(skb);
|
||||||
skb->destructor = NULL;
|
skb->destructor = NULL;
|
||||||
skb->sk = NULL;
|
skb->sk = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue