[OpenAFS-devel] klog with openafs-snap-2004-08-16 in SuSE-9.1
(linux 2.6.5-7.104)
Sven Menke
Menke@MPPMU.MPG.DE
Sun, 22 Aug 2004 01:15:01 +0200
--DwRSm/96HG
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
Derek Atkins writes:
> This first patch to sock_create() implies the configure test is
> wrong when trying to determine whether sock_create has a fifth
> argument or not. Try fixing the configure test, because I know
> the gatekeepers wont accept this patch as-is.
>
> -derek
>
how about this one then:
--DwRSm/96HG
Content-Type: text/plain
Content-Description: sock_create.patch
Content-Disposition: inline;
filename="sock_create.patch"
Content-Transfer-Encoding: 7bit
--- ../orig/acinclude.m4 2004-08-11 17:45:35.000000000 +0200
+++ acinclude.m4 2004-08-22 00:37:06.924350320 +0200
@@ -185,6 +185,7 @@
LINUX_INODE_SETATTR_RETURN_TYPE
LINUX_KERNEL_LINUX_SYSCALL_H
LINUX_KERNEL_SELINUX
+ LINUX_KERNEL_SOCK_CREATE
LINUX_NEED_RHCONFIG
LINUX_RECALC_SIGPENDING_ARG_TYPE
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
@@ -287,6 +288,9 @@
if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
fi
+ if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
+ AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
+ fi
if test "x$ac_linux_syscall" = "xyes" ; then
AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
fi
--- ../orig/src/cf/linux-test3.m4 2004-06-21 22:06:21.000000000 +0200
+++ src/cf/linux-test3.m4 2004-08-22 00:42:35.000000000 +0200
@@ -94,3 +94,19 @@
ac_cv_linux_kernel_is_selinux=no)])
AC_MSG_RESULT($ac_cv_linux_kernel_is_selinux)
CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_KERNEL_SOCK_CREATE],[
+AC_MSG_CHECKING(for 5th argument in sock_create found in some SELinux kernels)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_kernel_sock_create_v,
+[
+AC_TRY_COMPILE(
+ [#include <linux/net.h>],
+ [
+ sock_create(0,0,0,0,0)
+ ],
+ ac_cv_linux_kernel_sock_create_v=yes,
+ ac_cv_linux_kernel_sock_create_v=no)])
+AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)
+CPPFLAGS="$save_CPPFLAGS"])
--- ../orig/src/rx/LINUX/rx_knet.c 2004-07-29 04:46:48.000000000 +0200
+++ src/rx/LINUX/rx_knet.c 2004-08-22 01:06:31.494094944 +0200
@@ -37,7 +37,7 @@
int code;
-#ifdef LINUX_KERNEL_IS_SELINUX
+#ifdef LINUX_KERNEL_SOCK_CREATE_V
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp, 0);
#else
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp);
--DwRSm/96HG
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
It tests directly for 5 arguments in sock_create from linux/net.h
independent of SELINUX ...
--Sven
--DwRSm/96HG--