ike: Treat action_t as flags so 'start' and 'trap' can be combined

While combining the actions could cause duplicates (while the SA is
initiated, traffic might trigger the trap and the initiation of another
CHILD_SA), the previous commit should avoid most duplicates.  If reuse_ikesa
is disabled, duplicates can't be prevented, though.
This commit is contained in:
Tobias Brunner
2022-04-14 18:42:01 +02:00
parent 927103ece4
commit 4f4d4021b4
10 changed files with 175 additions and 176 deletions
+4 -4
View File
@@ -22,10 +22,10 @@
#include <daemon.h>
ENUM(action_names, ACTION_NONE, ACTION_RESTART,
"clear",
"hold",
"restart",
ENUM_FLAGS(action_names, ACTION_TRAP, ACTION_START,
"none",
"trap",
"start",
);
/** Default replay window size, if not set using charon.replay_window */
+5 -5
View File
@@ -40,11 +40,11 @@ typedef struct child_cfg_create_t child_cfg_create_t;
*/
enum action_t {
/** No action */
ACTION_NONE,
/** Route config to establish or reestablish on demand */
ACTION_ROUTE,
/** Start or restart config immediately */
ACTION_RESTART,
ACTION_NONE = 0,
/** Install trap policy to (re-)establish on demand */
ACTION_TRAP = (1<<0),
/** Start or restart immediately */
ACTION_START = (1<<1),
};
/**