a09fcbce4c2e9edd8ec1f619786d2bcb45e27ab2
[sliver-openvswitch.git] / datapath / linux / compat / ip_output-openvswitch.c
1 #include <linux/version.h>
2 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
3
4 #include <linux/netfilter_ipv4.h>
5 #include <net/ip.h>
6
7 int __ip_local_out(struct sk_buff *skb)
8 {
9         struct iphdr *iph = ip_hdr(skb);
10
11         iph->tot_len = htons(skb->len);
12         ip_send_check(iph);
13 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
14         return nf_hook(PF_INET, NF_IP_LOCAL_OUT, &skb, NULL, skb->dst->dev,
15                        dst_output);
16 #else
17         return nf_hook(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, skb->dst->dev,
18                        dst_output);
19 #endif /* kernel < 2.6.24 */
20 }
21
22 int ip_local_out(struct sk_buff *skb)
23 {
24         int err;
25
26         err = __ip_local_out(skb);
27         if (likely(err == 1))
28                 err = dst_output(skb);
29
30         return err;
31 }
32
33 #endif /* kernel < 2.6.25 */