From patchwork Tue Feb 26 17:00:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 1048457 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="ZL94Pi84"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4484nB279dz9s2R for ; Wed, 27 Feb 2019 04:00:14 +1100 (AEDT) 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,