From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17006C43381 for ; Tue, 26 Feb 2019 03:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C995320842 for ; Tue, 26 Feb 2019 03:49:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pFZNyQe7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726356AbfBZDtG (ORCPT ); Mon, 25 Feb 2019 22:49:06 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41113 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbfBZDtG (ORCPT ); Mon, 25 Feb 2019 22:49:06 -0500 Received: by mail-pf1-f193.google.com with SMTP id d25so5525773pfn.8 for ; Mon, 25 Feb 2019 19:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mvn0TpUSZajRLR/BB+RMbcQOZBuhjYevdxpVmrKBY3Q=; b=pFZNyQe7pSTrusukBIrn/7ko6lIEaiFthg7UrWnRTxOfGJ6PYxs3bWeJg3/nqQ2Sxt O/stXNfj7sQ7RqFoIuKSZ7xKqt+9JU1/VmIa06W0uXAQXEkJgYxL+MoM5kYugVo+clkM 16g5QAL82N1a/etmzri8Arvb9rVO0qqligN10eTwVR+wRC0Z270m9B4rg+lPLDoSEHZD 5CD+S7SfcqlKwo1DLAEtIvx2+X58MtVFWrjZxQ4CZsYOQy7lrR7fZhhHX3TVn9eWtGla iu06vUgE7mf9Z4L8dBpt2arPKwJNcICHrNPh2yzUQvvmAGvVaioLGnihva2mAqn3qD8j kVuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mvn0TpUSZajRLR/BB+RMbcQOZBuhjYevdxpVmrKBY3Q=; b=lYzSyD1THrki76DRvyTjGfQJvg08KxZ1PigENCQNhgwvxLlb5CqkeAgoB58PUpwY/P 6DCfUziU7GjtLZ6vekVPdqYV9Hgi0WTr9cnFLGWueqwDgu+pnUnvb4l7Xw6R/wiAhnXA iK35bviSASg8Tv7M83YWCsgCB86Ruk9b+hMv2tnCCG7kNzmFGfMogEHijcP6+mul89kg e4MIcqB3ATzhGcIwsbw8+HnIVrKoJd5nfsiqmZ9WKovxX28mnPgeYcwHKoWcpWb7q8jF N16HtoPngKZLjwJdZULJf9oDEJmYlxh9D+zyEawK9gvnloC/+z7JaFD2eX2u3KHhxBA1 rhyA== X-Gm-Message-State: AHQUAuYBpUuNowdBhK8bUxdaBV+zyjW87zz3o6mx9Ze5OL9WAbV+Cwx/ JZtm74yAUk81843xQaceJDw= X-Google-Smtp-Source: AHgI3Iaxu8/3591MU7N059LV5+t9Aw0hssG9ac1189H8EbLTMS9GFA4GOCYXoORQSH6Qsrbw3DpsaA== X-Received: by 2002:a65:620c:: with SMTP id d12mr22204768pgv.328.1551152945206; Mon, 25 Feb 2019 19:49:05 -0800 (PST) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id c127sm22404103pfg.133.2019.02.25.19.49.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 19:49:04 -0800 (PST) Date: Tue, 26 Feb 2019 11:48:54 +0800 From: Hangbin Liu To: David Ahern Cc: Sabrina Dubroca , netdev@vger.kernel.org, Roopa Prabhu , "David S . Miller" Subject: Re: [PATCH net] ipv4: Add ICMPv6 support when parse route ipproto Message-ID: <20190226034854.GT10051@dhcp-12-139.nay.redhat.com> References: <20190225074700.7316-1-liuhangbin@gmail.com> <20190225111439.GA26565@bistromath.localdomain> <212750de-2d6a-ebb9-5079-bacf234f6cf6@gmail.com> <20190226021739.GS10051@dhcp-12-139.nay.redhat.com> <20f3652d-479b-7be1-cf13-e7d8a61dca9e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20f3652d-479b-7be1-cf13-e7d8a61dca9e@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi David, On Mon, Feb 25, 2019 at 07:23:33PM -0700, David Ahern wrote: > On 2/25/19 7:17 PM, Hangbin Liu wrote: > > I also thought about this issue. Currently we didn't check the ipproto in both > > IPv4 and IPv6. You can set icmp in ip6 rules or icmpv6 in ipv4 rules. > > This looks don't make any serious problem. It's just a user mis-configuration, > > the kernel check the proto number and won't match normal IP/IPv6 headers. > > > > But yes, we should make it more strict, do you think if I should add a new > > rtm_getroute_parse_ip6_proto() function, or just add a family parameter > > in previous function? > > I see now. rtm_getroute_parse_ip_proto is used for ipv4 and ipv6. For v4 > IPPROTO_ICMPV6 should not be allowed and for v6 IPPROTO_ICMP should > fail. You could a version argument to rtm_getroute_parse_ip_proto and > fail as needed. Sorry I didn't get here. Do you mean add an IPv6 version of rtm_getroute_parse_ip_proto? Thanks Hangbin