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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 46709C3A59F for ; Thu, 29 Aug 2019 05:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CBFB22CED for ; Thu, 29 Aug 2019 05:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725917AbfH2F0X (ORCPT ); Thu, 29 Aug 2019 01:26:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:43824 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725776AbfH2F0X (ORCPT ); Thu, 29 Aug 2019 01:26:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5D5D4AC67; Thu, 29 Aug 2019 05:26:22 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 82EC4E0CFC; Thu, 29 Aug 2019 07:26:20 +0200 (CEST) Date: Thu, 29 Aug 2019 07:26:20 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Roopa Prabhu , Jiri Pirko , David Miller , Jakub Kicinski , David Ahern , Stephen Hemminger , dcbw@redhat.com, Andrew Lunn , parav@mellanox.com, Saeed Mahameed , mlxsw Subject: Re: [patch net-next rfc 3/7] net: rtnetlink: add commands to add and delete alternative ifnames Message-ID: <20190829052620.GK29594@unicorn.suse.cz> References: <20190826151552.4f1a2ad9@cakuba.netronome.com> <20190826.151819.804077961408964282.davem@davemloft.net> <20190827070808.GA2250@nanopsycho> <20190827.012242.418276717667374306.davem@davemloft.net> <20190827093525.GB2250@nanopsycho> <20190828070711.GE2312@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Aug 28, 2019 at 09:36:41PM -0700, Roopa Prabhu wrote: > > yes, correct. I mentioned that because I was wondering if we can > think along the same lines for this API. > eg > (a) RTM_NEWLINK always replaces the list attribute > (b) RTM_SETLINK with NLM_F_APPEND always appends to the list attribute > (c) RTM_DELLINK with NLM_F_APPEND updates the list attribute > > (It could be NLM_F_UPDATE if NLM_F_APPEND sounds weird in the del > case. I have not looked at the full dellink path if it will work > neatly..its been a busy day ) AFAICS rtnl_dellink() calls nlmsg_parse_deprecated() so that even current code would ignore any future attribute in RTM_DELLINK message (any kernel before the strict validation was introduced definitely will) and it does not seem to check NLM_F_APPEND or NLM_F_UPDATE either. So unless I missed something, such message would result in deleting the network device (if possible) with any kernel not implementing the feature. Michal