From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2 0/6] utils: Get rid of inet_get_addr() Date: Thu, 18 Jan 2018 10:35:02 -0800 Message-ID: <20180118103502.59f0b196@xeon-e3> References: <1516299227-26724-1-git-send-email-serhe.popovych@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Serhey Popovych Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:45697 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755572AbeARSfK (ORCPT ); Thu, 18 Jan 2018 13:35:10 -0500 Received: by mail-pf0-f195.google.com with SMTP id a88so13796709pfe.12 for ; Thu, 18 Jan 2018 10:35:10 -0800 (PST) In-Reply-To: <1516299227-26724-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 18 Jan 2018 20:13:41 +0200 Serhey Popovych wrote: > It looks confusing to have multiple independent > routines to get internet address from it's string > representation: get_addr() and inet_get_addr(). > > Most complicated users of inet_get_addr() is > iplink_geneve.c and iplink_vxlan.c because they > required to handle both AF_INET and AF_INET6 > for their local/remote endpoints. > > On the other hand get_addr() does not provide > additional information like address type: need > to address this. to get rid of current and > possible future code duplications. Note that > this functionality is first step to make proto > independent handling of local/remote endpoints > in ip/tunnel code (there will be additional > series based on this one). > > Also fix get_addr_1() and get_prefix() to make > sure it always provide correct ->family and > ->bitlen. > > As always comments, suggestions and criticism > are welcome. > > Thanks, > Serhii > > Serhey Popovych (6): > utils: Always specify family for address in get_addr_1() > utils: Always specify family and ->bytelen in get_prefix_1() > utils: Fast inet address classification after get_addr() > iplink_geneve: Get rid of inet_get_addr() > iplink_vxlan: Get rid of inet_get_addr() > ip: Get rid of inet_get_addr() > > include/utils.h | 36 ++++++++++++++++- > ip/iplink_geneve.c | 23 +++++------ > ip/iplink_vxlan.c | 72 ++++++++++++--------------------- > ip/iproute_lwtunnel.c | 5 ++- > ip/ipseg6.c | 8 ++-- > lib/utils.c | 108 +++++++++++++++++++++++++++++-------------------- > 6 files changed, 142 insertions(+), 110 deletions(-) > Let's consider this for net-next. Not for current release.