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

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