File: ip_output-openvswitch.c

package info (click to toggle)
openvswitch 1.4.2%2Bgit20120612-9.1~deb7u1.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 21,072 kB
  • sloc: sh: 115,076; ansic: 99,733; python: 12,294; xml: 2,566; perl: 674; makefile: 344; pascal: 81
file content (33 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
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
33
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)

#include <linux/netfilter_ipv4.h>
#include <net/ip.h>

int __ip_local_out(struct sk_buff *skb)
{
	struct iphdr *iph = ip_hdr(skb);

	iph->tot_len = htons(skb->len);
	ip_send_check(iph);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
	return nf_hook(PF_INET, NF_IP_LOCAL_OUT, &skb, NULL, skb->dst->dev,
		       dst_output);
#else
	return nf_hook(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, skb->dst->dev,
		       dst_output);
#endif /* kernel < 2.6.24 */
}

int ip_local_out(struct sk_buff *skb)
{
	int err;

	err = __ip_local_out(skb);
	if (likely(err == 1))
		err = dst_output(skb);

	return err;
}

#endif /* kernel < 2.6.25 */