Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp738872yba; Fri, 26 Apr 2019 08:01:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd6NoB0ZcOemKFYN2+1zFqGyi5SMiScnAF7j/YXnGdBi7gLDTaV0bLNC+eMsEoyL+2QoJV X-Received: by 2002:a17:902:5a3:: with SMTP id f32mr43686404plf.82.1556290885673; Fri, 26 Apr 2019 08:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556290885; cv=none; d=google.com; s=arc-20160816; b=ntT/4q73hXtVQ6bhf09IZhuqclKZ9ERoQeFLu08YYnrObvnShzn7gzZMMG7JdHjFox Pr/uKaru9RSYVh7sai2RDFjY5vhm0/pZpIiaHcrkGwrFlNNxjZanhGB7ZzwGw/IS49ia ETo81MuZMWDqstz5FsLBMwYFODBNACb28P7TvxWlDB17rSm8+wgOC9OrYv+rUrMBZtI5 Mcx3oVu19ohxi/xBymi55LdfnhdjkEO/z/HMqm0AXi25SIR73zhBpVE7/2QenbwYanPV BBWy9lzZ/bcKij2QylD/l+rTBbx1AFaOg/z117RE5S9ceS1Bv4XzgqyJQB7k7o3a09GI QOhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=A5Y+MEfrLrdu8cFgwukPbLeOMa8h8CDG6LEpPB89rIc=; b=OI964Q9TpbjmbyV46csfhrCA7HnrTdvJ1asJFgSASEgka+EVgJyoeYE175dymmsGtk MCh0GGvMtKF43OHdRRp7HNMvkYcFUvHHI0c5X/sQ5fOjnUAX+Nj74SwAveKJe7nxxdBt GLBFNTn3tMOSP14y5vGpSrRxFzRMY8vbRfEJElu2/kP9lQwU4GEoXq/2ZnXnV/aykCp9 JYSFkaB/UR1NVmmoMX9dsP3an/vojKSFIu3LlMKuMwwLeUVuP7ugS4lDdGRxoSusDVuC tMWDmNGa9n3LCAM5Jl+6v4vYHCT46m61QbT7ZmA7oYwtF3fTT5ttjxS8Tdh00kTbfwAE ub3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p+k3zXC+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si2727953pld.163.2019.04.26.08.01.10; Fri, 26 Apr 2019 08:01:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p+k3zXC+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726503AbfDZPAS (ORCPT + 99 others); Fri, 26 Apr 2019 11:00:18 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45722 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfDZPAS (ORCPT ); Fri, 26 Apr 2019 11:00:18 -0400 Received: by mail-pf1-f193.google.com with SMTP id e24so1847673pfi.12; Fri, 26 Apr 2019 08:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A5Y+MEfrLrdu8cFgwukPbLeOMa8h8CDG6LEpPB89rIc=; b=p+k3zXC+msVwPDiTh8ZFLz2dOtBlIVpVmkiMWJMLrbujSRqsiO1qH5CsQ6Fqj8uvWv 8saQw+waVQ242238j8bPgCHXA0ohHari7ghEBVdMaeNGGzNJAVMeESC96whtfP0Tmw/C qFQn1p8G4XKbzOVOfYJMGf3DcA63NGtu1arxjhgFZNfWxfhcHj4ErdBBngFmUdiKmEAk hU+CZFZROyJ8WVKIHalTVXwPT15QHT7im47RDFoot+Hxu9NNotgMMu1ZSbn2q8dgf/oP T92/isg/gsPnkOSc1dJb3AIf+vNgvXrNFYmNV1fa6E0h0xygfCj+PBTiMLC35uJSEW5D 0UNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A5Y+MEfrLrdu8cFgwukPbLeOMa8h8CDG6LEpPB89rIc=; b=WYfqAkLK7RPjl1rYZnArEKP38bPdT1au55bRg5B7LWuFsbiLDUVYfo+GruSAcXr72e pA4c/GqFf92sqhi5/L0hLavs/ohN7iWYCotQ9B4Wp1jPaY1nKWg3Lro/AFNdXoQBAUMN oBf59F7GFlm9I2L0B9i+JNyDf2E4CemeRhx0Wp6uYRgvBIvV7pcTBBMFEXxRceIS++tn d+aNssAFkMARLLsVAoKlGrp9FwGJQhtLbc12F8Lwqbb+oRXK/3jET407fSUpozTuXQil aymrMgFHp7QHwQokGT109xXJ22pz5/FDVedP2it18je887HDumQmfMPlF3asMsChw8P3 c3hw== X-Gm-Message-State: APjAAAUHIpXsR6kUzHVofTJ03OSsqDtcSgVpAIj6oY2nb7QSnyyvfLr1 xTvlIW2aCTgBg0Wu3ETch2AU1owL X-Received: by 2002:a63:b53:: with SMTP id a19mr861877pgl.216.1556290816618; Fri, 26 Apr 2019 08:00:16 -0700 (PDT) Received: from ?IPv6:2601:282:800:fd80:c824:60cf:2bea:8fbc? ([2601:282:800:fd80:c824:60cf:2bea:8fbc]) by smtp.googlemail.com with ESMTPSA id 4sm284982pfi.94.2019.04.26.08.00.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 08:00:15 -0700 (PDT) Subject: Re: [PATCH net-next 0/3] make nla_nest_start() add NLA_F_NESTED flag To: Johannes Berg , Michal Kubecek , netdev@vger.kernel.org Cc: "David S. Miller" , Jiri Pirko , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "netfilter-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1dcb87486a96785e3b9e6f337392aa904d977a0d.camel@sipsolutions.net> <20190426111954.GG26549@unicorn.suse.cz> <20190426115629.GH26549@unicorn.suse.cz> <18db9ac8b398b215e3523dd5b79c7f86e21864ce.camel@sipsolutions.net> From: David Ahern Message-ID: <47f6daf9-2d14-1566-8ed1-fb5d4dd57bf8@gmail.com> Date: Fri, 26 Apr 2019 09:00:14 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <18db9ac8b398b215e3523dd5b79c7f86e21864ce.camel@sipsolutions.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/26/19 6:17 AM, Johannes Berg wrote: > On Fri, 2019-04-26 at 13:56 +0200, Michal Kubecek wrote: > >>>> I suppose we should, at least the part that attribute with NLA_NESTED >>>> policy has NLA_F_NESTED flag. I'm not so sure about the opposite (i.e. >>>> that attributes with other policies do not have the flag) as when I was >>>> checking where kernel accesses nlattr::nla_type directly rather than >>>> with nla_type(), I stumbled upon an attribute NL80211_ATTR_VENDOR_DATA >>>> which has policy NLA_BINARY but is sometimes a nest, AFAICS. >>> >>> I guess anyway we can only do it for *new* things, not really for all >>> existing attributes. >> >> Right... but what I wanted to say is that if there is already (at least) >> one attribute which may or may not be a nest, depending on a context, we >> should expect there may be also new attributes like that in the future. > > Yeah, but we can handle that as we see it? > > I just reposted my strict validation series - maybe we can right now, as > it's not released yet, quickly add an NL_VALIDATED_NESTED_FLAG or so to > it? > > Do you want to take a stab at that? I have to go now, but I could check > in the next few days. What is a valid use case for an attribute sometimes being a nest and sometimes not? That seems really weird to me (ie., wrong). They should be 2 separate attributes even if the backend processing is the same.