From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH V2 net-next] selftests/net: fix bugs in address and port initialization Date: Tue, 02 Jan 2018 13:27:18 -0500 (EST) Message-ID: <20180102.132718.1419274108075280136.davem@davemloft.net> References: <1514241784-115652-1-git-send-email-sowmini.varadhan@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, willemdebruijn.kernel@gmail.com, willemb@google.com To: sowmini.varadhan@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:50640 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbeABS1U (ORCPT ); Tue, 2 Jan 2018 13:27:20 -0500 In-Reply-To: <1514241784-115652-1-git-send-email-sowmini.varadhan@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Sowmini Varadhan Date: Mon, 25 Dec 2017 14:43:04 -0800 > Address/port initialization should work correctly regardless > of the order in which command line arguments are supplied, > E.g, cfg_port should be used to connect to the remote host > even if it is processed after -D, src/dst address initialization > should not require that [-4|-6] be specified before > the -S or -D args, receiver should be able to bind to *. > > Achieve this by making sure that the address/port structures > are initialized after all command line options are parsed. > > Store cfg_port in host-byte order, and use htons() > to set up the sin_port/sin6_port before bind/connect, > so that the network system calls get the correct values > in network-byte order. > > Signed-off-by: Sowmini Varadhan Applied, thank you.