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=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED 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 249BCC10F00 for ; Fri, 5 Apr 2019 14:00:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5FAA21871 for ; Fri, 5 Apr 2019 14:00:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="K8BrEsLH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731336AbfDEOAH (ORCPT ); Fri, 5 Apr 2019 10:00:07 -0400 Received: from mail-eopbgr10080.outbound.protection.outlook.com ([40.107.1.80]:38624 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731306AbfDEOAH (ORCPT ); Fri, 5 Apr 2019 10:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6hxZHB1YEJ1v/R1YWROJXEtLDW/pZN01xPLNMUbJYkI=; b=K8BrEsLHG+ZzbTPbbwRpvSK6z+eCn8XHSpI/II0t5843fJmq7Snpl2QIRKffcWaBpRiNNCYpTD/mAOtYqWgz7Sj6S6ZgkRnXCbLH1fRFKCQFvnvpkIZABp1rnz5O1ylfk2DEWw7meLFU534qge83Otyi2wNr+gFUS6jBOOlMPZY= Received: from VI1PR05MB6111.eurprd05.prod.outlook.com (20.178.204.213) by VI1PR05MB3134.eurprd05.prod.outlook.com (10.170.237.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.19; Fri, 5 Apr 2019 14:00:00 +0000 Received: from VI1PR05MB6111.eurprd05.prod.outlook.com ([fe80::28c7:8df1:920b:ee0e]) by VI1PR05MB6111.eurprd05.prod.outlook.com ([fe80::28c7:8df1:920b:ee0e%5]) with mapi id 15.20.1771.016; Fri, 5 Apr 2019 14:00:00 +0000 From: Ido Schimmel To: David Ahern CC: "davem@davemloft.net" , "netdev@vger.kernel.org" , Jiri Pirko , David Ahern Subject: Re: [PATCH net-next 07/18] ipv4: Add support to fib_config for IPv6 gateway Thread-Topic: [PATCH net-next 07/18] ipv4: Add support to fib_config for IPv6 gateway Thread-Index: AQHU6w7UcADdcRJikkiGAgst0S1GN6YtmZaA Date: Fri, 5 Apr 2019 14:00:00 +0000 Message-ID: <20190405135957.GB18494@splinter> References: <20190404175007.8150-1-dsahern@kernel.org> <20190404175007.8150-8-dsahern@kernel.org> In-Reply-To: <20190404175007.8150-8-dsahern@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P190CA0031.EURP190.PROD.OUTLOOK.COM (2603:10a6:206:14::44) To VI1PR05MB6111.eurprd05.prod.outlook.com (2603:10a6:803:eb::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [79.176.7.115] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9a16c16f-5335-4f6d-648c-08d6b9cefe85 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VI1PR05MB3134; x-ms-traffictypediagnostic: VI1PR05MB3134: x-microsoft-antispam-prvs: x-forefront-prvs: 0998671D02 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(366004)(136003)(376002)(39860400002)(346002)(396003)(199004)(189003)(486006)(1076003)(476003)(11346002)(229853002)(446003)(5660300002)(71190400001)(71200400001)(3846002)(6116002)(6486002)(6436002)(8676002)(68736007)(81156014)(66066001)(8936002)(81166006)(6512007)(14454004)(9686003)(6916009)(53936002)(99286004)(14444005)(7736002)(54906003)(33716001)(86362001)(256004)(305945005)(316002)(33656002)(478600001)(2906002)(106356001)(105586002)(186003)(25786009)(6246003)(97736004)(4326008)(26005)(386003)(52116002)(102836004)(76176011)(6506007);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR05MB3134;H:VI1PR05MB6111.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: cbLGx449LyCPJVUwWRyAeE024ApX0I2rXZBGy2DQHFu01UBLqJT0GY1LjwCjt41ltr2s467iLmLBQ0dxO0rWZ/S4EynolXuJ3gR3BeqvI+88WU3xokNVrXuHo0ip7QJoMzIJOdyL44QG8sXElPFu1rjwUGQP2OIRytNjXB0ys48a0Ias6qglvSE68sNuU62DO3NDOSX6KE89SIEDIrH+AcG61NpQ7sTd4WEdnQXqKJZQYzpo6ulzj5ZFM6DPnv7r43DL4XF56pdJyFbVcNecN6H38CWVgF16DHoYzdQ4QUB34joDeX6PM3pekBkWUDbQd0s3JawfxFC9rRNdKrcCAnXHlaSC9AUNDTFknIjGe4Ud+w1miQCuw1/KIBjMzsdfYDHFSdZ2TDlUkQzigfCp6Edub2XTQuwSOQhcTDujodk= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a16c16f-5335-4f6d-648c-08d6b9cefe85 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2019 14:00:00.8193 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3134 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Apr 04, 2019 at 10:49:56AM -0700, David Ahern wrote: > From: David Ahern >=20 > Add support for an IPv6 gateway to fib_config. Since a gateway is either > IPv4 or IPv6, make it a union with fc_gw4 where fc_gw_family decides > which address is in use. Update current checks on family and gw4 to > handle ipv6 as well. >=20 > Signed-off-by: David Ahern Reviewed-by: Ido Schimmel See one note below > - fi->fib_nh->fib_nh_gw4 !=3D cfg->fc_gw4)) { > + fi->fib_nh->fib_nh_gw4 !=3D cfg->fc_gw4) || > + (cfg->fc_gw_family =3D=3D AF_INET6 && > + ipv6_addr_cmp(&fi->fib_nh->fib_nh_gw6, &cfg->fc_gw6))) { > NL_SET_ERR_MSG(extack, > "Nexthop gateway does not match RTA_GATEWAY"); Given that you can now specify a gateway with either RTA_GATEWAY or RTA_VIA it might make sense to adjust this message. > goto errout; > @@ -745,6 +758,10 @@ int fib_nh_match(struct fib_config *cfg, struct fib_= info *fi, > cfg->fc_gw4 !=3D fi->fib_nh->fib_nh_gw4) > return 1; > =20 > + if (cfg->fc_gw_family =3D=3D AF_INET6 && > + ipv6_addr_cmp(&cfg->fc_gw6, &fi->fib_nh->fib_nh_gw6)) > + return 1; > + > return 0; > } > =20 > --=20 > 2.11.0 >=20