Advertisement
teknoraver

better htons

Oct 7th, 2019
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.73 KB | None | 0 0
  1. ASM: https://godbolt.org/z/uVMv1M
  2.  
  3. --- drivers/net/ethernet/broadcom/genet/bcmgenet.c
  4. +++ drivers/net/ethernet/broadcom/genet/bcmgenet.c
  5. @@ -1483,12 +1507,12 @@
  6.         status = (struct status_64 *)skb->data;
  7.  
  8.         if (skb->ip_summed  == CHECKSUM_PARTIAL) {
  9. -               ip_ver = htons(skb->protocol);
  10. +               ip_ver = skb->protocol;
  11.                 switch (ip_ver) {
  12. -               case ETH_P_IP:
  13. +               case htons(ETH_P_IP):
  14.                         ip_proto = ip_hdr(skb)->protocol;
  15.                         break;
  16. -               case ETH_P_IPV6:
  17. +               case htons(ETH_P_IPV6):
  18.                         ip_proto = ipv6_hdr(skb)->nexthdr;
  19.                         break;
  20.                 default:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement