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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT 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 2B1C1C4360F for ; Tue, 26 Feb 2019 17:00:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBF3320C01 for ; Tue, 26 Feb 2019 17:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551200410; bh=EAAyvDFUSC0M1wzGdqsi0nUpwZsSLGRCOstdYI7K8HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bqHYgEryfgw16xD6D+Y8LPuWPKlUAxrvSl26Jr6KFg4TIKtAW4ZNK6ekFLgi7F2FC oPyEreA9iOGoaVqkCihTx0isisq5AILvAv8IaGkwfKxFKATYj52PJ4coTJTV8Gc8vH ELfTxRBnullXh+QXjW1ZmMFrgt980b7MH3VOP9Po= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728192AbfBZRAH (ORCPT ); Tue, 26 Feb 2019 12:00:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:40784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfBZRAH (ORCPT ); Tue, 26 Feb 2019 12:00:07 -0500 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FC5C21852; Tue, 26 Feb 2019 17:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551200406; bh=EAAyvDFUSC0M1wzGdqsi0nUpwZsSLGRCOstdYI7K8HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZL94Pi84M4LTXqpeAhlbk8sDt28D29TH1eRf4TukR1v0iBxAabnoilFBTePLGzITZ F0/ClzcgPgkofMhCzybkW40frWnlxpTcceN7DwsiG4I1xP2TlqobxQBNX2e0hAJeqU xM+u6+qNg5+k0RXyhrAiLUTtv2TgEAjes5oxv+7E= From: David Ahern To: davem@davemloft.net Cc: netdev@vger.kernel.org, David Ahern Subject: [PATCH net 3/3] mpls: Return error for RTA_GATEWAY attribute Date: Tue, 26 Feb 2019 09:00:04 -0800 Message-Id: <20190226170004.4535-4-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190226170004.4535-1-dsahern@kernel.org> References: <20190226170004.4535-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern MPLS does not support nexthops with an MPLS address family. Specifically, it does not handle RTA_GATEWAY attribute. Make it clear by returning an error. Fixes: 03c0566542f4c ("mpls: Netlink commands to add, remove, and dump routes") Signed-off-by: David Ahern --- net/mpls/af_mpls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 7d55d4c04088..fa763e2e50ec 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1838,6 +1838,9 @@ static int rtm_to_route_config(struct sk_buff *skb, goto errout; break; } + case RTA_GATEWAY: + NL_SET_ERR_MSG(extack, "MPLS does not support RTA_GATEWAY attribute"); + goto errout; case RTA_VIA: { if (nla_get_via(nla, &cfg->rc_via_alen, -- 2.11.0