# HG changeset patch # User Sebastien Decugis # Date 1366778940 -28800 # Node ID b3d623f04b6db7dd88be23116eeef818cd4df937 # Parent 69c6167d88d179dafc75e0624e5553f8e06146a8 Fix a number of remaining compilation warnings diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_diameap/diameap_eap.c --- a/extensions/app_diameap/diameap_eap.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_diameap/diameap_eap.c Wed Apr 24 12:49:00 2013 +0800 @@ -451,7 +451,7 @@ &eap_i->aaaEapMSKData, &eap_i->aaaEapMSKLength, &eap_i->aaaEapEMSKData, &eap_i->aaaEapEMSKLength)) { - TRACE_DEBUG(INFO,"%s[EAP Protocol] Generating EAP Master Key failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname) + TRACE_DEBUG(INFO,"%s[EAP Protocol] [%s plugin] Generating EAP Master Key failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname) eap_i->aaaEapMSKLength = 0; eap_i->aaaEapEMSKLength = 0; eap_i->aaaEapKeyAvailable = FALSE; @@ -475,7 +475,7 @@ if (diameap_ba_policygetnextmethod(eap_sm, &eap_sm->currentMethod, &eap_sm->currentVendor)) { - TRACE_DEBUG(INFO,"%s[EAP Protocol] Selecting EAP Method plugin failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname); + TRACE_DEBUG(INFO,"%s[EAP Protocol] [%s plugin] Selecting EAP Method plugin failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname); *non_fatal_error = TRUE; eap_sm->eap_state = EAP_END; diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_diameap/diameap_plugins.c --- a/extensions/app_diameap/diameap_plugins.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_diameap/diameap_plugins.c Wed Apr 24 12:49:00 2013 +0800 @@ -129,7 +129,7 @@ if (!diameap_plugin_register) { TRACE_DEBUG(INFO, - "%s[%s plugin] Unable to register EAP method.",DIAMEAP_EXTENSION, + "%s[%s plugin] Unable to register EAP method: %s.",DIAMEAP_EXTENSION, plugin->methodname, dlerror()); return EINVAL; } diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_diameap/diameap_tls.h --- a/extensions/app_diameap/diameap_tls.h Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_diameap/diameap_tls.h Wed Apr 24 12:49:00 2013 +0800 @@ -39,14 +39,14 @@ #ifndef DIAMEAP_TLS_H_ #define DIAMEAP_TLS_H_ - #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405 +#if defined(__GNUC__) # define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 /* 4.6.x */ # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \ GCC_DIAG_PRAGMA(ignored x) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) -# else +# else /* older */ # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning x) # endif diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_radgw/radius.c --- a/extensions/app_radgw/radius.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_radgw/radius.c Wed Apr 24 12:49:00 2013 +0800 @@ -250,7 +250,6 @@ int i, len; unsigned char *pos; u8 attrtype; - size_t offset = 0; memset(outbuf, 0, buflen); diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_radgw/rgw_plugins.c --- a/extensions/app_radgw/rgw_plugins.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_radgw/rgw_plugins.c Wed Apr 24 12:49:00 2013 +0800 @@ -400,7 +400,6 @@ /* Loop in the list of extensions */ for (li = head->next; li != head; li = li->next) { struct plg_descr * plg = ((struct plg_accel_item *) li)->plg; - int locstateful = 0; if (plg->descriptor->rgwp_diam_ans) { TRACE_DEBUG(ANNOYING, "Calling next plugin: %s", plg->descriptor->rgwp_name); diff -r 69c6167d88d1 -r b3d623f04b6d extensions/app_sip/registrationtermination.c --- a/extensions/app_sip/registrationtermination.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/app_sip/registrationtermination.c Wed Apr 24 12:49:00 2013 +0800 @@ -97,7 +97,6 @@ struct dict_object * rtr_model=NULL; struct msg * message=NULL; struct avp *groupedavp=NULL, *avp=NULL; - struct session *sess=NULL; union avp_value value; //We must check that we have all needed value in structure diff -r 69c6167d88d1 -r b3d623f04b6d extensions/rt_ignore_dh/rt_ignore_dh.c --- a/extensions/rt_ignore_dh/rt_ignore_dh.c Wed Apr 24 11:17:30 2013 +0800 +++ b/extensions/rt_ignore_dh/rt_ignore_dh.c Wed Apr 24 12:49:00 2013 +0800 @@ -55,7 +55,6 @@ struct avp *avp, *child; struct avp *oh_avp = NULL; struct avp *pi_avp = NULL; - int match; void *ps, *new_oh; size_t ps_len, new_oh_len = 0; union avp_value val; @@ -66,6 +65,7 @@ /* look for Origin-Host and Proxy-Info matching this host */ while (avp && (!oh_avp || !pi_avp)) { struct avp_hdr * ahdr; + int match = 0; CHECK_FCT(fd_msg_avp_hdr(avp, &ahdr)); if (!(ahdr->avp_flags & AVP_FLAG_VENDOR)) { @@ -76,10 +76,9 @@ break; case AC_PROXY_INFO: ps = NULL; - match = ps_len = 0; + ps_len = 0; CHECK_FCT(fd_msg_parse_dict(avp, fd_g_config->cnf_dict, NULL)); CHECK_FCT(fd_msg_browse(avp, MSG_BRW_FIRST_CHILD, &child, NULL)); - int match = 0; while (child && (!match || !ps)) { struct avp_hdr *chdr; CHECK_FCT(fd_msg_avp_hdr(child, &chdr)); diff -r 69c6167d88d1 -r b3d623f04b6d include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Wed Apr 24 11:17:30 2013 +0800 +++ b/include/freeDiameter/libfdproto.h Wed Apr 24 12:49:00 2013 +0800 @@ -90,14 +90,14 @@ #endif /* SWIG */ /* Remove some deprecated warnings from some gnutls versions, when possible */ -#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405 +#if defined(__GNUC__) # define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 /* 4.6.x */ # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \ GCC_DIAG_PRAGMA(ignored x) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) -# else +# else /* older */ # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning x) # endif @@ -1914,6 +1914,10 @@ */ int fd_sess_fromsid ( uint8_t * sid, size_t len, struct session ** session, int * isnew); +/* only use the following in specific situations, e.g. app_radgw extension. They are normally handled by the framework only */ +int fd_sess_fromsid_msg ( uint8_t * sid, size_t len, struct session ** session, int * isnew); +int fd_sess_ref_msg ( struct session * session ); + /* * FUNCTION: fd_sess_getsid * diff -r 69c6167d88d1 -r b3d623f04b6d libfdcore/p_sr.c --- a/libfdcore/p_sr.c Wed Apr 24 11:17:30 2013 +0800 +++ b/libfdcore/p_sr.c Wed Apr 24 12:49:00 2013 +0800 @@ -77,8 +77,8 @@ uint32_t * nexthbh = li->o; fd_log_debug(" - Next req (hbh:%x): [since %ld.%06ld sec]", *nexthbh, - (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1), - (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_nsec - sr->added_on.tv_nsec) / 1000 : (now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000); + (long)((now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1)), + (long)((now.tv_nsec >= sr->added_on.tv_nsec) ? ((now.tv_nsec - sr->added_on.tv_nsec) / 1000) : ((now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000))); fd_msg_dump_one(ANNOYING + 1, sr->req); } diff -r 69c6167d88d1 -r b3d623f04b6d libfdproto/dictionary.c --- a/libfdproto/dictionary.c Wed Apr 24 11:17:30 2013 +0800 +++ b/libfdproto/dictionary.c Wed Apr 24 12:49:00 2013 +0800 @@ -1179,7 +1179,7 @@ if (enumval->enum_value.os.len < LEN_MAX) n = enumval->enum_value.os.len; for (i=0; i < n; i++) - fd_log_debug("0x%02hhX/'%c' ", enumval->enum_value.os.data[i], ASCII(enumval->enum_value.os.data[i])); + fd_log_debug("0x%2hhX/'%c' ", enumval->enum_value.os.data[i], ASCII(enumval->enum_value.os.data[i])); if (n == LEN_MAX) fd_log_debug("..."); } diff -r 69c6167d88d1 -r b3d623f04b6d libfdproto/dictionary_functions.c --- a/libfdproto/dictionary_functions.c Wed Apr 24 11:17:30 2013 +0800 +++ b/libfdproto/dictionary_functions.c Wed Apr 24 12:49:00 2013 +0800 @@ -231,7 +231,6 @@ with malformed AVP */ char * end = strchr(ret, '\0'); - char * oldend = end; while (end > ret) { end--; char b = *end; @@ -336,7 +335,7 @@ snprintf(ret, STR_LEN, "[invalid length: %zd]", avp_value->os.len); return ret; } - if (diameter_string_to_time_t(avp_value->os.data, avp_value->os.len, &val) != 0) { + if (diameter_string_to_time_t((char *)avp_value->os.data, avp_value->os.len, &val) != 0) { snprintf(ret, STR_LEN, "[time conversion error]"); return ret; } diff -r 69c6167d88d1 -r b3d623f04b6d libfdproto/fdproto-internal.h --- a/libfdproto/fdproto-internal.h Wed Apr 24 11:17:30 2013 +0800 +++ b/libfdproto/fdproto-internal.h Wed Apr 24 12:49:00 2013 +0800 @@ -65,8 +65,6 @@ extern pthread_rwlock_t fd_disp_lock; /* Messages / sessions API */ -int fd_sess_fromsid_msg ( uint8_t * sid, size_t len, struct session ** session, int * new); -int fd_sess_ref_msg ( struct session * session ); int fd_sess_reclaim_msg ( struct session ** session );