Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c35b7e72cd48bc7163b6900fb3689fa54b572bba
Commit:     c35b7e72cd48bc7163b6900fb3689fa54b572bba
Parent:     75314fb38364c81a573cd222f74d792409a7afba
Author:     Daniel Lezcano <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 8 00:14:11 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:56:59 2008 -0800

    [IPV6]: remove ifdef in route6 for xfrm6
    
    The following patch create the usual static inline functions to disable
    the xfrm6_init and xfrm6_fini function when XFRM is off.
    That's allow to remove some ifdef and make the code a little more clear.
    
    Signed-off-by: Daniel Lezcano <[EMAIL PROTECTED]>
    Acked-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/xfrm.h |   16 +++++++++++++---
 net/ipv6/route.c   |    7 +------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1826092..503d0d2 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -842,7 +842,6 @@ xfrm_state_addr_cmp(struct xfrm_tmpl *tmpl, struct 
xfrm_state *x, unsigned short
 }
 
 #ifdef CONFIG_XFRM
-
 extern int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, 
unsigned short family);
 
 static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff 
*skb, unsigned short family)
@@ -1066,12 +1065,23 @@ struct xfrm6_tunnel {
 
 extern void xfrm_init(void);
 extern void xfrm4_init(void);
-extern int xfrm6_init(void);
-extern void xfrm6_fini(void);
 extern void xfrm_state_init(void);
 extern void xfrm4_state_init(void);
+#ifdef CONFIG_XFRM
+extern int xfrm6_init(void);
+extern void xfrm6_fini(void);
 extern int xfrm6_state_init(void);
 extern void xfrm6_state_fini(void);
+#else
+static inline int xfrm6_init(void)
+{
+       return 0;
+}
+static inline void xfrm6_fini(void)
+{
+       ;
+}
+#endif
 
 extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, 
void*), void *);
 extern struct xfrm_state *xfrm_state_alloc(void);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index dbdae14..c4e890a 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2522,11 +2522,10 @@ int __init ip6_route_init(void)
        if (ret)
                goto out_fib6_init;
 
-#ifdef CONFIG_XFRM
        ret = xfrm6_init();
        if (ret)
                goto out_proc_init;
-#endif
+
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
        ret = fib6_rules_init();
        if (ret)
@@ -2547,9 +2546,7 @@ fib6_rules_init:
        fib6_rules_cleanup();
 xfrm6_init:
 #endif
-#ifdef CONFIG_XFRM
        xfrm6_fini();
-#endif
 out_proc_init:
        ipv6_route_proc_fini(&init_net);
 out_fib6_init:
@@ -2566,9 +2563,7 @@ void ip6_route_cleanup(void)
        fib6_rules_cleanup();
 #endif
        ipv6_route_proc_fini(&init_net);
-#ifdef CONFIG_XFRM
        xfrm6_fini();
-#endif
        rt6_ifdown(NULL);
        fib6_gc_cleanup();
        kmem_cache_destroy(ip6_dst_ops.kmem_cachep);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to