Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 1 Apr 2016 11:49:20 +0200
From: Szabolcs Nagy <>
Subject: Re: recvmsg/sendmsg broken on mips64

* Sebastian Gottschall <> [2016-04-01 11:16:20 +0200]:
> 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

the padding is needed, i think __BIG_ENDIAN
or __LITTLE_ENDIAN might not be defined properly.

your fix is non-conforming and breaks both abi and api,
the definition must match

> 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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.