netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guodeqing (A)" <geffrey.guo@huawei.com>
To: Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Mahesh Bandewar <maheshb@google.com>,
	netdev <netdev@vger.kernel.org>
Subject: 答复: [PATCH,v2] ipvlan: add the check of ip header checksum
Date: Thu, 23 Jul 2020 02:02:25 +0000	[thread overview]
Message-ID: <5cb165d14bf146e38a11afe1c2ebfcab@huawei.com> (raw)
In-Reply-To: <CANn89iKKSOFSvtoFamuG1S1e5qb_WNpEdFgtQ-UtgkfWa0-WxA@mail.gmail.com>

Because ipvlan will do the ip forward, it will do a route lookup.if the ihl of the ip header is smaller than 5, this cause ip_fast_csum access the illegal address.

-----邮件原件-----
发件人: Eric Dumazet [mailto:edumazet@google.com] 
发送时间: Thursday, July 23, 2020 0:30
收件人: Guodeqing (A) <geffrey.guo@huawei.com>
抄送: David Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Mahesh Bandewar <maheshb@google.com>; netdev <netdev@vger.kernel.org>
主题: Re: [PATCH,v2] ipvlan: add the check of ip header checksum

On Wed, Jul 22, 2020 at 2:23 AM guodeqing <geffrey.guo@huawei.com> wrote:
>
> The ip header checksum can be error in the following steps.
> $ ip netns add ns1
> $ ip link add gw link eth0 type ipvlan $ ip addr add 168.16.0.1/24 dev 
> gw $ ip link set dev gw up $ ip link add ip1 link eth0 type ipvlan $ 
> ip link set ip1 netns ns1 $ ip netns exec ns1 ip link set ip1 up $ ip 
> netns exec ns1 ip addr add 168.16.0.2/24 dev ip1 $ ip netns exec ns1 
> tc qdisc add dev ip1 root netem corrupt 50% $ ip netns exec ns1 ping 
> 168.16.0.1
>
> This is because the netem will modify the packet randomly. the 
> corrupted packets should be dropped derectly, otherwise it may cause a 
> problem.


And why would ipvlan be so special ?

What about all other drivers ?

My advice : Do not use netem corrupt if you do not want to send corrupted packets .

>
>
> Here I add the check of ip header checksum and drop the illegal 
> packets in l3/l3s mode.
>

This patch makes no sense really.

>
> Signed-off-by: guodeqing <geffrey.guo@huawei.com>
> ---

  reply	other threads:[~2020-07-23  2:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  9:18 [PATCH,v2] ipvlan: add the check of ip header checksum guodeqing
2020-07-22 16:29 ` Eric Dumazet
2020-07-23  2:02   ` Guodeqing (A) [this message]
2020-07-22 20:04 ` David Miller
2020-07-23  1:59   ` 答复: " Guodeqing (A)
2020-07-23  2:15     ` Eric Dumazet
2020-07-24  3:35       ` 答复: " Guodeqing (A)
2020-07-24  5:13         ` Eric Dumazet
2020-07-24  8:39           ` 答复: " Guodeqing (A)
2020-07-24 23:44         ` David Miller

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=5cb165d14bf146e38a11afe1c2ebfcab@huawei.com \
    --to=geffrey.guo@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    /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).