Be less verbose when deleting SAs triggered by a hard expire

This commit is contained in:
Martin Willi
2012-03-20 17:31:31 +01:00
parent 23eb447c9a
commit 07202a2bf1
2 changed files with 24 additions and 22 deletions
@@ -1737,30 +1737,27 @@ METHOD(kernel_ipsec_t, del_sa, status_t,
mrk->m = mark.mask;
}
if (this->socket_xfrm->send_ack(this->socket_xfrm, hdr) != SUCCESS)
switch (this->socket_xfrm->send_ack(this->socket_xfrm, hdr))
{
if (mark.value)
{
DBG1(DBG_KNL, "unable to delete SAD entry with SPI %.8x "
"(mark %u/0x%8x)", ntohl(spi), mark.value, mark.mask);
}
else
{
DBG1(DBG_KNL, "unable to delete SAD entry with SPI %.8x",
ntohl(spi));
}
return FAILED;
case SUCCESS:
DBG2(DBG_KNL, "deleted SAD entry with SPI %.8x (mark %u/0x%08x)",
ntohl(spi), mark.value, mark.mask);
return SUCCESS;
case NOT_FOUND:
return NOT_FOUND;
default:
if (mark.value)
{
DBG1(DBG_KNL, "unable to delete SAD entry with SPI %.8x "
"(mark %u/0x%8x)", ntohl(spi), mark.value, mark.mask);
}
else
{
DBG1(DBG_KNL, "unable to delete SAD entry with SPI %.8x",
ntohl(spi));
}
return FAILED;
}
if (mark.value)
{
DBG2(DBG_KNL, "deleted SAD entry with SPI %.8x (mark %u/0x%8x)",
ntohl(spi), mark.value, mark.mask);
}
else
{
DBG2(DBG_KNL, "deleted SAD entry with SPI %.8x", ntohl(spi));
}
return SUCCESS;
}
METHOD(kernel_ipsec_t, update_sa, status_t,
@@ -206,6 +206,11 @@ METHOD(netlink_socket_t, netlink_send_ack, status_t,
free(out);
return ALREADY_DONE;
}
if (-err->error == ESRCH)
{ /* do not report missing entries */
free(out);
return NOT_FOUND;
}
DBG1(DBG_KNL, "received netlink error: %s (%d)",
strerror(-err->error), -err->error);
free(out);