aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-10-17 18:21:44 +0000
committerMohsin Kazmi <sykazmi@cisco.com>2022-10-17 18:31:19 +0000
commit19a168496b91b5266908a68f7caa25c83b751923 (patch)
tree2037d9e26b8aba5c44d42c045d61de8da4adce8b /src/vnet/ip
parentf284c14c7bd8731367ba3527cdfffa610a8c6de4 (diff)
ip: fix the pseudo header checksum
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I5eb83cbd0f8534dc50ecb907b3582717e8709aa2
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip_psh_cksum.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/ip/ip_psh_cksum.h b/src/vnet/ip/ip_psh_cksum.h
index 8723749865f..a80211561b7 100644
--- a/src/vnet/ip/ip_psh_cksum.h
+++ b/src/vnet/ip/ip_psh_cksum.h
@@ -38,8 +38,7 @@ ip4_pseudo_header_cksum (ip4_header_t *ip4)
psh.proto = ip4->protocol;
psh.l4len = clib_host_to_net_u16 (clib_net_to_host_u16 (ip4->length) -
sizeof (ip4_header_t));
- return ~clib_net_to_host_u16 (
- clib_ip_csum ((u8 *) &psh, sizeof (ip4_psh_t)));
+ return ~(clib_ip_csum ((u8 *) &psh, sizeof (ip4_psh_t)));
}
static_always_inline u16
@@ -50,8 +49,7 @@ ip6_pseudo_header_cksum (ip6_header_t *ip6)
psh.dst = ip6->dst_address;
psh.l4len = ip6->payload_length;
psh.proto = clib_host_to_net_u32 ((u32) ip6->protocol);
- return ~clib_net_to_host_u16 (
- clib_ip_csum ((u8 *) &psh, sizeof (ip6_psh_t)));
+ return ~(clib_ip_csum ((u8 *) &psh, sizeof (ip6_psh_t)));
}
#endif /* included_ip_psh_cksum_h */