* [PATCH] net: udp: remove the redundant assignment
@ 2020-05-29 11:23 Wang Li
2020-05-29 11:32 ` Joe Perches
2020-05-29 20:08 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Wang Li @ 2020-05-29 11:23 UTC (permalink / raw)
To: netdev; +Cc: Wang Li
Signed-off-by: Wang Li <wangli09@kuaishou.com>
---
net/ipv4/udp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 32564b350823..54db5182c884 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -798,7 +798,6 @@ void udp_set_csum(bool nocheck, struct sk_buff *skb,
} else if (skb_is_gso(skb)) {
uh->check = ~udp_v4_check(len, saddr, daddr, 0);
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
- uh->check = 0;
uh->check = udp_v4_check(len, saddr, daddr, lco_csum(skb));
if (uh->check == 0)
uh->check = CSUM_MANGLED_0;
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: udp: remove the redundant assignment
2020-05-29 11:23 [PATCH] net: udp: remove the redundant assignment Wang Li
@ 2020-05-29 11:32 ` Joe Perches
2020-05-29 20:08 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2020-05-29 11:32 UTC (permalink / raw)
To: Wang Li, netdev; +Cc: Wang Li
On Fri, 2020-05-29 at 19:23 +0800, Wang Li wrote:
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
[]
> @@ -798,7 +798,6 @@ void udp_set_csum(bool nocheck, struct sk_buff *skb,
> } else if (skb_is_gso(skb)) {
> uh->check = ~udp_v4_check(len, saddr, daddr, 0);
> } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
> - uh->check = 0;
> uh->check = udp_v4_check(len, saddr, daddr, lco_csum(skb));
Why do you think this is redundant?
Where does uh point? (struct udphdr *uh = udp_hdr(skb);)
What is lco_csum(skb) doing?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: udp: remove the redundant assignment
2020-05-29 11:23 [PATCH] net: udp: remove the redundant assignment Wang Li
2020-05-29 11:32 ` Joe Perches
@ 2020-05-29 20:08 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-05-29 20:08 UTC (permalink / raw)
To: wangli8850; +Cc: netdev, wangli09
From: Wang Li <wangli8850@gmail.com>
Date: Fri, 29 May 2020 19:23:21 +0800
> Signed-off-by: Wang Li <wangli09@kuaishou.com>
uh->check is read by the lco_csum() call, this assignment is not
redundant at all.
Please put more care into your changes.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-29 20:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 11:23 [PATCH] net: udp: remove the redundant assignment Wang Li
2020-05-29 11:32 ` Joe Perches
2020-05-29 20:08 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.