Thread (10 messages) 10 messages, 4 authors, 2024-08-05

Re: [PATCH] net: ethernet: use ip_hdrlen() instead of bit shift

From: Moon Yeounsu <hidden>
Date: 2024-08-03 01:21:34
Also in: lkml

On Fri, Aug 2, 2024 at 10:35 PM Christophe JAILLET
[off-list ref] wrote:
The extra () around "ip_hdrlen(skb)" can be remove.
Also maybe the ones around "ETH_HLEN + ip_hdrlen(skb)" could also be
removed.
Okay, I'll send the next patch which the parenthesis are removed!
But... The parenthesis around `ETH_HLEN + ip_hdrlen(skb) +
sizeof(struct udphdr)`
should be retained, because it makes a clear boundary.
quoted
              skb_reset_network_header(skb);
              return csum;
      }
-     skb_set_transport_header(skb,
-                     ETH_HLEN + (ip_hdr(skb)->ihl << 2));
+     skb_set_transport_header(skb, ETH_HLEN + (ip_hdrlen(skb)));
Same here, the extra () around "ip_hdrlen(skb)" can be remove.
I'll remove it also.
CJ
quoted
      csum = udp_hdr(skb)->check;
      skb_reset_transport_header(skb);
      skb_reset_network_header(skb);
Thank you for reviewing ^오^
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help