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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,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 1BD15C28CC6 for ; Mon, 3 Jun 2019 04:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF28E27B36 for ; Mon, 3 Jun 2019 04:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559534907; bh=rSJQ+a4lL9tyYbDNBiCkB0cFlicvus8dyGOwdCSSW7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hbxHlf7x+cBRo/fCwCGUUJ+gZOx9qSYPXZP4s6IkYI76kJtqtD5nSsBi3j6REKP1/ x4gZLhldBf7juCHCBIf8Ik/qzF4pc4TqHy8xrewbLgZcJ9gc6PANsgamjx6j6HcJbX kn6x2I4VsOAWS344/nB2qpMV6OmhITlwdFaQvLQg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbfFCEIY (ORCPT ); Mon, 3 Jun 2019 00:08:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:42434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbfFCEIV (ORCPT ); Mon, 3 Jun 2019 00:08:21 -0400 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 6B0E527B3C; Mon, 3 Jun 2019 04:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559534900; bh=rSJQ+a4lL9tyYbDNBiCkB0cFlicvus8dyGOwdCSSW7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d4QaccP0VT7rfgIuys+GAjChDNrZrPDf4heKLT2o3STOjcqFbMCWQY7uMbUztY1m2 JnpS3uCmxfmFtKdNUYgs9KEW/Z6r30p27ru+ESpCm0h7fMdW/Axbg2feR54f7ZOXON 4eMrVC3unUk9wcpHQS4iBXz9uMVsJDho5o3QaXNQ= From: David Ahern To: davem@davemloft.net, netdev@vger.kernel.org Cc: idosch@mellanox.com, saeedm@mellanox.com, kafai@fb.com, weiwan@google.com, David Ahern Subject: [PATCH v2 net-next 5/7] mlxsw: Fail attempts to use routes with nexthop objects Date: Sun, 2 Jun 2019 21:08:15 -0700 Message-Id: <20190603040817.4825-6-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190603040817.4825-1-dsahern@kernel.org> References: <20190603040817.4825-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern Fail attempts to use nexthop objects with routes until support can be properly added. Signed-off-by: David Ahern Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 4f781358aef1..23f17ea52061 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -6122,6 +6122,20 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, NL_SET_ERR_MSG_MOD(info->extack, "IPv6 gateway with IPv4 route is not supported"); return notifier_from_errno(-EINVAL); } + if (fen_info->fi->nh) { + NL_SET_ERR_MSG_MOD(info->extack, "IPv4 route with nexthop objects is not supported"); + return notifier_from_errno(-EINVAL); + } + } else if (info->family == AF_INET6) { + struct fib6_entry_notifier_info *fen6_info; + + fen6_info = container_of(info, + struct fib6_entry_notifier_info, + info); + if (fen6_info->rt->nh) { + NL_SET_ERR_MSG_MOD(info->extack, "IPv6 route with nexthop objects is not supported"); + return notifier_from_errno(-EINVAL); + } } break; } -- 2.11.0