#
# RAW4ALL diff for Mac OS X 10.2 / Darwin 6.0
# by peter bartoli, version 2.0 of 9/4/2002
#
# to install
# 1. unpack and cd to your xnu source tree
# 2. patch -p0 -b [--verbose --suffix=.orig] < ETHERSPOOF+RAW4ALL.patch
# 3. build xnu and install your kernel
#
--- bsd/kern/uipc_socket.c.orig	Thu Jul 11 22:03:48 2002
+++ bsd/kern/uipc_socket.c	Wed Sep  4 01:11:22 2002
@@ -391,11 +391,15 @@
 	TAILQ_INIT(&so->so_comp);
 	so->so_type = type;
 
 #ifdef __APPLE__
 	if (p != 0) {
+#ifdef RAW4ALL
+		if (p->p_ucred->cr_uid == 0 || prp->pr_type == SOCK_RAW)
+#else
 		if (p->p_ucred->cr_uid == 0)
+#endif /* RAW4ALL */
 			so->so_state = SS_PRIV;
 
 		so->so_uid = p->p_ucred->cr_uid;
 	}
 #else
