[XFRM]: Add XFRM_MODE_xxx for future use.
[sfrench/cifs-2.6.git] / net / ipv4 / xfrm4_policy.c
index 8604c747bca5fa3d1353159e906ddfcec0da1290..a5bed741de2c1e65f262c7bcfd3086084792d716 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/inetdevice.h>
 #include <net/xfrm.h>
 #include <net/ip.h>
@@ -17,8 +16,6 @@
 static struct dst_ops xfrm4_dst_ops;
 static struct xfrm_policy_afinfo xfrm4_policy_afinfo;
 
-static struct xfrm_type_map xfrm4_type_map = { .lock = RW_LOCK_UNLOCKED };
-
 static int xfrm4_dst_lookup(struct xfrm_dst **dst, struct flowi *fl)
 {
        return __ip_route_output_key((struct rtable**)dst, fl);
@@ -99,7 +96,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 
                dst1->next = dst_prev;
                dst_prev = dst1;
-               if (xfrm[i]->props.mode) {
+               if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
                        remote = xfrm[i]->id.daddr.a4;
                        local  = xfrm[i]->props.saddr.a4;
                        tunnel = 1;
@@ -237,9 +234,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
 
 static inline int xfrm4_garbage_collect(void)
 {
-       read_lock(&xfrm4_policy_afinfo.lock);
        xfrm4_policy_afinfo.garbage_collect();
-       read_unlock(&xfrm4_policy_afinfo.lock);
        return (atomic_read(&xfrm4_dst_ops.entries) > xfrm4_dst_ops.gc_thresh*2);
 }
 
@@ -299,8 +294,6 @@ static struct dst_ops xfrm4_dst_ops = {
 
 static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
        .family =               AF_INET,
-       .lock =                 RW_LOCK_UNLOCKED,
-       .type_map =             &xfrm4_type_map,
        .dst_ops =              &xfrm4_dst_ops,
        .dst_lookup =           xfrm4_dst_lookup,
        .find_bundle =          __xfrm4_find_bundle,