[XFRM]: Algorithm lookup using .compat name
authorMartin Willi <martin@strongswan.org>
Fri, 29 Dec 2006 05:27:48 +0000 (21:27 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 31 Dec 2006 22:06:51 +0000 (14:06 -0800)
Installing an IPsec SA using old algorithm names (.compat) does not work
if the algorithm is not already loaded. When not using the PF_KEY
interface, algorithms are not preloaded in xfrm_probe_algs() and
installing a IPsec SA fails.

Signed-off-by: Martin Willi <martin@strongswan.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_algo.c

index 6b381fc0383d1ea7bde417f5c4665c03a4db418b..f1cf3402e75c9aa6c8b242674133b546d0190fad 100644 (file)
@@ -399,7 +399,8 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
                if (!probe)
                        break;
 
-               status = crypto_has_alg(name, type, mask | CRYPTO_ALG_ASYNC);
+               status = crypto_has_alg(list[i].name, type,
+                                       mask | CRYPTO_ALG_ASYNC);
                if (!status)
                        break;