mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "wei zhang" <asuka.com@163.com>
To: "Jesse Gross" <jesse@nicira.com>
Cc: "David Miller" <davem@davemloft.net>,
	"dev@openvswitch.org" <dev@openvswitch.org>,
	netdev <netdev@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] openvswitch: supply a dummy err_handler of gre_cisco_protocol to prevent kernel crash
Date: Sat, 5 Apr 2014 12:20:27 +0800 (CST)	[thread overview]
Message-ID: <158dbf4d.1b3c.145301dbf7a.Coremail.asuka.com@163.com> (raw)
In-Reply-To: <CAEP_g=9WRyaSmRKHDZmWXwzjDyex8NheyveGzfH4qmMbhgGHdQ@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1976 bytes --]

At 2014-04-05 07:05:59,"Jesse Gross" <jesse@nicira.com> wrote:
>On Tue, Apr 1, 2014 at 5:23 PM, Wei Zhang <asuka.com@163.com> wrote:
>>
>> v2 -> v1: use the same logic of the gre_rcv() to distinguish which packet is
>> intended to us!
>
>As a tip on kernel process: if you put the version information after
>three dashes below the signed-off-by line then git will automatically
>remove it when the final patch is applied.

Thanks, should I modify it and send a v3 patch?

>
>> diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
>> index a3d6951..f391df1 100644
>> --- a/net/openvswitch/vport-gre.c
>> +++ b/net/openvswitch/vport-gre.c
>> @@ -110,6 +110,21 @@ static int gre_rcv(struct sk_buff *skb,
>>         return PACKET_RCVD;
>>  }
>>
>> +/* Called with rcu_read_lock and BH disabled. */
>> +static int gre_err(struct sk_buff *skb, u32 info,
>> +                  const struct tnl_ptk_info *tpi)
>> +{
>> +       struct ovs_net *ovs_net;
>> +       struct vport *vport;
>> +
>> +       ovs_net = net_generic(dev_net(skb->dev), ovs_net_id);
>> +       vport = rcu_dereference(ovs_net->vport_net.gre_vport);
>> +       if (unlikely(!vport))
>> +               return PACKET_REJECT;
>> +       else
>> +               return PACKET_RCVD;
>
>Sorry, I forgot to say this before - if we receive the packet then we
>should also call consume_skb() on it.

Maybe there is no need to call consume_skb()? The icmp_rcv() would
call kfree_skb() for us. I also checked the ipgre_err(), it return 
PACKET_RCVD without call consume_skb() too.

Regards,
Wei Zhangÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-04-05  4:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1396398194-4163-1-git-send-email-asuka.com@163.com>
2014-04-04 23:05 ` Jesse Gross
2014-04-05  4:20   ` wei zhang [this message]
2014-04-09  0:46     ` Jesse Gross

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=158dbf4d.1b3c.145301dbf7a.Coremail.asuka.com@163.com \
    --to=asuka.com@163.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=jesse@nicira.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®