Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c15c0ab

Browse files
jmberg-inteldavem330
authored andcommitted
ipv6: suppress sparse warnings in IP6_ECN_set_ce()
Pass the correct type __wsum to csum_sub() and csum_add(). This doesn't really change anything since __wsum really *is* __be32, but removes the address space warnings from sparse. Cc: Eric Dumazet <[email protected]> Fixes: 34ae6a1 ("ipv6: update skb->csum when CE mark is propagated") Signed-off-by: Johannes Berg <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0ed661d commit c15c0ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/net/inet_ecn.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
128128
to = from | htonl(INET_ECN_CE << 20);
129129
*(__be32 *)iph = to;
130130
if (skb->ip_summed == CHECKSUM_COMPLETE)
131-
skb->csum = csum_add(csum_sub(skb->csum, from), to);
131+
skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
132+
(__force __wsum)to);
132133
return 1;
133134
}
134135

0 commit comments

Comments
 (0)