Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2016 18:31:44 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309018 - head/sys/kern
Message-ID:  <201611221831.uAMIViaL077908@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Tue Nov 22 18:31:43 2016
New Revision: 309018
URL: https://svnweb.freebsd.org/changeset/base/309018

Log:
  Revert r306186 ("Adjust the sopt_val pointer on bigendian systems").
  
  This logic doesn't work with bigger sopt_valsize (e.g. when ipfw
  passing 2048 bytes rule).
  
  Reported by:	adrian
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Tue Nov 22 18:13:46 2016	(r309017)
+++ head/sys/kern/uipc_socket.c	Tue Nov 22 18:31:43 2016	(r309018)
@@ -2455,12 +2455,8 @@ sooptcopyin(struct sockopt *sopt, void *
 	 */
 	if ((valsize = sopt->sopt_valsize) < minlen)
 		return EINVAL;
-	if (valsize > len) {
-#if _BYTE_ORDER == _BIG_ENDIAN
-		sopt->sopt_val = (void *)((uintptr_t)sopt->sopt_val + (valsize - len));
-#endif
+	if (valsize > len)
 		sopt->sopt_valsize = valsize = len;
-	}
 
 	if (sopt->sopt_td != NULL)
 		return (copyin(sopt->sopt_val, buf, valsize));



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