diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2023-05-23 11:42:58 +0900 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2023-05-23 15:20:15 +0800 |
commit | 2f0fa232b8c330df029120a6824c8be3d4eb5cae (patch) | |
tree | 072462baff849b057cf4521ad724edee2f8de6ae /include/net/eth.h | |
parent | f0b1df5c4502b5ec89f83417924935ab201511d0 (diff) | |
download | qemu-2f0fa232b8c330df029120a6824c8be3d4eb5cae.zip qemu-2f0fa232b8c330df029120a6824c8be3d4eb5cae.tar.gz qemu-2f0fa232b8c330df029120a6824c8be3d4eb5cae.tar.bz2 |
net/net_rx_pkt: Use iovec for net_rx_pkt_set_protocols()
igb does not properly ensure the buffer passed to
net_rx_pkt_set_protocols() is contiguous for the entire L2/L3/L4 header.
Allow it to pass scattered data to net_rx_pkt_set_protocols().
Fixes: 3a977deebe ("Intrdocue igb device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net/eth.h')
-rw-r--r-- | include/net/eth.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/eth.h b/include/net/eth.h index c5ae449..9f19c3a 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -312,10 +312,10 @@ eth_get_l2_hdr_length(const void *p) } static inline uint32_t -eth_get_l2_hdr_length_iov(const struct iovec *iov, int iovcnt) +eth_get_l2_hdr_length_iov(const struct iovec *iov, size_t iovcnt, size_t iovoff) { uint8_t p[sizeof(struct eth_header) + sizeof(struct vlan_header)]; - size_t copied = iov_to_buf(iov, iovcnt, 0, p, ARRAY_SIZE(p)); + size_t copied = iov_to_buf(iov, iovcnt, iovoff, p, ARRAY_SIZE(p)); if (copied < ARRAY_SIZE(p)) { return copied; @@ -397,7 +397,7 @@ typedef struct eth_l4_hdr_info_st { bool has_tcp_data; } eth_l4_hdr_info; -void eth_get_protocols(const struct iovec *iov, int iovcnt, +void eth_get_protocols(const struct iovec *iov, size_t iovcnt, size_t iovoff, bool *hasip4, bool *hasip6, size_t *l3hdr_off, size_t *l4hdr_off, |