]> err.no Git - linux-2.6/blobdiff - net/xfrm/xfrm_algo.c
[IPSEC]: Add compatibility algorithm name support
[linux-2.6] / net / xfrm / xfrm_algo.c
index 2f4531fcaca23d43e8b49702b84dd5288acedf1e..b68974b387416c31e00b986e397e50b01e722b97 100644 (file)
@@ -9,7 +9,6 @@
  * any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
@@ -360,7 +359,8 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
                return NULL;
 
        for (i = 0; i < entries; i++) {
-               if (strcmp(name, list[i].name))
+               if (strcmp(name, list[i].name) &&
+                   (!list[i].compat || strcmp(name, list[i].compat)))
                        continue;
 
                if (list[i].available)
@@ -540,8 +540,7 @@ void skb_icv_walk(const struct sk_buff *skb, struct crypto_tfm *tfm,
                        start = end;
                }
        }
-       if (len)
-               BUG();
+       BUG_ON(len);
 }
 EXPORT_SYMBOL_GPL(skb_icv_walk);
 
@@ -610,8 +609,7 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
                        start = end;
                }
        }
-       if (len)
-               BUG();
+       BUG_ON(len);
        return elt;
 }
 EXPORT_SYMBOL_GPL(skb_to_sgvec);