From 69ff5ef8474575556997dbe7f7f9bd28c4aee5de Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 23 Feb 2023 19:20:17 +0900 Subject: net/eth: Report if headers are actually present The values returned by eth_get_protocols() are used to perform RSS, checksumming and segmentation. Even when a packet signals the use of the protocols which these operations can be applied to, the headers for them may not be present because of too short packet or fragmentation, for example. In such a case, the operations cannot be applied safely. Report the presence of headers instead of whether the use of the protocols are indicated with eth_get_protocols(). This also makes corresponding changes to the callers of eth_get_protocols() to match with its new signature and to remove redundant checks for fragmentation. Fixes: 75020a7021 ("Common definitions for VMWARE devices") Signed-off-by: Akihiko Odaki Signed-off-by: Jason Wang --- include/net/eth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/net/eth.h b/include/net/eth.h index 2b4374fae4..fbac30cf60 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -391,8 +391,8 @@ typedef struct eth_l4_hdr_info_st { } eth_l4_hdr_info; void eth_get_protocols(const struct iovec *iov, int iovcnt, - bool *isip4, bool *isip6, - bool *isudp, bool *istcp, + bool *hasip4, bool *hasip6, + bool *hasudp, bool *hastcp, size_t *l3hdr_off, size_t *l4hdr_off, size_t *l5hdr_off, -- cgit v1.2.3