On Sat, Aug 17, 2024 at 04:00:43PM +0900, Akihiko Odaki wrote:
> 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.

segmentation

> 
> Fixes: 4b52d63249a5 ("tap: Remove qemu_using_vnet_hdr()")
> Reported-by: Jonathan Cameron <jonathan.came...@huawei.com>
> Signed-off-by: Akihiko Odaki <akihiko.od...@daynix.com>


Acked-by: Michael S. Tsirkin <m...@redhat.com>

Jason, you tree?

> ---
>  net/net.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/net.c b/net/net.c
> index 6938da05e077..4c21d91f9450 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -542,6 +542,10 @@ void qemu_set_offload(NetClientState *nc, int csum, int 
> tso4, int tso6,
>  
>  int qemu_get_vnet_hdr_len(NetClientState *nc)
>  {
> +    if (!nc) {
> +        return 0;
> +    }
> +
>      return nc->vnet_hdr_len;
>  }
>  
> 
> ---
> base-commit: 31669121a01a14732f57c49400bc239cf9fd505f
> change-id: 20240817-net-dc461895a295
> 
> Best regards,
> -- 
> Akihiko Odaki <akihiko.od...@daynix.com>


Reply via email to