added missing curly brackets
This commit is contained in:
+37
-1
@@ -379,7 +379,9 @@ void whack_handle(int whackctlfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_myid)
|
if (msg.whack_myid)
|
||||||
|
{
|
||||||
set_myid(MYID_SPECIFIED, msg.myid);
|
set_myid(MYID_SPECIFIED, msg.myid);
|
||||||
|
}
|
||||||
|
|
||||||
/* Deleting combined with adding a connection works as replace.
|
/* Deleting combined with adding a connection works as replace.
|
||||||
* To make this more useful, in only this combination,
|
* To make this more useful, in only this combination,
|
||||||
@@ -388,9 +390,13 @@ void whack_handle(int whackctlfd)
|
|||||||
if (msg.whack_delete)
|
if (msg.whack_delete)
|
||||||
{
|
{
|
||||||
if (msg.whack_ca)
|
if (msg.whack_ca)
|
||||||
|
{
|
||||||
find_ca_info_by_name(msg.name, TRUE);
|
find_ca_info_by_name(msg.name, TRUE);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
delete_connections_by_name(msg.name, !msg.whack_connection);
|
delete_connections_by_name(msg.name, !msg.whack_connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_deletestate)
|
if (msg.whack_deletestate)
|
||||||
@@ -409,13 +415,19 @@ void whack_handle(int whackctlfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_crash)
|
if (msg.whack_crash)
|
||||||
|
{
|
||||||
delete_states_by_peer(&msg.whack_crash_peer);
|
delete_states_by_peer(&msg.whack_crash_peer);
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.whack_connection)
|
if (msg.whack_connection)
|
||||||
|
{
|
||||||
add_connection(&msg);
|
add_connection(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.whack_ca && msg.cacert != NULL)
|
if (msg.whack_ca && msg.cacert != NULL)
|
||||||
|
{
|
||||||
add_ca_info(&msg);
|
add_ca_info(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
/* process "listen" before any operation that could require it */
|
/* process "listen" before any operation that could require it */
|
||||||
if (msg.whack_listen)
|
if (msg.whack_listen)
|
||||||
@@ -477,7 +489,7 @@ void whack_handle(int whackctlfd)
|
|||||||
list_leases(msg.name, msg.whack_lease_ip, msg.whack_lease_id);
|
list_leases(msg.name, msg.whack_lease_ip, msg.whack_lease_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_list & LIST_PUBKEYS)
|
if (msg.whack_list & LIST_PUBKEYS)
|
||||||
{
|
{
|
||||||
list_public_keys(msg.whack_utc);
|
list_public_keys(msg.whack_utc);
|
||||||
}
|
}
|
||||||
@@ -560,12 +572,18 @@ void whack_handle(int whackctlfd)
|
|||||||
{
|
{
|
||||||
set_cur_connection(c);
|
set_cur_connection(c);
|
||||||
if (!oriented(*c))
|
if (!oriented(*c))
|
||||||
|
{
|
||||||
whack_log(RC_ORIENT
|
whack_log(RC_ORIENT
|
||||||
, "we have no ipsecN interface for either end of this connection");
|
, "we have no ipsecN interface for either end of this connection");
|
||||||
|
}
|
||||||
else if (c->policy & POLICY_GROUP)
|
else if (c->policy & POLICY_GROUP)
|
||||||
|
{
|
||||||
route_group(c);
|
route_group(c);
|
||||||
|
}
|
||||||
else if (!trap_connection(c))
|
else if (!trap_connection(c))
|
||||||
|
{
|
||||||
whack_log(RC_ROUTE, "could not route");
|
whack_log(RC_ROUTE, "could not route");
|
||||||
|
}
|
||||||
reset_cur_connection();
|
reset_cur_connection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -592,14 +610,22 @@ void whack_handle(int whackctlfd)
|
|||||||
for (sr = &c->spd; sr != NULL; sr = sr->next)
|
for (sr = &c->spd; sr != NULL; sr = sr->next)
|
||||||
{
|
{
|
||||||
if (sr->routing >= RT_ROUTED_TUNNEL)
|
if (sr->routing >= RT_ROUTED_TUNNEL)
|
||||||
|
{
|
||||||
fail++;
|
fail++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (fail > 0)
|
if (fail > 0)
|
||||||
|
{
|
||||||
whack_log(RC_RTBUSY, "cannot unroute: route busy");
|
whack_log(RC_RTBUSY, "cannot unroute: route busy");
|
||||||
|
}
|
||||||
else if (c->policy & POLICY_GROUP)
|
else if (c->policy & POLICY_GROUP)
|
||||||
|
{
|
||||||
unroute_group(c);
|
unroute_group(c);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
unroute_connection(c);
|
unroute_connection(c);
|
||||||
|
}
|
||||||
reset_cur_connection();
|
reset_cur_connection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -626,11 +652,15 @@ void whack_handle(int whackctlfd)
|
|||||||
if (msg.whack_oppo_initiate)
|
if (msg.whack_oppo_initiate)
|
||||||
{
|
{
|
||||||
if (!listening)
|
if (!listening)
|
||||||
|
{
|
||||||
whack_log(RC_DEAF, "need --listen before opportunistic initiation");
|
whack_log(RC_DEAF, "need --listen before opportunistic initiation");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
initiate_opportunistic(&msg.oppo_my_client, &msg.oppo_peer_client, 0
|
initiate_opportunistic(&msg.oppo_my_client, &msg.oppo_peer_client, 0
|
||||||
, FALSE
|
, FALSE
|
||||||
, msg.whack_async? NULL_FD : dup_any(whackfd));
|
, msg.whack_async? NULL_FD : dup_any(whackfd));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_terminate)
|
if (msg.whack_terminate)
|
||||||
@@ -647,7 +677,9 @@ void whack_handle(int whackctlfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg.whack_status)
|
if (msg.whack_status)
|
||||||
|
{
|
||||||
show_status(msg.whack_statusall, msg.name);
|
show_status(msg.whack_statusall, msg.name);
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.whack_shutdown)
|
if (msg.whack_shutdown)
|
||||||
{
|
{
|
||||||
@@ -658,10 +690,14 @@ void whack_handle(int whackctlfd)
|
|||||||
if (msg.whack_sc_op != SC_OP_NONE)
|
if (msg.whack_sc_op != SC_OP_NONE)
|
||||||
{
|
{
|
||||||
if (pkcs11_proxy)
|
if (pkcs11_proxy)
|
||||||
|
{
|
||||||
scx_op_via_whack(msg.sc_data, msg.inbase, msg.outbase
|
scx_op_via_whack(msg.sc_data, msg.inbase, msg.outbase
|
||||||
, msg.whack_sc_op, msg.keyid, whackfd);
|
, msg.whack_sc_op, msg.keyid, whackfd);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
plog("pkcs11 access to smartcard not allowed (set pkcs11proxy=yes)");
|
plog("pkcs11 access to smartcard not allowed (set pkcs11proxy=yes)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
whack_log_fd = NULL_FD;
|
whack_log_fd = NULL_FD;
|
||||||
|
|||||||
Reference in New Issue
Block a user