diff options
| author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2024-04-28 16:00:44 +0900 |
|---|---|---|
| committer | Jason Wang <jasowang@redhat.com> | 2024-06-04 15:14:25 +0800 |
| commit | 52a7ff526964e7810ec1ccc71efbdd60952dd20b (patch) | |
| tree | 8cef0a19baaeade8ecfac931edcbc3c2497c0574 /net/tap.c | |
| parent | 3ab42e46acf867c45bc929fcc37693e327a35a24 (diff) | |
| download | focaccia-qemu-52a7ff526964e7810ec1ccc71efbdd60952dd20b.tar.gz focaccia-qemu-52a7ff526964e7810ec1ccc71efbdd60952dd20b.zip | |
tap: Remove tap_probe_vnet_hdr_len()
It was necessary since an Linux older than 2.6.35 may implement the virtio-net header but may not allow to change its length. Remove it since such an old Linux is no longer supported. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/tap.c')
| -rw-r--r-- | net/tap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/tap.c b/net/tap.c index baaa2f7a9a..72ae95894f 100644 --- a/net/tap.c +++ b/net/tap.c @@ -259,11 +259,7 @@ static bool tap_has_vnet_hdr(NetClientState *nc) static bool tap_has_vnet_hdr_len(NetClientState *nc, int len) { - TAPState *s = DO_UPCAST(TAPState, nc, nc); - - assert(nc->info->type == NET_CLIENT_DRIVER_TAP); - - return !!tap_probe_vnet_hdr_len(s->fd, len); + return tap_has_vnet_hdr(nc); } static int tap_get_vnet_hdr_len(NetClientState *nc) @@ -432,7 +428,7 @@ static TAPState *net_tap_fd_init(NetClientState *peer, * Make sure host header length is set correctly in tap: * it might have been modified by another instance of qemu. */ - if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) { + if (vnet_hdr) { tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len); } tap_read_poll(s, true); |