Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <4e0877a604bad684be020f68e96a05156131fd44.1529853403.git.mschiffer@universe-factory.net>
Date: Sun, 24 Jun 2018 17:18:39 +0200
From: Matthias Schiffer <mschiffer@...verse-factory.net>
To: musl@...ts.openwall.com
Subject: [PATCH] sys/socket.h: fix SO_PEERSEC value on MIPS

Differing from all other archs supported by musl, MIPS defines SO_PEERSEC
to 30 instead of 31.

Reported-by: Andrey Jr. Mlenikov <temnota.am@...il.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

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.