define state_story for STATE_UNDEFINED
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 16 Oct 2010 14:15:10 +0000 (16:15 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 16 Oct 2010 14:15:10 +0000 (16:15 +0200)
src/pluto/constants.c
src/pluto/constants.h
src/pluto/demux.c
src/pluto/state.c

index 87146c6..ec7bfaf 100644 (file)
@@ -131,6 +131,8 @@ const char *const debug_bit_names[] = {
 /* State of exchanges */
 
 static const char *const state_name[] = {
+       "STATE_UNDEFINED",
+
        "STATE_MAIN_R0",
        "STATE_MAIN_I1",
        "STATE_MAIN_R1",
@@ -170,11 +172,12 @@ static const char *const state_name[] = {
 };
 
 enum_names state_names =
-       { STATE_MAIN_R0, STATE_IKE_ROOF-1, state_name, NULL };
+       { STATE_UNDEFINED, STATE_IKE_ROOF-1, state_name, NULL };
 
 /* story for state */
 
 const char *const state_story[] = {
+       "undefined state after error",                   /* STATE_UNDEFINED */
        "expecting MI1",                         /* STATE_MAIN_R0 */
        "sent MI1, expecting MR1",               /* STATE_MAIN_I1 */
        "sent MR1, expecting MI2",               /* STATE_MAIN_R1 */
index 871d686..075579d 100644 (file)
@@ -368,11 +368,6 @@ extern const char *const state_story[];
 enum state_kind {
        STATE_UNDEFINED,    /* 0 -- most likely accident */
 
-       /*  Opportunism states: see "Opportunistic Encryption" 2.2 */
-
-       OPPO_ACQUIRE,       /* got an ACQUIRE message for this pair */
-       OPPO_GW_DISCOVERED, /* got TXT specifying gateway */
-
        /* IKE states */
 
        STATE_MAIN_R0,
index bdd05c5..0590a35 100644 (file)
@@ -2308,7 +2308,7 @@ complete_state_transition(struct msg_digest **mdp, stf_status result)
 
                        /* tell whack and log of progress */
                        {
-                               const char *story = state_story[st->st_state - STATE_MAIN_R0];
+                               const char *story = state_story[st->st_state];
                                enum rc_type w = RC_NEW_STATE + st->st_state;
                                char sadetails[128];
 
index 9c44275..3639f94 100644 (file)
@@ -734,7 +734,7 @@ void fmt_state(bool all, struct state *st, time_t n, char *state_buf,
                , st->st_serialno
                , c->name, inst
                , enum_name(&state_names, st->st_state)
-               , state_story[st->st_state - STATE_MAIN_R0]
+               , state_story[st->st_state]
                , timer_event_names, st->st_event->ev_type
                , delta
                , np1, np2, eo, dpd);