net: fix the IPv4 IHL and VHL define value

Message ID 1573051781-26678-1-git-send-email-flavia.musatescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net: fix the IPv4 IHL and VHL define value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail Compilation issues

Commit Message

Flavia Musatescu Nov. 6, 2019, 2:49 p.m. UTC
  Fix the RTE_IPV4_VHL_DEF macro that represents the value
for the IPv4 VHL and Minimum IHL header fields according to
rfc791.

Fixes: 2318d8d54565 ("net: define IPv4 IHL and VHL")
Cc: salehals@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>
---
 lib/librte_net/rte_ip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Nov. 6, 2019, 5:53 p.m. UTC | #1
On 11/6/2019 2:49 PM, Flavia Musatescu wrote:
> Fix the RTE_IPV4_VHL_DEF macro that represents the value
> for the IPv4 VHL and Minimum IHL header fields according to
> rfc791.
> 
> Fixes: 2318d8d54565 ("net: define IPv4 IHL and VHL")
> Cc: salehals@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>

Reported-by: David Harton <dharton@cisco.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 731ee4f..e3300fd 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -101,7 +101,7 @@  struct rte_ipv4_hdr {
 
 /* IPv4 default fields values */
 #define RTE_IPV4_MIN_IHL    (0x5)
-#define RTE_IPV4_VHL_DEF    (IPVERSION | RTE_IPV4_MIN_IHL)
+#define RTE_IPV4_VHL_DEF    ((IPVERSION << 4) | RTE_IPV4_MIN_IHL)
 
 /**
  * @internal Calculate a sum of all words in the buffer.