build_modules += $(if $(BUILD_GRE),ip_gre)
ip_gre_sources = \
linux-2.6/compat-2.6/ip_gre.c \
+ linux-2.6/compat-2.6/ip_output-ip_gre.c \
linux-2.6/compat-2.6/net_namespace-ip_gre.c
ip_gre_headers = \
linux-2.6/compat-2.6/compat26.h \
linux-2.6/compat-2.6/include/linux/tcp.h \
linux-2.6/compat-2.6/include/linux/types.h \
linux-2.6/compat-2.6/include/net/dst.h \
+ linux-2.6/compat-2.6/include/net/ip.h \
linux-2.6/compat-2.6/include/net/ipip.h \
linux-2.6/compat-2.6/include/net/netns/generic.h \
linux-2.6/compat-2.6/include/net/net_namespace.h \
#define for_each_netdev(net,d) list_for_each_entry(d, &dev_base_head, dev_list)
#endif
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e))
+#endif
#endif
--- /dev/null
+#ifndef __NET_IP_WRAPPER_H
+#define __NET_IP_WRAPPER_H 1
+
+#include_next <net/ip.h>
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+
+extern int __ip_local_out(struct sk_buff *skb);
+extern int ip_local_out(struct sk_buff *skb);
+
+#endif /* linux kernel < 2.6.25 */
+
+#endif
spinlock_t lock;
};
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
#define IPTUNNEL_XMIT() do { \
int err; \
int pkt_len = skb->len - skb_transport_offset(skb); \
\
skb->ip_summed = CHECKSUM_NONE; \
- iph->tot_len = htons(skb->len); \
- ip_select_ident(iph, &rt->u.dst, NULL); \
- ip_send_check(iph); \
- \
- err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\
- if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) { \
- stats->tx_bytes += pkt_len; \
- stats->tx_packets++; \
- } else { \
- stats->tx_errors++; \
- stats->tx_aborted_errors++; \
- } \
-} while (0)
-#else
-#define IPTUNNEL_XMIT() do { \
- int err; \
- int pkt_len = skb->len; \
- \
- skb->ip_summed = CHECKSUM_NONE; \
ip_select_ident(iph, &rt->u.dst, NULL); \
\
err = ip_local_out(skb); \
stats->tx_aborted_errors++; \
} \
} while (0)
-#endif
#else
#include_next <net/ipip.h>
--- /dev/null
+#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 */