From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH v5] net: ip, diag -- Add diag interface for raw sockets Date: Wed, 28 Sep 2016 15:45:20 +0300 Message-ID: <20160928124520.GZ1876@uranus.lan> References: <20160928112703.GW1876@uranus.lan> <20160928.080701.1194277590163223525.davem@davemloft.net> <60b2e075-e852-f0c2-c188-631f547791d5@mojatatu.com> <20160928.081646.1634500099795129398.davem@davemloft.net> <70b51ac5-a7d1-8b52-90c4-7f80ec8ad4d5@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Miller , eric.dumazet@gmail.com, dsa@cumulusnetworks.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, avagin@openvz.org, stephen@networkplumber.org To: Jamal Hadi Salim Return-path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:34228 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbcI1MpY (ORCPT ); Wed, 28 Sep 2016 08:45:24 -0400 Content-Disposition: inline In-Reply-To: <70b51ac5-a7d1-8b52-90c4-7f80ec8ad4d5@mojatatu.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Sep 28, 2016 at 08:27:24AM -0400, Jamal Hadi Salim wrote: > > > > They must initialize it to zero. > > > > What if in the future actually meant to use 0 for > something?;-> For example in Cyrill's case it means PROTO_IP > Not sure if it useful to interpret or not but it is part of the > enum for protocols. It will be perfectly fine if we start using 0 here for something, the main match key is @sdiag_proto (which will be IPPROTO_RAW for my case). If someone is to use this field for something else the main key selection remain the same, iow @sdiag_proto first and then subprotocol if needed. > Maybe we shouldnt be adding pad fields in these netlink > structure definitions then one can liberally add new ones. You know, I personally don't see much problem in defining union, especially while anonymous uninons do work for us here. > Note: inet_diag somewhere has a netlink structure that > has a hole. I pointed it out to Eric D. and he said we cant > add it now because it would break ABI. Naming holes generated by a compiler for alignment sake should not break abi (because alignments are abi by self), but I may be missing something in context of where the structure you're talking about is present. And what about non-x86 archs? They might have different members alignment requirements. > So where do we draw the line for future extensions?