]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/xfrm/xfrm_algo.c
[IPV4]: Check fib4_rules_init failure.
[linux-2.6-omap-h63xx.git] / net / xfrm / xfrm_algo.c
index 8a72def25a3479f5807e31f014aecdb48fdf4d68..b5c5347aed666096c33d0fadbbab0065753ddd08 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/pfkeyv2.h>
 #include <linux/crypto.h>
+#include <linux/scatterlist.h>
 #include <net/xfrm.h>
 #if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE)
 #include <net/ah.h>
@@ -20,7 +21,6 @@
 #if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE)
 #include <net/esp.h>
 #endif
-#include <asm/scatterlist.h>
 
 /*
  * Algorithms supported by IPsec.  These entries contain properties which
@@ -407,27 +407,27 @@ static struct xfrm_algo_desc *xfrm_find_algo(
 static int xfrm_alg_id_match(const struct xfrm_algo_desc *entry,
                             const void *data)
 {
-       return entry->desc.sadb_alg_id == (int)data;
+       return entry->desc.sadb_alg_id == (unsigned long)data;
 }
 
 struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id)
 {
        return xfrm_find_algo(&xfrm_aalg_list, xfrm_alg_id_match,
-                             (void *)alg_id, 1);
+                             (void *)(unsigned long)alg_id, 1);
 }
 EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid);
 
 struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id)
 {
        return xfrm_find_algo(&xfrm_ealg_list, xfrm_alg_id_match,
-                             (void *)alg_id, 1);
+                             (void *)(unsigned long)alg_id, 1);
 }
 EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid);
 
 struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id)
 {
        return xfrm_find_algo(&xfrm_calg_list, xfrm_alg_id_match,
-                             (void *)alg_id, 1);
+                             (void *)(unsigned long)alg_id, 1);
 }
 EXPORT_SYMBOL_GPL(xfrm_calg_get_byid);
 
@@ -486,7 +486,6 @@ EXPORT_SYMBOL_GPL(xfrm_ealg_get_byidx);
  */
 void xfrm_probe_algs(void)
 {
-#ifdef CONFIG_CRYPTO
        int i, status;
 
        BUG_ON(in_softirq());
@@ -511,7 +510,6 @@ void xfrm_probe_algs(void)
                if (calg_list[i].available != status)
                        calg_list[i].available = status;
        }
-#endif
 }
 EXPORT_SYMBOL_GPL(xfrm_probe_algs);
 
@@ -552,9 +550,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
                if (copy > len)
                        copy = len;
 
-               sg.page = virt_to_page(skb->data + offset);
-               sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
-               sg.length = copy;
+               sg_init_one(&sg, skb->data + offset, copy);
 
                err = icv_update(desc, &sg, copy);
                if (unlikely(err))
@@ -577,9 +573,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
                        if (copy > len)
                                copy = len;
 
-                       sg.page = frag->page;
-                       sg.offset = frag->page_offset + offset-start;
-                       sg.length = copy;
+                       sg_init_table(&sg, 1);
+                       sg_set_page(&sg, frag->page, copy,
+                                   frag->page_offset + offset-start);
 
                        err = icv_update(desc, &sg, copy);
                        if (unlikely(err))