summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-06-24 17:20:43 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-06-24 17:28:50 +0200
commita63e38ba46a58cfb9001ddda3e68cf0548832eb5 (patch)
tree5b0ab56c85ebdbe0511cff97162167ae7ecf06a1
parent286a456319a1ec5cb54bf30defa5c8efd4a667cf (diff)
downloadmtk-20170518-a63e38ba46a58cfb9001ddda3e68cf0548832eb5.zip
mtk-20170518-a63e38ba46a58cfb9001ddda3e68cf0548832eb5.tar.gz
mtk-20170518-a63e38ba46a58cfb9001ddda3e68cf0548832eb5.tar.bz2
musl: 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. Patch has also been submitted upstream. Reported-by: Andrey Jr. Mlenikov <temnota.am@gmail.com> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> (cherry picked from commit 4b50854a60fce73aa83b50c445ea93970322d442)
-rw-r--r--toolchain/musl/patches/010-sys-socket.h-fix-SO_PEERSEC-value-on-MIPS.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/toolchain/musl/patches/010-sys-socket.h-fix-SO_PEERSEC-value-on-MIPS.patch b/toolchain/musl/patches/010-sys-socket.h-fix-SO_PEERSEC-value-on-MIPS.patch
new file mode 100644
index 0000000..2319d9c
--- /dev/null
+++ b/toolchain/musl/patches/010-sys-socket.h-fix-SO_PEERSEC-value-on-MIPS.patch
@@ -0,0 +1,59 @@
+From 4e0877a604bad684be020f68e96a05156131fd44 Mon Sep 17 00:00:00 2001
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sun, 24 Jun 2018 17:05:31 +0200
+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@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(+)
+
+--- 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
+--- 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
+--- 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
+--- a/include/sys/socket.h
++++ b/include/sys/socket.h
+@@ -201,7 +201,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