Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp491482pxu; Fri, 4 Dec 2020 08:09:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwsPHivkz7ZqEm7rIpjX8wKTmy0UTFND7BDXT9NoDu53w2oHOe6DSulAA2dGwjctOx/VnH X-Received: by 2002:aa7:d545:: with SMTP id u5mr8114398edr.113.1607098180780; Fri, 04 Dec 2020 08:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607098180; cv=none; d=google.com; s=arc-20160816; b=plROTqwQtVWe0boQfNZj/7H4O4+2KM3H+QGkt8vBKAekqnh1VvaZxT59b1rnQN4FTm ZKvqCg3jknh4YZTUCHyQfhsUmGQbROWIBgbBiNlGxrH0Pqa1DBCQ3D4CQfYqPM7U02uH 9LmiARW7SfWwyLmBG8Xewyw2Zsf0SGO46L4qi1rx3le0hyVfpqql9C1pbJ3zmud5N9y5 EH+J1U3JCv3rm/DhhRNM33IRVFbakqzcOmkmwXuENXOE9HDpg8azFuCHJ3a5xw3M9+SD nGm/wTH5GJeLfZ4TEpV/0FBm+KexJcnCVOuOz2H7RM/fZI9q1S1HmBWJ5SQclalglOtH 4cNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=7VB+1jc8g1YKQDZ8tdwVKRM6JUO1hOAxFjhrxOv7Ha8=; b=mvnCqCh+yOm2G9D0m1nTkmYcu/nCFcdjaMwzK9CnNFfFcvA/RjZEytPvcGkB12z+yI sZMwQYjAWmPqZzWUXdSo2bdYs5BoWUfBiv9G3vgnAe8yL2wgrmhKsXE4hSzjXR32gKfX z1bO9doPwO3OSKoC4gtsv/KxehheyTj+HWzNYZDkFeAmk1F60esIbju+jaIMO5PZj4PY IvXHUi3hx96a1yLm+6rKquOqp6R2XP4wXL28YepAF/vYLK0mEQ8ORYhTjuZchJheha+d 8A5wpxBFliVlR04pqMuBdPdwexIGYP4Jl0a8aR+DsmBNuIQXq7wyqr67y9uVy7br0Gdt Sjcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oYeKFh7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si3106742edo.494.2020.12.04.08.09.16; Fri, 04 Dec 2020 08:09:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oYeKFh7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730747AbgLDQE6 (ORCPT + 99 others); Fri, 4 Dec 2020 11:04:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbgLDQE5 (ORCPT ); Fri, 4 Dec 2020 11:04:57 -0500 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95D2C061A4F; Fri, 4 Dec 2020 08:04:11 -0800 (PST) Received: by mail-oi1-x242.google.com with SMTP id f11so6646769oij.6; Fri, 04 Dec 2020 08:04:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7VB+1jc8g1YKQDZ8tdwVKRM6JUO1hOAxFjhrxOv7Ha8=; b=oYeKFh7PN26SksKDvZYaQhyJ4U9sv1XYyFaz3Si5suGo+MHMzuqrEtrV2zaEoXk8Eo BG/9UJccFx0ycuLp4OUdFVmuqZP3XdgdEr/f3Vz3MH4K2ei6aaABA5c0WSSXDapoJtWY xabA08Wl8nbuPqFrLuHN80fpfs05m60BZGZSYBRF0/YdWPhCvZXOXfmr7i5GjJqxJqcQ +W8VdhUBnq1y8HnhWReqZbwxvhZpDjOvwPs45ERX4G2DitvRHy7vrtqwh55Eye0+hHBp CROp49Zhvr9aWpibomDvxoMZcVclakZfl3BCNldOv6dNpTBPYrkH7uJcfRqje9rg4yho PeUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7VB+1jc8g1YKQDZ8tdwVKRM6JUO1hOAxFjhrxOv7Ha8=; b=mjgcgfrbNcjRhzCxfLrarJjRy3jwnaHhstwVhhL1/BARr8hWqECFqNBqxDhFNaiH3o Lwa2C0kZkH9ZWG1fgOvK/NteCpKE3JWejryRFHhXGniee1QHzYIW4PzUe7UmzrMbjOVw xJvla0KdtEWffXM6+pZF4biblFLFOHIyN/kU8qkRGVvDiIy61jegYMBNyylkWGX3+T0z m1ABZm79liifXX2BoAKKtBcqZgH+3UPytG6m32fH+Tb0AJBe/ESMEh7ZeqLPAnqO4Rw7 ZVtri5AUG5nETL6hH1e8guVttYzJDhF7SAI/nG9ltaOUcfuNlaECMOch2hqKLTTGiNc7 5jSA== X-Gm-Message-State: AOAM531unZMF6iCtjqUr7o0w4UATFhvVo+SZxDqoK5yZ7xPeuScIii9H lnY+zTiuBriRMymjwSb3LgJ7JPuhGDA= X-Received: by 2002:aca:d887:: with SMTP id p129mr3832647oig.156.1607097851085; Fri, 04 Dec 2020 08:04:11 -0800 (PST) Received: from Davids-MacBook-Pro.local ([8.48.134.51]) by smtp.googlemail.com with ESMTPSA id r12sm714558ooo.25.2020.12.04.08.04.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2020 08:04:10 -0800 (PST) Subject: Re: [PATCH net] ipv4: fix error return code in rtm_to_fib_config() To: Zhang Changzhong , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1607071695-33740-1-git-send-email-zhangchangzhong@huawei.com> From: David Ahern Message-ID: Date: Fri, 4 Dec 2020 09:04:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <1607071695-33740-1-git-send-email-zhangchangzhong@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/4/20 1:48 AM, Zhang Changzhong wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes") > Reported-by: Hulk Robot > Signed-off-by: Zhang Changzhong > --- > net/ipv4/fib_frontend.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c > index b87140a..cdf6ec5 100644 > --- a/net/ipv4/fib_frontend.c > +++ b/net/ipv4/fib_frontend.c > @@ -825,7 +825,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb, > if (has_gw && has_via) { > NL_SET_ERR_MSG(extack, > "Nexthop configuration can not contain both GATEWAY and VIA"); > - goto errout; > + return -EINVAL; > } > > return 0; > Thanks for the patch. Reviewed-by: David Ahern