]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Return const pointer from lookup_algorithm()
authorThomas Egerer <thomas.egerer@secunet.com>
Mon, 23 Jan 2017 15:04:38 +0000 (16:04 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 23 Jan 2017 17:53:58 +0000 (18:53 +0100)
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c

index e24728cb9b34e661dc21fc46d19dcceebf636ec9..b2ccbe04194e3eebe9fa38393b140f08d03b3226 100644 (file)
@@ -117,7 +117,7 @@ struct kernel_algorithm_t {
        /**
         * Name of the algorithm in linux crypto API
         */
-       char *name;
+       const char *name;
 };
 
 ENUM(xfrm_msg_names, XFRM_MSG_NEWSA, XFRM_MSG_MAPPING,
@@ -237,7 +237,7 @@ static kernel_algorithm_t compression_algs[] = {
 /**
  * Look up a kernel algorithm name and its key size
  */
-static char* lookup_algorithm(transform_type_t type, int ikev2)
+static const char* lookup_algorithm(transform_type_t type, int ikev2)
 {
        kernel_algorithm_t *list;
        int i, count;
@@ -1277,7 +1277,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
        kernel_ipsec_add_sa_t *data)
 {
        netlink_buf_t request;
-       char *alg_name, markstr[32] = "";
+       const char *alg_name;
+       char markstr[32] = "";
        struct nlmsghdr *hdr;
        struct xfrm_usersa_info *sa;
        uint16_t icv_size = 64, ipcomp = data->ipcomp;