File: socket.c

package info (click to toggle)
openvswitch 2.6.2~pre%2Bgit20161223-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 42,772 kB
  • ctags: 37,668
  • sloc: sh: 499,654; ansic: 261,360; xml: 21,326; python: 14,843; makefile: 450; perl: 409
file content (32 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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