Linux 4.2: Pass namespace to sock_create_kern

sock_create_kern gains an additional network namespace
argument.

Pass in the default system namesapce.

Change-Id: I640e9497510242788e5060759779785ffb563a81
Reviewed-on: http://gerrit.openafs.org/11925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Marc Dionne 2015-07-08 14:32:31 -03:00 committed by Jeffrey Altman
parent 4ef47f787a
commit e597b87967
2 changed files with 6 additions and 1 deletions

View File

@ -1053,6 +1053,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
AC_CHECK_LINUX_FUNC([sock_create_kern], AC_CHECK_LINUX_FUNC([sock_create_kern],
[#include <linux/net.h>], [#include <linux/net.h>],
[sock_create_kern(0, 0, 0, NULL);]) [sock_create_kern(0, 0, 0, NULL);])
AC_CHECK_LINUX_FUNC([sock_create_kern_ns],
[#include <linux/net.h>],
[sock_create_kern(NULL, 0, 0, 0, NULL);])
AC_CHECK_LINUX_FUNC([splice_direct_to_actor], AC_CHECK_LINUX_FUNC([splice_direct_to_actor],
[#include <linux/splice.h>], [#include <linux/splice.h>],
[splice_direct_to_actor(NULL,NULL,NULL);]) [splice_direct_to_actor(NULL,NULL,NULL);])

View File

@ -48,7 +48,9 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
int pmtu = IP_PMTUDISC_DONT; int pmtu = IP_PMTUDISC_DONT;
#endif #endif
#ifdef HAVE_LINUX_SOCK_CREATE_KERN #ifdef HAVE_LINUX_SOCK_CREATE_KERN_NS
code = sock_create_kern(&init_net, AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp);
#elif defined(HAVE_LINUX_SOCK_CREATE_KERN)
code = sock_create_kern(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp); code = sock_create_kern(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp);
#elif defined(LINUX_KERNEL_SOCK_CREATE_V) #elif defined(LINUX_KERNEL_SOCK_CREATE_V)
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp, 0); code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp, 0);