- TESTSUITE=1 KERNEL=3.18.1
- TESTSUITE=1 OPTS="--enable-shared"
- BUILD_ENV="-m32" OPTS="--disable-ssl"
+ - KERNEL=4.2
- KERNEL=4.1.6
- - KERNEL=4.0.9
- KERNEL=3.17.7 DPDK=1
- KERNEL=3.17.7 DPDK=1 OPTS="--enable-shared"
- KERNEL=3.18.21
| 2.1.x | 2.6.32 to 3.11
| 2.3.x | 2.6.32 to 3.14
| 2.4.x | 2.6.32 to 4.0
-| 2.5.x | 2.6.32 to 4.1
+| 2.5.x | 2.6.32 to 4.2
Open vSwitch userspace should also work with the Linux kernel module
built into Linux 3.3 and later.
AC_MSG_RESULT([$kversion])
if test "$version" -ge 4; then
- if test "$version" = 4 && test "$patchlevel" -le 1; then
+ if test "$version" = 4 && test "$patchlevel" -le 2; then
: # Linux 4.x
else
- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.1.x is not supported (please refer to the FAQ for advice)])
+ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.2.x is not supported (please refer to the FAQ for advice)])
fi
elif test "$version" = 3; then
: # Linux 3.x
[OVS_DEFINE([HAVE_INET_GET_LOCAL_PORT_RANGE_USING_NET])])
OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [ip_is_fragment])
+ OVS_GREP_IFELSE([$KSRC/include/linux/net.h], [sock_create_kern.*net],
+ [OVS_DEFINE([HAVE_SOCK_CREATE_KERN_NET])])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_by_index_rcu])
OVS_FIND_FIELD_IFELSE([$KSRC/include/net/genetlink.h],
[genl_multicast_group], [id])
+ OVS_GREP_IFELSE([$KSRC/include/net/geneve.h], [geneve_hdr])
OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_cisco_register])
OVS_GREP_IFELSE([$KSRC/include/net/ipv6.h], [IP6_FH_F_SKIP_RH])
linux/compat/net_namespace.c \
linux/compat/reciprocal_div.c \
linux/compat/skbuff-openvswitch.c \
+ linux/compat/socket.c \
linux/compat/stt.c \
linux/compat/udp.c \
linux/compat/udp_tunnel.c \
#include "compat.h"
#include "gso.h"
-static inline struct genevehdr *geneve_hdr(const struct sk_buff *skb)
-{
- return (struct genevehdr *)(udp_hdr(skb) + 1);
-}
-
static void geneve_build_header(struct genevehdr *geneveh,
__be16 tun_flags, u8 vni[3],
u8 options_len, u8 *options)
})
#endif
+#ifndef HAVE_SOCK_CREATE_KERN_NET
+int ovs_sock_create_kern(struct net *net, int family, int type, int protocol, struct socket **res);
+void ovs_sock_release(struct socket *sock);
+#define sock_create_kern ovs_sock_create_kern
+#define sock_release ovs_sock_release
+#endif
+
#endif
#endif /* kernel < 4.0 */
+#ifndef HAVE_GENEVE_HDR
+static inline struct genevehdr *geneve_hdr(const struct sk_buff *skb)
+{
+ return (struct genevehdr *)(udp_hdr(skb) + 1);
+}
+#endif
+
#endif /*ifdef__NET_GENEVE_WRAPPER_H */
--- /dev/null
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/socket.h>
+#include <linux/udp.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <net/ip_tunnels.h>
+#include <net/udp.h>
+#include <net/udp_tunnel.h>
+#include <net/net_namespace.h>
+
+
+#ifndef HAVE_SOCK_CREATE_KERN_NET
+#undef sock_create_kern
+
+int ovs_sock_create_kern(struct net *net, int family, int type, int protocol, struct socket **res)
+{
+ int err;
+
+ err = sock_create_kern(family, type, protocol, res);
+ if (err < 0)
+ return err;
+
+ sk_change_net((*res)->sk, net);
+ return err;
+}
+#undef sk_release_kernel
+void ovs_sock_release(struct socket *sock)
+{
+ sk_release_kernel(sock->sk);
+}
+#endif
#include <linux/list.h>
#include <linux/log2.h>
#include <linux/module.h>
+#include <linux/net.h>
#include <linux/netfilter.h>
#include <linux/percpu.h>
#include <linux/skbuff.h>
static void tcp_sock_release(struct socket *sock)
{
kernel_sock_shutdown(sock, SHUT_RDWR);
- sk_release_kernel(sock->sk);
+ sock_release(sock);
}
static int tcp_sock_create4(struct net *net, __be16 port,
struct socket *sock = NULL;
int err;
- err = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+ err = sock_create_kern(net, AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
if (err < 0)
goto error;
- sk_change_net(sock->sk, net);
-
memset(&tcp_addr, 0, sizeof(tcp_addr));
tcp_addr.sin_family = AF_INET;
tcp_addr.sin_addr.s_addr = htonl(INADDR_ANY);
if (cfg->family == AF_INET6) {
struct sockaddr_in6 udp6_addr;
- err = sock_create_kern(AF_INET6, SOCK_DGRAM, 0, &sock);
+ err = sock_create_kern(net, AF_INET6, SOCK_DGRAM, 0, &sock);
if (err < 0)
goto error;
- sk_change_net(sock->sk, net);
-
udp6_addr.sin6_family = AF_INET6;
memcpy(&udp6_addr.sin6_addr, &cfg->local_ip6,
sizeof(udp6_addr.sin6_addr));
if (cfg->family == AF_INET) {
struct sockaddr_in udp_addr;
- err = sock_create_kern(AF_INET, SOCK_DGRAM, 0, &sock);
+ err = sock_create_kern(net, AF_INET, SOCK_DGRAM, 0, &sock);
if (err < 0)
goto error;
- sk_change_net(sock->sk, net);
-
udp_addr.sin_family = AF_INET;
udp_addr.sin_addr = cfg->local_ip;
udp_addr.sin_port = cfg->local_udp_port;
error:
if (sock) {
kernel_sock_shutdown(sock, SHUT_RDWR);
- sk_release_kernel(sock->sk);
+ sock_release(sock);
}
*sockp = NULL;
return err;
{
rcu_assign_sk_user_data(sock->sk, NULL);
kernel_sock_shutdown(sock, SHUT_RDWR);
- sk_release_kernel(sock->sk);
+ sock_release(sock);
}
EXPORT_SYMBOL_GPL(rpl_udp_tunnel_sock_release);
return vport_priv(vport);
}
-static inline struct genevehdr *geneve_hdr(const struct sk_buff *skb)
-{
- return (struct genevehdr *)(udp_hdr(skb) + 1);
-}
-
/* Convert 64 bit tunnel ID to 24 bit VNI. */
static void tunnel_id_to_vni(__be64 tun_id, __u8 *vni)
{