svn commit: r309018 - head/sys/kern

Ruslan Bukin br at FreeBSD.org
Tue Nov 22 18:31:45 UTC 2016


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));


More information about the svn-src-head mailing list