Browse Source

MT#55283 fix UDP hardware checksumming

skb->csum and skb->csum_{start,offset} are actually in a union.

Fix copy/pasto in IPv4 code path.

Change-Id: I84c498f191d1fc22b987da357e068b9e2f615297
(cherry picked from commit e0efaf77b0)
mr12.3
Richard Fuchs 2 years ago
parent
commit
c26ca3c92e
1 changed files with 1 additions and 5 deletions
  1. +1
    -5
      kernel-module/xt_RTPENGINE.c

+ 1
- 5
kernel-module/xt_RTPENGINE.c View File

@ -3980,10 +3980,7 @@ static int send_proxy_packet4(struct sk_buff *skb, struct re_address *src, struc
goto drop; goto drop;
skb->dev = skb_dst(skb)->dev; skb->dev = skb_dst(skb)->dev;
skb->csum_start = skb_transport_header(skb) - skb->head;
skb->csum_offset = offsetof(struct udphdr, check);
if (skb->dev->features & (NETIF_F_HW_CSUM | NETIF_F_IPV6_CSUM)) {
if (skb->dev->features & (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM)) {
skb->ip_summed = CHECKSUM_PARTIAL; skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum = 0; skb->csum = 0;
udp4_hwcsum(skb, ih->saddr, ih->daddr); udp4_hwcsum(skb, ih->saddr, ih->daddr);
@ -4080,7 +4077,6 @@ static int send_proxy_packet6(struct sk_buff *skb, struct re_address *src, struc
if (skb->dev->features & (NETIF_F_HW_CSUM | NETIF_F_IPV6_CSUM)) { if (skb->dev->features & (NETIF_F_HW_CSUM | NETIF_F_IPV6_CSUM)) {
skb->ip_summed = CHECKSUM_PARTIAL; skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum = 0;
uh->check = ~csum_ipv6_magic(&ih->saddr, &ih->daddr, datalen, IPPROTO_UDP, 0); uh->check = ~csum_ipv6_magic(&ih->saddr, &ih->daddr, datalen, IPPROTO_UDP, 0);
} }
else { else {


Loading…
Cancel
Save