Skip to content

Commit

Permalink
Use standard return code message format
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jun 4, 2015
1 parent 5d8ed2b commit 22ec781
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/modules/rlm_eap/libeap/eap_tls.c
Expand Up @@ -723,9 +723,9 @@ fr_tls_status_t eaptls_process(eap_handler_t *handler)
*/
status = eaptls_verify(handler);
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("eaptls_verify returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
REDEBUG("[eaptls verify] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("eaptls_verify returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
RDEBUG2("[eaptls verify] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}

switch (status) {
Expand Down
12 changes: 7 additions & 5 deletions src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c
Expand Up @@ -203,10 +203,12 @@ static int mod_session_init(void *type_arg, eap_handler_t *handler)
* related handshaking or application data.
*/
status = eaptls_start(handler->eap_ds, ssn->peap_flag);
RDEBUG2("Start returned %d", status);
if (status == 0) {
return 0;
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}
if (status == 0) return 0;

/*
* The next stage to process the packet.
Expand Down Expand Up @@ -238,9 +240,9 @@ static int mod_process(void *arg, eap_handler_t *handler)

status = eaptls_process(handler);
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
REDEBUG("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
RDEBUG2("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}

switch (status) {
Expand Down
12 changes: 7 additions & 5 deletions src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c
Expand Up @@ -111,10 +111,12 @@ static int mod_session_init(void *type_arg, eap_handler_t *handler)
* related handshaking or application data.
*/
status = eaptls_start(handler->eap_ds, ssn->peap_flag);
RDEBUG2("Start returned %d", status);
if (status == 0) {
return 0;
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}
if (status == 0) return 0;

/*
* The next stage to process the packet.
Expand All @@ -140,9 +142,9 @@ static int CC_HINT(nonnull) mod_process(void *type_arg, eap_handler_t *handler)

status = eaptls_process(handler);
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
REDEBUG("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
RDEBUG2("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}

switch (status) {
Expand Down
12 changes: 7 additions & 5 deletions src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c
Expand Up @@ -194,10 +194,12 @@ static int mod_session_init(void *type_arg, eap_handler_t *handler)
* related handshaking or application data.
*/
status = eaptls_start(handler->eap_ds, ssn->peap_flag);
RDEBUG2("Start returned %d", status);
if (status == 0) {
return 0;
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}
if (status == 0) return 0;

/*
* The next stage to process the packet.
Expand Down Expand Up @@ -229,9 +231,9 @@ static int mod_process(void *arg, eap_handler_t *handler)
*/
status = eaptls_process(handler);
if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
REDEBUG("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
REDEBUG("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
} else {
RDEBUG2("eaptls_process returned \"%s\"", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
RDEBUG2("[eaptls process] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
}

switch (status) {
Expand Down

0 comments on commit 22ec781

Please sign in to comment.