mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] sys/socket.h: fix SO_PEERSEC value on MIPS
Date: Sun, 24 Jun 2018 11:30:20 -0400	[thread overview]
Message-ID: <20180624153019.GT1392@brightrain.aerifal.cx> (raw)
In-Reply-To: <4e0877a604bad684be020f68e96a05156131fd44.1529853403.git.mschiffer@universe-factory.net>

On Sun, Jun 24, 2018 at 05:18:39PM +0200, Matthias Schiffer wrote:
> Differing from all other archs supported by musl, MIPS defines SO_PEERSEC
> to 30 instead of 31.
> 
> Reported-by: Andrey Jr. Mlenikov <temnota.am@gmail.com>
> ---
>  arch/mips/bits/socket.h    | 2 ++
>  arch/mips64/bits/socket.h  | 2 ++
>  arch/mipsn32/bits/socket.h | 2 ++
>  include/sys/socket.h       | 3 +++
>  4 files changed, 9 insertions(+)
> 
> diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h
> index 191ebdb5a418..39c42b822ac3 100644
> --- a/arch/mips/bits/socket.h
> +++ b/arch/mips/bits/socket.h
> @@ -48,5 +48,7 @@ struct cmsghdr {
>  #define SO_SNDBUFFORCE  31
>  #define SO_RCVBUFFORCE  33
>  
> +#define SO_PEERSEC      30
> +
>  #define SOCK_NONBLOCK     0200
>  #define SOCK_CLOEXEC  02000000
> diff --git a/arch/mips64/bits/socket.h b/arch/mips64/bits/socket.h
> index cf801797beb0..39b764df4c62 100644
> --- a/arch/mips64/bits/socket.h
> +++ b/arch/mips64/bits/socket.h
> @@ -64,5 +64,7 @@ struct cmsghdr {
>  #define SO_SNDBUFFORCE  31
>  #define SO_RCVBUFFORCE  33
>  
> +#define SO_PEERSEC      30
> +
>  #define SOCK_NONBLOCK     0200
>  #define SOCK_CLOEXEC  02000000
> diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h
> index 191ebdb5a418..39c42b822ac3 100644
> --- a/arch/mipsn32/bits/socket.h
> +++ b/arch/mipsn32/bits/socket.h
> @@ -48,5 +48,7 @@ struct cmsghdr {
>  #define SO_SNDBUFFORCE  31
>  #define SO_RCVBUFFORCE  33
>  
> +#define SO_PEERSEC      30
> +
>  #define SOCK_NONBLOCK     0200
>  #define SOCK_CLOEXEC  02000000
> diff --git a/include/sys/socket.h b/include/sys/socket.h
> index 507da5cc2a40..6b6cf2fc3988 100644
> --- a/include/sys/socket.h
> +++ b/include/sys/socket.h
> @@ -203,7 +203,10 @@ struct linger {
>  #define SO_TIMESTAMP            29
>  #define SCM_TIMESTAMP           SO_TIMESTAMP
>  
> +#ifndef SO_PEERSEC
>  #define SO_PEERSEC              31
> +#endif
> +
>  #define SO_PASSSEC              34
>  #define SO_TIMESTAMPNS          35
>  #define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
> -- 
> 2.18.0

Should we perhaps do this under the SO_DEBUG conditional like all the
other SO_* that vary by arch? Doing so would require adding
definitions to the other weird archs (ibm ones) but might be cleaner
in the top-level header -- I'm not sure.

Rich


  reply	other threads:[~2018-06-24 15:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-24 15:18 Matthias Schiffer
2018-06-24 15:30 ` Rich Felker [this message]
2018-06-25 17:52   ` Matthias Schiffer
2018-06-26 18:21     ` Matthias Schiffer
2018-06-26 20:05       ` Rich Felker
2018-06-26 20:20         ` Matthias Schiffer
2018-06-26 20:28           ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180624153019.GT1392@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).