From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B238821196801 for ; Thu, 29 Nov 2018 07:15:43 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 07:15:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="97800411" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 29 Nov 2018 07:15:43 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 29 Nov 2018 07:15:42 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 29 Nov 2018 07:15:42 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.176]) with mapi id 14.03.0415.000; Thu, 29 Nov 2018 23:15:40 +0800 From: "Gao, Liming" To: Ard Biesheuvel CC: "edk2-devel@lists.01.org" , Laszlo Ersek , "Zhu, Yonghong" , "Feng, Bob C" Thread-Topic: [PATCH 1/6] BaseTools/CommonLib: avoid using 'native' word size in IP address handling Thread-Index: AQHUh998Ih91k0p+GEawE1FGmnf3VaVm22pw//97BoCAAIZwUA== Date: Thu, 29 Nov 2018 15:15:40 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E380C35@SHSMSX104.ccr.corp.intel.com> References: <20181129123129.25095-1-ard.biesheuvel@linaro.org> <20181129123129.25095-2-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A14E380C03@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDJiMDMyYzAtZWVlNy00NjA0LWEyY2YtYjBkNDRkNzQwYjZhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS0QwXC95UkxpdWJ4ZlpUWjJIYzZMKzhLc2xjbzR2TGU3dmZlTXZ3ZVcyc05DcTFWUmVNbzdCRytSN1o4alhhT1oifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/6] BaseTools/CommonLib: avoid using 'native' word size in IP address handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:15:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 RG8geW91IHZlcmlmeSB3aGljaCBHQ0MgYXJjaD8gMzJiaXQgb3IgNjRia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