diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c16615bfb61edd2a1dae9ef7935a3153d78dc4df..e48e5c02e877d9a9389ea54f0e015ba041d3f2a7 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3099,6 +3099,16 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, * (see validate_xmit_skb_list() for example) */ segs->prev = tail; + + /* Following permits correct backpressure, for protocols + * using skb_set_owner_w(). + * Idea is to tranfert ownership from head_skb to last segment. + */ + if (head_skb->destructor == sock_wfree) { + swap(tail->truesize, head_skb->truesize); + swap(tail->destructor, head_skb->destructor); + swap(tail->sk, head_skb->sk); + } return segs; err: