net: explicit cast of protocol in IPv6 checksum
GCC 8.1 warned: In function 'rte_ipv6_phdr_cksum': rte_ip.h:378:18: warning: conversion to 'uint32_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] psd_hdr.proto = (ipv6_hdr->proto << 24); Fixes: 6006818cfb26 ("net: new checksum functions") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
466de6d5d8
commit
8bf255bb38
@ -375,7 +375,7 @@ rte_ipv6_phdr_cksum(const struct ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
|
||||
uint32_t proto; /* L4 protocol - top 3 bytes must be zero */
|
||||
} psd_hdr;
|
||||
|
||||
psd_hdr.proto = (ipv6_hdr->proto << 24);
|
||||
psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
|
||||
if (ol_flags & PKT_TX_TCP_SEG) {
|
||||
psd_hdr.len = 0;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user