Merge branch 'net-fix-the-features-flag-in-sctp_gso_segment'
Xin Long says: ==================== net: fix the features flag in sctp_gso_segment Patch 1/2 is to improve the code in skb_segment(), and it is needed by Patch 2/2. ==================== Link: https://lore.kernel.org/r/cover.1610703289.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
213b97b125
|
@ -3894,12 +3894,8 @@ normal:
|
||||||
}
|
}
|
||||||
|
|
||||||
hsize = skb_headlen(head_skb) - offset;
|
hsize = skb_headlen(head_skb) - offset;
|
||||||
if (hsize < 0)
|
|
||||||
hsize = 0;
|
|
||||||
if (hsize > len || !sg)
|
|
||||||
hsize = len;
|
|
||||||
|
|
||||||
if (!hsize && i >= nfrags && skb_headlen(list_skb) &&
|
if (hsize <= 0 && i >= nfrags && skb_headlen(list_skb) &&
|
||||||
(skb_headlen(list_skb) == len || sg)) {
|
(skb_headlen(list_skb) == len || sg)) {
|
||||||
BUG_ON(skb_headlen(list_skb) > len);
|
BUG_ON(skb_headlen(list_skb) > len);
|
||||||
|
|
||||||
|
@ -3942,6 +3938,11 @@ normal:
|
||||||
skb_release_head_state(nskb);
|
skb_release_head_state(nskb);
|
||||||
__skb_push(nskb, doffset);
|
__skb_push(nskb, doffset);
|
||||||
} else {
|
} else {
|
||||||
|
if (hsize > len || !sg)
|
||||||
|
hsize = len;
|
||||||
|
else if (hsize < 0)
|
||||||
|
hsize = 0;
|
||||||
|
|
||||||
nskb = __alloc_skb(hsize + doffset + headroom,
|
nskb = __alloc_skb(hsize + doffset + headroom,
|
||||||
GFP_ATOMIC, skb_alloc_rx_flag(head_skb),
|
GFP_ATOMIC, skb_alloc_rx_flag(head_skb),
|
||||||
NUMA_NO_NODE);
|
NUMA_NO_NODE);
|
||||||
|
|
|
@ -68,7 +68,7 @@ static struct sk_buff *sctp_gso_segment(struct sk_buff *skb,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
segs = skb_segment(skb, features | NETIF_F_HW_CSUM | NETIF_F_SG);
|
segs = skb_segment(skb, (features | NETIF_F_HW_CSUM) & ~NETIF_F_SG);
|
||||||
if (IS_ERR(segs))
|
if (IS_ERR(segs))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue