comparison freeDiameter/sctp.c @ 227:80a7e65167c4

Cleanup verbosity and fix unintialized variable
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 02 Mar 2010 14:17:15 +0900
parents c8ad11effa95
children dcb58243e91f
comparison
equal deleted inserted replaced
226:406f74f0789b 227:80a7e65167c4
838 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6); 838 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6);
839 } 839 }
840 } 840 }
841 841
842 #ifdef SCTP_CONNECTX_4_ARGS 842 #ifdef SCTP_CONNECTX_4_ARGS
843 CHECK_SYS_DO( sctp_connectx(*sock, sar.sa, count, NULL), { ret = errno; goto fail; } ); 843 ret = sctp_connectx(*sock, sar.sa, count, NULL);
844 #else /* SCTP_CONNECTX_4_ARGS */ 844 #else /* SCTP_CONNECTX_4_ARGS */
845 CHECK_SYS_DO( sctp_connectx(*sock, sar.sa, count), { ret = errno; goto fail; } ); 845 ret = sctp_connectx(*sock, sar.sa, count);
846 #endif /* SCTP_CONNECTX_4_ARGS */ 846 #endif /* SCTP_CONNECTX_4_ARGS */
847
848 if (ret < 0) {
849 int lvl;
850 switch (ret = errno) {
851 case ECONNREFUSED:
852
853 /* "Normal" errors */
854 lvl = FULL;
855 break;
856 default:
857 lvl = INFO;
858 }
859 /* Some errors are expected, we log at different level */
860 TRACE_DEBUG( lvl, "sctp_connectx returned an error: %s", strerror(ret));
861 goto fail;
862 }
847 863
848 free(sar.buf); sar.buf = NULL; 864 free(sar.buf); sar.buf = NULL;
849 865
850 /* Set the remaining sockopts */ 866 /* Set the remaining sockopts */
851 CHECK_FCT_DO( ret = fd_setsockopt_postbind(*sock, 1), goto fail_deco ); 867 CHECK_FCT_DO( ret = fd_setsockopt_postbind(*sock, 1), goto fail_deco );
"Welcome to our mercurial repository"