aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-02-23 19:20:17 +0900
committerJason Wang <jasowang@redhat.com>2023-03-10 15:35:38 +0800
commit69ff5ef8474575556997dbe7f7f9bd28c4aee5de (patch)
treecd4749e26ddd2b791574e4e3d2a21e8d2d50b570 /include/net
parent47399506dcda52b03b6991c57ca2a426ba8e291f (diff)
downloadqemu-69ff5ef8474575556997dbe7f7f9bd28c4aee5de.zip
qemu-69ff5ef8474575556997dbe7f7f9bd28c4aee5de.tar.gz
qemu-69ff5ef8474575556997dbe7f7f9bd28c4aee5de.tar.bz2
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 <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/eth.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/eth.h b/include/net/eth.h
index 2b4374f..fbac30c 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,