]> err.no Git - linux-2.6/blobdiff - net/xfrm/xfrm_user.c
[IPSEC]: Add compatibility algorithm name support
[linux-2.6] / net / xfrm / xfrm_user.c
index c21dc26141eae947f921e881016cbd64da735c64..fa79ddc4239e071c2d524c76285631c26005e65e 100644 (file)
@@ -10,6 +10,7 @@
  *
  */
 
+#include <linux/crypto.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -212,6 +213,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
                return -ENOMEM;
 
        memcpy(p, ualg, len);
+       strcpy(p->alg_name, algo->name);
        *algpp = p;
        return 0;
 }
@@ -1435,7 +1437,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err
        link = &xfrm_dispatch[type];
 
        /* All operations require privileges, even GET */
-       if (security_netlink_recv(skb)) {
+       if (security_netlink_recv(skb, CAP_NET_ADMIN)) {
                *errp = -EPERM;
                return -1;
        }