提交 db83d136 编写于 作者: M Manfred Rudigier 提交者: David S. Miller

gianfar: Fix missing sock reference when processing TX time stamps

When there is not enough headroom in the skb a private copy will be made.
However, the private copy had no reference to the socket and consequently
no time stamp could be queued on the socket error queue during the
skb_tstamp_tx function. This patch fixes this issue by also stealing the
sock reference from the original skb after making the private copy.
Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eb8a54a7
...@@ -2086,6 +2086,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2086,6 +2086,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
/* Steal sock reference for processing TX time stamps */
swap(skb_new->sk, skb->sk);
swap(skb_new->destructor, skb->destructor);
kfree_skb(skb); kfree_skb(skb);
skb = skb_new; skb = skb_new;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册