aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-03-28 04:12:13 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-28 20:02:46 -0500
commitd2acc3479cbccd5cfbca6c787be713ef1de12ec6 (patch)
treeaa348e19e15027db9abdd2da175a0c9055047858 /include/net
parentf0088a50e7c49d1ba285c88fe06345f223652fd3 (diff)
[INET]: Introduce tunnel4/tunnel6
Basically this patch moves the generic tunnel protocol stuff out of xfrm4_tunnel/xfrm6_tunnel and moves it into the new files of tunnel4.c and tunnel6 respectively. The reason for this is that the problem that Hugo uncovered is only the tip of the iceberg. The real problem is that when we removed the dependency of ipip on xfrm4_tunnel we didn't really consider the module case at all. For instance, as it is it's possible to build both ipip and xfrm4_tunnel as modules and if the latter is loaded then ipip simply won't load. After considering the alternatives I've decided that the best way out of this is to restore the dependency of ipip on the non-xfrm-specific part of xfrm4_tunnel. This is acceptable IMHO because the intention of the removal was really to be able to use ipip without the xfrm subsystem. This is still preserved by this patch. So now both ipip/xfrm4_tunnel depend on the new tunnel4.c which handles the arbitration between the two. The order of processing is determined by a simple integer which ensures that ipip gets processed before xfrm4_tunnel. The situation for ICMP handling is a little bit more complicated since we may not have enough information to determine who it's for. It's not a big deal at the moment since the xfrm ICMP handlers are basically no-ops. In future we can deal with this when we look at ICMP caching in general. The user-visible change to this is the removal of the TUNNEL Kconfig prompts. This makes sense because it can only be used through IPCOMP as it stands. The addition of the new modules shouldn't introduce any problems since module dependency will cause them to be loaded. Oh and I also turned some unnecessary pskb's in IPv6 related to this patch to skb's. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xfrm.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 61b7504fc2ba..e100291e43f4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -864,13 +864,19 @@ struct xfrm_algo_desc {
864/* XFRM tunnel handlers. */ 864/* XFRM tunnel handlers. */
865struct xfrm_tunnel { 865struct xfrm_tunnel {
866 int (*handler)(struct sk_buff *skb); 866 int (*handler)(struct sk_buff *skb);
867 void (*err_handler)(struct sk_buff *skb, __u32 info); 867 int (*err_handler)(struct sk_buff *skb, __u32 info);
868
869 struct xfrm_tunnel *next;
870 int priority;
868}; 871};
869 872
870struct xfrm6_tunnel { 873struct xfrm6_tunnel {
871 int (*handler)(struct sk_buff **pskb); 874 int (*handler)(struct sk_buff *skb);
872 void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, 875 int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
873 int type, int code, int offset, __u32 info); 876 int type, int code, int offset, __u32 info);
877
878 struct xfrm6_tunnel *next;
879 int priority;
874}; 880};
875 881
876extern void xfrm_init(void); 882extern void xfrm_init(void);
@@ -906,7 +912,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
906extern int xfrm4_output(struct sk_buff *skb); 912extern int xfrm4_output(struct sk_buff *skb);
907extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); 913extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
908extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); 914extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
909extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi); 915extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi);
910extern int xfrm6_rcv(struct sk_buff **pskb); 916extern int xfrm6_rcv(struct sk_buff **pskb);
911extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); 917extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
912extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); 918extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);