strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
429d95f
)
Added a quick_delete task flag to enforce delete, even if CHILD_SA not found
author
Martin Willi
<martin@revosec.ch>
Thu, 15 Dec 2011 17:03:14 +0000
(18:03 +0100)
committer
Martin Willi
<martin@revosec.ch>
Tue, 20 Mar 2012 16:31:24 +0000
(17:31 +0100)
src/libcharon/sa/ike_sa.c
patch
|
blob
|
history
src/libcharon/sa/tasks/informational.c
patch
|
blob
|
history
src/libcharon/sa/tasks/quick_delete.c
patch
|
blob
|
history
src/libcharon/sa/tasks/quick_delete.h
patch
|
blob
|
history
diff --git
a/src/libcharon/sa/ike_sa.c
b/src/libcharon/sa/ike_sa.c
index
223901c
..
cb560cd
100644
(file)
--- a/
src/libcharon/sa/ike_sa.c
+++ b/
src/libcharon/sa/ike_sa.c
@@
-1354,7
+1354,7
@@
METHOD(ike_sa_t, delete_child_sa, status_t,
if (this->version == IKEV1)
{
if (this->version == IKEV1)
{
- task = (task_t*)quick_delete_create(&this->public, protocol, spi);
+ task = (task_t*)quick_delete_create(&this->public, protocol, spi
, FALSE
);
}
else
{
}
else
{
diff --git
a/src/libcharon/sa/tasks/informational.c
b/src/libcharon/sa/tasks/informational.c
index
f0ddad0
..
60e1cfc
100644
(file)
--- a/
src/libcharon/sa/tasks/informational.c
+++ b/
src/libcharon/sa/tasks/informational.c
@@
-105,7
+105,7
@@
METHOD(task_t, process_r, status_t,
else
{
this->del = (task_t*)quick_delete_create(this->ike_sa,
else
{
this->del = (task_t*)quick_delete_create(this->ike_sa,
-
PROTO_NONE, 0
);
+
PROTO_NONE, 0, FALSE
);
}
}
break;
}
}
break;
diff --git
a/src/libcharon/sa/tasks/quick_delete.c
b/src/libcharon/sa/tasks/quick_delete.c
index
61fa2ef
..
a5f27c5
100644
(file)
--- a/
src/libcharon/sa/tasks/quick_delete.c
+++ b/
src/libcharon/sa/tasks/quick_delete.c
@@
-49,6
+49,11
@@
struct private_quick_delete_t {
* Inbound SPI of CHILD_SA to delete
*/
u_int32_t spi;
* Inbound SPI of CHILD_SA to delete
*/
u_int32_t spi;
+
+ /**
+ * Send delete even if SA does not exist
+ */
+ bool force;
};
/**
};
/**
@@
-96,7
+101,7
@@
static bool delete_child(private_quick_delete_t *this,
METHOD(task_t, build_i, status_t,
private_quick_delete_t *this, message_t *message)
{
METHOD(task_t, build_i, status_t,
private_quick_delete_t *this, message_t *message)
{
- if (delete_child(this, this->protocol, this->spi))
+ if (delete_child(this, this->protocol, this->spi)
|| this->force
)
{
delete_payload_t *delete_payload;
{
delete_payload_t *delete_payload;
@@
-185,7
+190,7
@@
METHOD(task_t, destroy, void,
* Described in header.
*/
quick_delete_t *quick_delete_create(ike_sa_t *ike_sa, protocol_id_t protocol,
* Described in header.
*/
quick_delete_t *quick_delete_create(ike_sa_t *ike_sa, protocol_id_t protocol,
- u_int32_t spi)
+ u_int32_t spi
, bool force
)
{
private_quick_delete_t *this;
{
private_quick_delete_t *this;
@@
-200,6
+205,7
@@
quick_delete_t *quick_delete_create(ike_sa_t *ike_sa, protocol_id_t protocol,
.ike_sa = ike_sa,
.protocol = protocol,
.spi = spi,
.ike_sa = ike_sa,
.protocol = protocol,
.spi = spi,
+ .force = force,
);
if (protocol != PROTO_NONE)
);
if (protocol != PROTO_NONE)
diff --git
a/src/libcharon/sa/tasks/quick_delete.h
b/src/libcharon/sa/tasks/quick_delete.h
index
a0dbd0b
..
80aae82
100644
(file)
--- a/
src/libcharon/sa/tasks/quick_delete.h
+++ b/
src/libcharon/sa/tasks/quick_delete.h
@@
-45,9
+45,10
@@
struct quick_delete_t {
* @param ike_sa IKE_SA this task works for
* @param protocol protocol of CHILD_SA to delete, PROTO_NONE as responder
* @param spi inbound SPI of CHILD_SA to delete
* @param ike_sa IKE_SA this task works for
* @param protocol protocol of CHILD_SA to delete, PROTO_NONE as responder
* @param spi inbound SPI of CHILD_SA to delete
+ * @param force send delete even if SA does not exist
* @return quick_delete task to handle by the task_manager
*/
quick_delete_t *quick_delete_create(ike_sa_t *ike_sa, protocol_id_t protocol,
* @return quick_delete task to handle by the task_manager
*/
quick_delete_t *quick_delete_create(ike_sa_t *ike_sa, protocol_id_t protocol,
- u_int32_t spi);
+ u_int32_t spi
, bool force
);
#endif /** QUICK_DELETE_H_ @}*/
#endif /** QUICK_DELETE_H_ @}*/