From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sowmini Varadhan Subject: Re: [PATCH net-next] selftests/net: fix bugs in cfg_port initialization Date: Mon, 25 Dec 2017 17:17:43 -0500 Message-ID: <20171225221743.GA12386@oracle.com> References: <1514136201-111109-1-git-send-email-sowmini.varadhan@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Willem de Bruijn , Network Development , David Miller To: Willem de Bruijn Return-path: Received: from aserp2120.oracle.com ([141.146.126.78]:52488 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034AbdLYWSD (ORCPT ); Mon, 25 Dec 2017 17:18:03 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On (12/25/17 15:49), Willem de Bruijn wrote: > > It would be good to also address the other instance of this at the > same time: protocol family (-4 or -6) has to be set before a call to > setup_sockaddr. Unlike this case, it hits an error() if called in the > "incorrect" order, but that is still a crutch. Yeah, I thought of that one too, but "usually" (at least that's what is instinctive to me) you bind to INADDR_ANY or ::, so this only becomes an issue on the client side. (And there, most people put the -4 or -6 before the address, but I agree it would be nice to fix this..) > But even better will be to save cfg_port, and src + dst addr optargs > as local variables, then call the init function only after parsing when > all state is available. Where this patch adds calls to > init_sockaddr_port, indeed. sure, I can put that out on V2 later this week.