Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp491685yba; Fri, 26 Apr 2019 03:52:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAeXx2JLAsUYfeMiidQyUSSfkxpX0G43v1BtxyD4wHZ3V7GDpdPRRNzSn4f/j4MnIgZsZo X-Received: by 2002:a17:902:8a4:: with SMTP id 33mr45393121pll.7.1556275959670; Fri, 26 Apr 2019 03:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556275959; cv=none; d=google.com; s=arc-20160816; b=tR+VoxfCI3oxRYkYHtHfTmqqyFVejB1yYOQ3MTAfaVjlnvK704xohSDRwymm0XMyIs dXiBjof7ggDOudO9k2GKSJrwsOMYf9W+1LY3NoouB2nN9nN+FkBY/GVprij51pub+KiI Y4ECb7s2Qrc29Wp3DcXy9sEz8zjWLIan95a+Hv4GCKeRqEugLtUvtqWmKHXiq4t8GNvw QeyrtDFHcLtRt2y5NazUAlgY57vUk9U0Tga7TEjuHrDs9kPDxhWkHcxEnLSrVN/0wfGJ NjvGaYbRrl3FpILGbDSpvWimEPPdAnxxAW5xW2ykEGRwRq+IQtfhFmddxTeQa33zyUc/ udNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oYR47EfvfB3INLmcV5CUtMqytev5exvJp3sCteIx6Jo=; b=C898kGVIPpAu2ueAaPyBaZerC6UJ2YjBMiDSttlje0ZwSKCDZsEHOkKfg73ptTU1cl t5tyFU3uBsW03cReRzOtmLeJR/3KToXzqAPCcIogkqinWvH5AKHo7vuxde6POdfqSwr+ 4OwEEJTFJq44mZg69LCEB1+nvSTienNdHqvRs6r+MmWof5ROEt6lkDWrrKK2Oe6lXlZb AylQWQQJvg523RB+0TqORbHDSZvNe0RwI0EkTsJ2Bu5+WxbKGh9X2LtqQb4ZtDWESbWB zV29A5jV871de273KxR/UjBKZJQefEflCPCCcLm88INbysPrpb296eVwEHB+6qxmE02Q m8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=tkzzJ5Ar; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si25300293pfh.244.2019.04.26.03.52.24; Fri, 26 Apr 2019 03:52:39 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=tkzzJ5Ar; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbfDZKvZ (ORCPT + 99 others); Fri, 26 Apr 2019 06:51:25 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45906 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfDZKvV (ORCPT ); Fri, 26 Apr 2019 06:51:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id s15so3766732wra.12 for ; Fri, 26 Apr 2019 03:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oYR47EfvfB3INLmcV5CUtMqytev5exvJp3sCteIx6Jo=; b=tkzzJ5ArDKyVndEsWm9NfYy6jIFvMjy2MOiy+V2/BVHUWkjsLUMeCSgupRDE7ADW42 b8rGLn+n1ijUVg++vw46kEbWhqxm2UO19JEA+m+khiJDXgOzMOrbmPVAhbE4LndekdXZ /HPncxDU3FMFAmIedbJ9WdnHMKqEB8OR5zt3e/pRChA/1nG8OXifkc5/u+AwdTFkss0n r+OJt9O393b71vghxaUpXsDvVNpbSqEs3TADOZjKzfppN+POw6F+5JVLn5ZlX+JCSKER QiyzU7nwmS6T9hj1+aGANbQxNpNpAKAvI6ZMenvj/3HnGyNKu/Mh/z9g4GkBSAPmog2O /jLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oYR47EfvfB3INLmcV5CUtMqytev5exvJp3sCteIx6Jo=; b=eBB2uQpe7wY83JgPkVfCqElp3v18xz3mwr4yWoNTG43ed1S4zikwVsntvq3w6892mG wx/ReAs1bnphuGzic6lGi0gjf49VRr5SOe5Tg+x0XDC721dJWl9Pz32BnbHc1kus08/X IOmBMwBw1ah+EsptxtYIeUi5smHF2tYxpcv22wSTRDUloakdg6/Hy8ifc0E3t04XuMeT 1WpQrav4QDc8X4+kZhIfWsP8u3OVNp6hQw2SRaVDUETeQ2bRH0zmPQnVGmzAjJWqDROR 3QHC0s+fX5Gn0EOU7LLmdI8xTo4yE4IYxFNT71UFsSw7ow1JxrvJjFgdKWy6DnKhUc8Q s8uw== X-Gm-Message-State: APjAAAUpey8SOTygmSm3/4Qekq+vsOLJ0uv3FlqdiqxFCl3KdkILdxEL 9Oe/UWaNHYM6x0XM10Xkdr/GMQ== X-Received: by 2002:a5d:53c8:: with SMTP id a8mr7068895wrw.38.1556275879248; Fri, 26 Apr 2019 03:51:19 -0700 (PDT) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id u5sm2756099wml.4.2019.04.26.03.51.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 03:51:18 -0700 (PDT) Date: Fri, 26 Apr 2019 12:51:17 +0200 From: Jiri Pirko To: Michal Kubecek Cc: "David S. Miller" , netdev@vger.kernel.org, David Ahern , Johannes Berg , Jiri Pirko , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/3] netlink: make nla_nest_start() add NLA_F_NESTED flag Message-ID: <20190426105117.GA2157@nanopsycho> References: <5278b013a953d4fb2e7944fc810f783d70ea52a5.1556269635.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5278b013a953d4fb2e7944fc810f783d70ea52a5.1556269635.git.mkubecek@suse.cz> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fri, Apr 26, 2019 at 11:13:06AM CEST, mkubecek@suse.cz wrote: >Even if the NLA_F_NESTED flag was introduced more than 11 years ago, most >netlink based interfaces (including recently added ones) are still not >setting it in kernel generated messages. Without the flag, message parsers >not aware of attribute semantics (e.g. wireshark dissector or libmnl's >mnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display >the structure of their contents. > >Unfortunately we cannot just add the flag everywhere as there may be >userspace applications which check nlattr::nla_type directly rather than >through a helper masking out the flags. Therefore the patch renames >nla_nest_start() to nla_nest_start_noflag() and introduces nla_nest_start() >as a wrapper adding NLA_F_NESTED. The calls which add NLA_F_NESTED manually >are rewritten to use nla_nest_start(). > >Except for changes in include/net/netlink.h, the patch was generated using >this semantic patch: > >@@ expression E1, E2; @@ >-nla_nest_start(E1, E2) >+nla_nest_start_noflag(E1, E2) > >@@ expression E1, E2; @@ >-nla_nest_start_noflag(E1, E2 | NLA_F_NESTED) >+nla_nest_start(E1, E2) > >Signed-off-by: Michal Kubecek Acked-by: Jiri Pirko