kernel-netlink: Return const pointer from lookup_algorithm()

Signed-off-by: Thomas Egerer <[email protected]>
This commit is contained in:
Thomas Egerer
2017-01-23 18:53:58 +01:00
committed by Tobias Brunner
parent 343a5e9f26
commit 7085ca68d6
@@ -117,7 +117,7 @@ struct kernel_algorithm_t {
/** /**
* Name of the algorithm in linux crypto API * Name of the algorithm in linux crypto API
*/ */
char *name; const char *name;
}; };
ENUM(xfrm_msg_names, XFRM_MSG_NEWSA, XFRM_MSG_MAPPING, 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 * 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; kernel_algorithm_t *list;
int i, count; int i, count;
@@ -1277,7 +1277,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
kernel_ipsec_add_sa_t *data) kernel_ipsec_add_sa_t *data)
{ {
netlink_buf_t request; netlink_buf_t request;
char *alg_name, markstr[32] = ""; const char *alg_name;
char markstr[32] = "";
struct nlmsghdr *hdr; struct nlmsghdr *hdr;
struct xfrm_usersa_info *sa; struct xfrm_usersa_info *sa;
uint16_t icv_size = 64, ipcomp = data->ipcomp; uint16_t icv_size = 64, ipcomp = data->ipcomp;