]> err.no Git - linux-2.6/blobdiff - net/ipv6/xfrm6_policy.c
[XFRM]: Add XFRM_MODE_xxx for future use.
[linux-2.6] / net / ipv6 / xfrm6_policy.c
index 88c840f1beb678a373284799dc6f8a693fd89544..81355bb5032826a8205567a5a43bc65497223ef1 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <net/addrconf.h>
 #include <net/xfrm.h>
@@ -23,8 +22,6 @@
 static struct dst_ops xfrm6_dst_ops;
 static struct xfrm_policy_afinfo xfrm6_policy_afinfo;
 
-static struct xfrm_type_map xfrm6_type_map = { .lock = RW_LOCK_UNLOCKED };
-
 static int xfrm6_dst_lookup(struct xfrm_dst **dst, struct flowi *fl)
 {
        int err = 0;
@@ -117,7 +114,7 @@ __xfrm6_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 = (struct in6_addr*)&xfrm[i]->id.daddr;
                        local  = (struct in6_addr*)&xfrm[i]->props.saddr;
                        tunnel = 1;
@@ -249,9 +246,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
 
 static inline int xfrm6_garbage_collect(void)
 {
-       read_lock(&xfrm6_policy_afinfo.lock);
        xfrm6_policy_afinfo.garbage_collect();
-       read_unlock(&xfrm6_policy_afinfo.lock);
        return (atomic_read(&xfrm6_dst_ops.entries) > xfrm6_dst_ops.gc_thresh*2);
 }
 
@@ -311,8 +306,6 @@ static struct dst_ops xfrm6_dst_ops = {
 
 static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
        .family =               AF_INET6,
-       .lock =                 RW_LOCK_UNLOCKED,
-       .type_map =             &xfrm6_type_map,
        .dst_ops =              &xfrm6_dst_ops,
        .dst_lookup =           xfrm6_dst_lookup,
        .find_bundle =          __xfrm6_find_bundle,