Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2017 07:44:43 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321325 - head/sys/kern
Message-ID:  <201707210744.v6L7ihrD092735@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri Jul 21 07:44:43 2017
New Revision: 321325
URL: https://svnweb.freebsd.org/changeset/base/321325

Log:
  Fix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
  SO_SNDLOWAT, SO_RCVLOWAT. Since r31972 it only worked for non-listening
  sockets.
  
  Sponsored by:	Netflix, Inc.

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Fri Jul 21 06:56:06 2017	(r321324)
+++ head/sys/kern/uipc_socket.c	Fri Jul 21 07:44:43 2017	(r321325)
@@ -3020,19 +3020,23 @@ integer:
 			goto integer;
 
 		case SO_SNDBUF:
-			optval = so->so_snd.sb_hiwat;
+			optval = SOLISTENING(so) ? so->sol_sbsnd_hiwat :
+			    so->so_snd.sb_hiwat;
 			goto integer;
 
 		case SO_RCVBUF:
-			optval = so->so_rcv.sb_hiwat;
+			optval = SOLISTENING(so) ? so->sol_sbrcv_hiwat :
+			    so->so_rcv.sb_hiwat;
 			goto integer;
 
 		case SO_SNDLOWAT:
-			optval = so->so_snd.sb_lowat;
+			optval = SOLISTENING(so) ? so->sol_sbsnd_lowat :
+			    so->so_snd.sb_lowat;
 			goto integer;
 
 		case SO_RCVLOWAT:
-			optval = so->so_rcv.sb_lowat;
+			optval = SOLISTENING(so) ? so->sol_sbrcv_lowat :
+			    so->so_rcv.sb_lowat;
 			goto integer;
 
 		case SO_SNDTIMEO:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707210744.v6L7ihrD092735>