summary refs log tree commit diff
path: root/include/net/fou.h
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-11-12 11:54:09 -0800
committerDavid S. Miller <davem@davemloft.net>2014-11-12 15:01:35 -0500
commita8c5f90fb59a2d3bff0bd29adbb3e39fe0dd52f8 (patch)
tree49171c0ba2df50c16595901743dad7c0d32a7c33 /include/net/fou.h
parent4243cdc2c1e5a1375cc8397e8f9b06530f099c60 (diff)
downloadlinux-a8c5f90fb59a2d3bff0bd29adbb3e39fe0dd52f8.tar.gz
ip_tunnel: Ops registration for secondary encap (fou, gue)
Instead of calling fou and gue functions directly from ip_tunnel
use ops for these that were previously registered. This patch adds the
logic to add and remove encapsulation operations for ip_tunnel,
and modified fou (and gue) to register with ip_tunnels.

This patch also addresses a circular dependency between ip_tunnel
and fou that was causing link errors when CONFIG_NET_IP_TUNNEL=y
and CONFIG_NET_FOU=m. References to fou an gue have been removed from
ip_tunnel.c

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/fou.h')
-rw-r--r--include/net/fou.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/include/net/fou.h b/include/net/fou.h
index 25b26ffcf1df..19b8a0c62a98 100644
--- a/include/net/fou.h
+++ b/include/net/fou.h
@@ -8,31 +8,12 @@
 #include <net/ip_tunnels.h>
 #include <net/udp.h>
 
+size_t fou_encap_hlen(struct ip_tunnel_encap *e);
+static size_t gue_encap_hlen(struct ip_tunnel_encap *e);
+
 int fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 		     u8 *protocol, struct flowi4 *fl4);
 int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 		     u8 *protocol, struct flowi4 *fl4);
 
-static size_t fou_encap_hlen(struct ip_tunnel_encap *e)
-{
-	return sizeof(struct udphdr);
-}
-
-static size_t gue_encap_hlen(struct ip_tunnel_encap *e)
-{
-	size_t len;
-	bool need_priv = false;
-
-	len = sizeof(struct udphdr) + sizeof(struct guehdr);
-
-	if (e->flags & TUNNEL_ENCAP_FLAG_REMCSUM) {
-		len += GUE_PLEN_REMCSUM;
-		need_priv = true;
-	}
-
-	len += need_priv ? GUE_LEN_PRIV : 0;
-
-	return len;
-}
-
 #endif