mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Mayer <andrea.mayer@uniroma2.it>
To: Hangbin Liu <hangbin.liu@linux.dev>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Lebrun <david.lebrun@uclouvain.be>,
	Stefano Salsano <stefano.salsano@uniroma2.it>,
	Andrea Mayer <andrea.mayer@uniroma2.it>
Subject: Re: [PATCH net] seg6: ensure packet data is writable before modifying SRH and IPv6 DA
Date: Wed, 30 Sep 2026 01:39:10 +0200	[thread overview]
Message-ID: <20260930013910.ef20606a1141e83edeee0771@uniroma2.it> (raw)
In-Reply-To: <arsqomcYCLJqtWSC@fedora>

On Tue, 29 Sep 2026 11:05:02 +0800
Hangbin Liu <hangbin.liu@linux.dev> wrote:

> [snip]
>
> >  static int input_action_end_core(struct sk_buff *skb,
> >  				 struct seg6_local_lwt *slwt)
> >  {
> > +	enum skb_drop_reason reason = SKB_DROP_REASON_NOT_SPECIFIED;
> >  	struct ipv6_sr_hdr *srh;
> > +	int err = -EINVAL;
> >  
> >  	srh = get_and_validate_srh(skb);
> >  	if (!srh)
> >  		goto drop;
> >  
> > -	advance_nextseg(srh, &ipv6_hdr(skb)->daddr);
> > +	srh = advance_nextseg(skb, srh, &reason);
> > +	if (!srh) {
> > +		err = -ENOMEM;
> > +		goto drop;
> > +	}
>
> The srh is not used in the later function, maybe just
>
> 	if (!advance_nextseg(skb, srh, &reason)) {
> 		err = -ENOMEM;
> 		goto drop;
> 	}
>
> [snip]

Hi Hangbin,

Right. Since the patch changed advance_nextseg() to return the SRH,
I updated srh at every call site. Your form works as well where srh
is not used afterwards.

Thanks,
Andrea

  reply	other threads:[~2026-09-29 23:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 13:38 Andrea Mayer
2026-09-29  2:30 ` patchwork-bot+netdevbpf
2026-09-29  3:05 ` Hangbin Liu
2026-09-29 23:39   ` Andrea Mayer [this message]
2026-09-30  0:44     ` Hangbin Liu

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=20260930013910.ef20606a1141e83edeee0771@uniroma2.it \
    --to=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=david.lebrun@uclouvain.be \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hangbin.liu@linux.dev \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefano.salsano@uniroma2.it \
    /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

all inboxes | Powered by JetHome®