]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: Check if nc is NULL in qemu_get_vnet_hdr_len()
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Sat, 17 Aug 2024 07:00:43 +0000 (16:00 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 29 Oct 2024 23:58:53 +0000 (02:58 +0300)
commit6ea3f1f06b09867615b2069edd1c45ea40474cf5
tree14c5ff7e86811d30e67663229f2831636a491c3a
parentc044440a42041ae2de94117dd9d17cfd7d80dfd8
net: Check if nc is NULL in qemu_get_vnet_hdr_len()

A netdev may not have a peer specified, resulting in NULL. We should
make it behave like /dev/null in such a case instead of letting it
cause segmentatin fault.

Fixes: 4b52d63249a5 ("tap: Remove qemu_using_vnet_hdr()")
Cc: qemu-stable@nongnu.org
Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by; Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 76240dd2a37c7b361740616a7d6080beafdb8a71)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
net/net.c