Commit 52cbd23
udp: fix skb_copy_and_csum_datagram with odd segment sizes
When iteratively computing a checksum with csum_block_add, track the
offset "pos" to correctly rotate in csum_block_add when offset is odd.
The open coded implementation of skb_copy_and_csum_datagram did this.
With the switch to __skb_datagram_iter calling csum_and_copy_to_iter,
pos was reinitialized to 0 on each call.
Bring back the pos by passing it along with the csum to the callback.
Changes v1->v2
- pass csum value, instead of csump pointer (Alexander Duyck)
Link: https://lore.kernel.org/netdev/20210128152353.GB27281@optiplex/
Fixes: 950fcae ("datagram: consolidate datagram copy to iter helpers")
Reported-by: Oliver Graute <oliver.graute@gmail.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20210203192952.1849843-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 1d23a56 commit 52cbd23
3 files changed
+31
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| 600 | + | |
| 601 | + | |
599 | 602 | | |
600 | 603 | | |
601 | | - | |
602 | | - | |
603 | 604 | | |
604 | 605 | | |
605 | 606 | | |
| |||
621 | 622 | | |
622 | 623 | | |
623 | 624 | | |
624 | | - | |
| 625 | + | |
| 626 | + | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| |||
1522 | 1524 | | |
1523 | 1525 | | |
1524 | 1526 | | |
1525 | | - | |
| 1527 | + | |
1526 | 1528 | | |
1527 | 1529 | | |
| 1530 | + | |
1528 | 1531 | | |
1529 | | - | |
1530 | 1532 | | |
1531 | | - | |
| 1533 | + | |
1532 | 1534 | | |
1533 | 1535 | | |
1534 | | - | |
| 1536 | + | |
1535 | 1537 | | |
1536 | | - | |
| 1538 | + | |
| 1539 | + | |
1537 | 1540 | | |
1538 | 1541 | | |
1539 | 1542 | | |
| |||
1561 | 1564 | | |
1562 | 1565 | | |
1563 | 1566 | | |
1564 | | - | |
| 1567 | + | |
| 1568 | + | |
1565 | 1569 | | |
1566 | 1570 | | |
1567 | 1571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| |||
0 commit comments