qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Luigi Rizzo <rizzo@iet.unipi.it>,
	Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
	Vincenzo Maffione <v.maffione@gmail.com>,
	"Andrew Melnychenko" <andrew@daynix.com>,
	Yuri Benditovich <yuri.benditovich@daynix.com>,
	<qemu-devel@nongnu.org>
Subject: Re: [PATCH] net: Check if nc is NULL in qemu_get_vnet_hdr_len()
Date: Thu, 10 Oct 2024 17:36:52 +0100	[thread overview]
Message-ID: <20241010173652.0000691f@huawei.com> (raw)
In-Reply-To: <20240817-net-v1-1-699b5591ad3b@daynix.com>

On Sat, 17 Aug 2024 16:00:43 +0900
Akihiko Odaki <akihiko.odaki@daynix.com> 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.
> 
> Fixes: 4b52d63249a5 ("tap: Remove qemu_using_vnet_hdr()")
> Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>

FWIW fixed my issue. I'd forgotten about but noticed that
it was still in my tree after a rebase.

Tested-by; Jonathan Cameron <Jonathan.Cameron@huawei.com>


> ---
>  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,



  reply	other threads:[~2024-10-10 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-17  7:00 [PATCH] net: Check if nc is NULL in qemu_get_vnet_hdr_len() Akihiko Odaki
2024-10-10 16:36 ` Jonathan Cameron via [this message]
2024-10-11  5:55 ` Michael S. Tsirkin
2024-10-18  8:11   ` Jason Wang
2024-10-18 18:34 ` Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241010173652.0000691f@huawei.com \
    --to=qemu-devel@nongnu.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=andrew@daynix.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=g.lettieri@iet.unipi.it \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=rizzo@iet.unipi.it \
    --cc=sriram.yagnaraman@ericsson.com \
    --cc=v.maffione@gmail.com \
    --cc=yuri.benditovich@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).