Use xdp_get_frame_len helper to ensure xdp frame size is calculated
correctly in both single buffer and multi buffer configurations.

Signed-off-by: Jon Kohler <j...@nutanix.com>
---
 drivers/vhost/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 7cbfc7d718b3..ff2fcb019900 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -199,7 +199,7 @@ static int vhost_net_buf_peek_len(void *ptr)
        if (tun_is_xdp_frame(ptr)) {
                struct xdp_frame *xdpf = tun_ptr_to_xdp(ptr);
 
-               return xdpf->len;
+               return xdp_get_frame_len(xdpf);
        }
 
        return __skb_array_len_with_tag(ptr);
-- 
2.43.0


Reply via email to