From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9808 Path: news.gmane.org!not-for-mail From: Sebastian Gottschall Newsgroups: gmane.linux.lib.musl.general Subject: recvmsg/sendmsg broken on mips64 Date: Fri, 1 Apr 2016 11:16:20 +0200 Message-ID: <76c20e67-4d62-a929-9f1d-a3fc63758426@dd-wrt.com> References: <20160331192518.GW21636@brightrain.aerifal.cx> <20160331201012.GR9862@port70.net> <20160331203004.GX21636@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1459502161 3443 80.91.229.3 (1 Apr 2016 09:16:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 09:16:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9821-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 01 11:16:00 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1alvBH-0006tg-TP for gllmg-musl@m.gmane.org; Fri, 01 Apr 2016 11:15:52 +0200 Original-Received: (qmail 3530 invoked by uid 550); 1 Apr 2016 09:15:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3472 invoked from network); 1 Apr 2016 09:15:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To; bh=fd73n85IcLXJIT3LwU6o1my1xaI4ffhFkH4z4hppmrI=; b=UaTsWhZdsCBnv2wYZ6nyVeOCFnGiR+gt4FljxcOtD+5aOFQWiv+ISxeLFwReCsV5gz8vG7SD/xTGpi3pCuetB20lMqtKKJom3lobfTmg/iWl3V1H0auOdIIxyVvFM1grCv5g+lNo+0wOxNwR1/cppRidz1jI9kQDfzpXTce1cLM=; User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <20160331203004.GX21636@brightrain.aerifal.cx> X-SA-Exim-Connect-IP: 217.234.153.139 X-SA-Exim-Mail-From: s.gottschall@dd-wrt.com X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on webmail.newmedia-net.de X-Spam-Level: X-Spam-Status: No, score=-2.5 required=4.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,RATWARE_GECKO_BUILD autolearn=no version=3.1.9, No X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: Yes (on webmail.newmedia-net.de) X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1alvAs-0003th-5n X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: s.gottschall@dd-wrt.com X-Received: from [217.234.153.139] (helo=[10.88.193.128]) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1alvAs-0003th-5n for musl@lists.openwall.com; Fri, 01 Apr 2016 11:15:26 +0200 Xref: news.gmane.org gmane.linux.lib.musl.general:9808 Archived-At: I discovered that the whole recvmsg/sendmsg code is broken in mips64 but i found also the solution i throwed out all the _pad1, _pad2 crap in socket.h and the corrosponding code in recvmsg.c etc. and used size_t instead. this works at the end. i see no reason for this padding, since using the correct datatype will handle it in the same way. this solution may also work for other 64 bit targets. so proposal is fixing the datatype instead of using int with padding in case of 64 bit this here is my working struct in mips64 (big endian) struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; size_t msg_iovlen; void *msg_control; size_t msg_controllen; int msg_flags; }; struct cmsghdr { size_t cmsg_len; int cmsg_level; int cmsg_type; }; Sebastian