netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Xie He <xie.he.0141@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	syzbot <syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com>,
	William Tu <u9012063@gmail.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Subject: Re: [Patch net v2] ip_gre: set dev->hard_header_len and dev->needed_headroom properly
Date: Mon, 12 Oct 2020 15:26:41 -0700	[thread overview]
Message-ID: <CAM_iQpVv+OKb4483TOvdVrVXonLOvw9NAw=WApU5MnHmMdHz7Q@mail.gmail.com> (raw)
In-Reply-To: <CAJht_ENA9cfnU2bpjgFDZN=4QPwEJBs_59h_AoH5Sk=BasgZ4g@mail.gmail.com>

On Sun, Oct 11, 2020 at 3:46 PM Xie He <xie.he.0141@gmail.com> wrote:
>
> On Sun, Oct 11, 2020 at 12:11 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >
> > @@ -626,8 +626,7 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
> >
> >         if (dev->header_ops) {
> >                 /* Need space for new headers */
> > -               if (skb_cow_head(skb, dev->needed_headroom -
> > -                                     (tunnel->hlen + sizeof(struct iphdr))))
> > +               if (skb_cow_head(skb, dev->hard_header_len))
> >                         goto free_skb;
> >
> >                 tnl_params = (const struct iphdr *)skb->data;
>
> As I understand, the skb_cow functions are for ensuring enough header
> space before skb->data. (Right?) However, at this stage our skb->data
> is already at the outer IP header, I think we don't need to request
> additional header space before the outer IP header.

Good point, I thought skb_headroom() == dev->hard_header_len,
but skb->data already points to the tunnel header like you said, so
we should pass 0 to skb_cow_head() here.

Thanks.

      reply	other threads:[~2020-10-12 22:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 19:11 [Patch net v2] ip_gre: set dev->hard_header_len and dev->needed_headroom properly Cong Wang
2020-10-11 20:32 ` Xie He
2020-10-11 21:06   ` Willem de Bruijn
2020-10-11 21:50     ` Xie He
2020-10-11 21:00 ` Willem de Bruijn
2020-10-11 21:25   ` Willem de Bruijn
2020-10-11 22:03   ` Xie He
2020-10-14  8:51   ` Xie He
2020-10-14 15:12     ` Willem de Bruijn
2020-10-14 19:47       ` Xie He
2020-10-14 20:19         ` Willem de Bruijn
2020-10-15  1:38           ` Xie He
2020-10-15  2:24             ` Xie He
2020-10-15 13:42               ` Willem de Bruijn
2020-10-15 19:19                 ` Xie He
2020-10-15 19:56                   ` Willem de Bruijn
2020-10-11 22:45 ` Xie He
2020-10-12 22:26   ` Cong Wang [this message]

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='CAM_iQpVv+OKb4483TOvdVrVXonLOvw9NAw=WApU5MnHmMdHz7Q@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com \
    --cc=u9012063@gmail.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xie.he.0141@gmail.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).