mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yue Haibing <yuehaibing@huawei.com>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<horms@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] ipv4: fib: Remove unnecessary encap_type check
Date: Wed, 25 Jun 2025 09:48:29 +0800	[thread overview]
Message-ID: <2b969f72-b5c3-4102-a7ea-77b5c726bc76@huawei.com> (raw)
In-Reply-To: <CAAVpQUAEA6jkcM4VhzgYnx-dS1FEodN7y3DSK7LAh7Evt6bgjw@mail.gmail.com>

On 2025/6/25 2:26, Kuniyuki Iwashima wrote:
> On Tue, Jun 24, 2025 at 6:46 AM Yue Haibing <yuehaibing@huawei.com> wrote:
>>
>> lwtunnel_build_state() has check validity of encap_type,
>> so no need to do this before call it.
>>
>> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
>> ---
>>  net/ipv4/fib_semantics.c | 8 --------
>>  1 file changed, 8 deletions(-)
>>
>> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
>> index f7c9c6a9f53e..475ffcbf4927 100644
>> --- a/net/ipv4/fib_semantics.c
>> +++ b/net/ipv4/fib_semantics.c
>> @@ -625,11 +625,6 @@ int fib_nh_common_init(struct net *net, struct fib_nh_common *nhc,
>>         if (encap) {
>>                 struct lwtunnel_state *lwtstate;
>>
>> -               if (encap_type == LWTUNNEL_ENCAP_NONE) {
>> -                       NL_SET_ERR_MSG(extack, "LWT encap type not specified");
>> -                       err = -EINVAL;
>> -                       goto lwt_failure;
>> -               }
>>                 err = lwtunnel_build_state(net, encap_type, encap,
>>                                            nhc->nhc_family, cfg, &lwtstate,
>>                                            extack);
>> @@ -890,9 +885,6 @@ static int fib_encap_match(struct net *net, u16 encap_type,
>>         struct lwtunnel_state *lwtstate;
>>         int ret, result = 0;
>>
>> -       if (encap_type == LWTUNNEL_ENCAP_NONE)
>> -               return 0;
> 
> Now this condition returns -EINVAL, which confuses fib_encap_match(), no ?

Right, sorry for overlook this, will restore in v2.

> 
> 
>> -
>>         ret = lwtunnel_build_state(net, encap_type, encap, AF_INET,
>>                                    cfg, &lwtstate, extack);
>>         if (!ret) {
>> --
>> 2.34.1
>>
> 

      reply	other threads:[~2025-06-25  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 14:03 Yue Haibing
2025-06-24 18:26 ` Kuniyuki Iwashima
2025-06-25  1:48   ` Yue Haibing [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=2b969f72-b5c3-4102-a7ea-77b5c726bc76@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®