010-sys-socket.h-fix-SO_PEERSEC-value-on-MIPS.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From 4e0877a604bad684be020f68e96a05156131fd44 Mon Sep 17 00:00:00 2001
  2. From: Matthias Schiffer <[email protected]>
  3. Date: Sun, 24 Jun 2018 17:05:31 +0200
  4. Subject: [PATCH] sys/socket.h: fix SO_PEERSEC value on MIPS
  5. Differing from all other archs supported by musl, MIPS defines SO_PEERSEC
  6. to 30 instead of 31.
  7. Reported-by: Andrey Jr. Mlenikov <[email protected]>
  8. ---
  9. arch/mips/bits/socket.h | 2 ++
  10. arch/mips64/bits/socket.h | 2 ++
  11. arch/mipsn32/bits/socket.h | 2 ++
  12. include/sys/socket.h | 3 +++
  13. 4 files changed, 9 insertions(+)
  14. --- a/arch/mips/bits/socket.h
  15. +++ b/arch/mips/bits/socket.h
  16. @@ -48,5 +48,7 @@ struct cmsghdr {
  17. #define SO_SNDBUFFORCE 31
  18. #define SO_RCVBUFFORCE 33
  19. +#define SO_PEERSEC 30
  20. +
  21. #define SOCK_NONBLOCK 0200
  22. #define SOCK_CLOEXEC 02000000
  23. --- a/arch/mips64/bits/socket.h
  24. +++ b/arch/mips64/bits/socket.h
  25. @@ -64,5 +64,7 @@ struct cmsghdr {
  26. #define SO_SNDBUFFORCE 31
  27. #define SO_RCVBUFFORCE 33
  28. +#define SO_PEERSEC 30
  29. +
  30. #define SOCK_NONBLOCK 0200
  31. #define SOCK_CLOEXEC 02000000
  32. --- a/arch/mipsn32/bits/socket.h
  33. +++ b/arch/mipsn32/bits/socket.h
  34. @@ -48,5 +48,7 @@ struct cmsghdr {
  35. #define SO_SNDBUFFORCE 31
  36. #define SO_RCVBUFFORCE 33
  37. +#define SO_PEERSEC 30
  38. +
  39. #define SOCK_NONBLOCK 0200
  40. #define SOCK_CLOEXEC 02000000
  41. --- a/include/sys/socket.h
  42. +++ b/include/sys/socket.h
  43. @@ -201,7 +201,10 @@ struct linger {
  44. #define SO_TIMESTAMP 29
  45. #define SCM_TIMESTAMP SO_TIMESTAMP
  46. +#ifndef SO_PEERSEC
  47. #define SO_PEERSEC 31
  48. +#endif
  49. +
  50. #define SO_PASSSEC 34
  51. #define SO_TIMESTAMPNS 35
  52. #define SCM_TIMESTAMPNS SO_TIMESTAMPNS