Blame SOURCES/1269549-mpo-7.3.0-socket.7.patch

31e40a
From 9dcfa5bda8c03d0acecd87953ebfc78372bb9755 Mon Sep 17 00:00:00 2001
31e40a
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
31e40a
Date: Tue, 28 Jun 2016 13:02:45 +0200
31e40a
Subject: [PATCH 07/17] socket.7: document SO_REUSEPORT option
31e40a
31e40a
---
31e40a
 man-pages/man7/socket.7 | 33 +++++++++++++++++++++++++++++++++
31e40a
 1 file changed, 33 insertions(+)
31e40a
31e40a
diff --git a/man-pages/man7/socket.7 b/man-pages/man7/socket.7
31e40a
index 17bd0c3..94c98b6 100644
31e40a
--- a/man-pages/man7/socket.7
31e40a
+++ b/man-pages/man7/socket.7
31e40a
@@ -649,6 +649,39 @@ with a specific port then it is not possible
31e40a
 to bind to this port for any local address.
31e40a
 Argument is an integer boolean flag.
31e40a
 .TP
31e40a
+.BR SO_REUSEPORT
31e40a
+Permits multiple
31e40a
+.B AF_INET
31e40a
+or
31e40a
+.B AF_INET6
31e40a
+sockets to be bound to an identical socket address.
31e40a
+This option must be set on each socket (including the first socket)
31e40a
+prior to calling
31e40a
+.BR bind (2)
31e40a
+on the socket.
31e40a
+To prevent port hijacking,
31e40a
+all of the processes binding to the same address must have the same
31e40a
+effective UID.
31e40a
+This option can be employed with both TCP and UDP sockets.
31e40a
+
31e40a
+For TCP sockets, this option allows
31e40a
+.BR accept (2)
31e40a
+load distribution in a multi-threaded server to be improved by
31e40a
+using a distinct listener socket for each thread.
31e40a
+This provides improved load distribution as compared
31e40a
+to traditional techniques such using a single
31e40a
+.BR accept (2)ing
31e40a
+thread that distributes connections,
31e40a
+or having multiple threads that compete to
31e40a
+.BR accept (2)
31e40a
+from the same socket.
31e40a
+
31e40a
+For UDP sockets,
31e40a
+the use of this option can provide better distribution
31e40a
+of incoming datagrams to multiple processes (or threads) as compared
31e40a
+to the traditional technique of having multiple processes
31e40a
+compete to receive datagrams on the same socket.
31e40a
+.TP
31e40a
 .B SO_SNDBUF
31e40a
 Sets or gets the maximum socket send buffer in bytes.
31e40a
 The kernel doubles this value (to allow space for bookkeeping overhead)
31e40a
-- 
31e40a
2.7.4
31e40a