use XFRM_MSG_UPDPOLICY for existing policies only

This commit is contained in:
Martin Willi 2008-07-28 08:29:04 +00:00
parent 2863509616
commit 7c04589335
1 changed files with 1 additions and 1 deletions

View File

@ -2669,7 +2669,7 @@ static status_t add_policy(private_kernel_interface_t *this,
memset(&request, 0, sizeof(request));
hdr = (struct nlmsghdr*)request;
hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
hdr->nlmsg_type = XFRM_MSG_UPDPOLICY;
hdr->nlmsg_type = found ? XFRM_MSG_UPDPOLICY : XFRM_MSG_NEWPOLICY;
hdr->nlmsg_len = NLMSG_LENGTH(sizeof(struct xfrm_userpolicy_info));
policy_info = (struct xfrm_userpolicy_info*)NLMSG_DATA(hdr);