Index: libfdcore/cnxctx.c
===================================================================
--- libfdcore/cnxctx.c	(revision 1540)
+++ libfdcore/cnxctx.c	(revision 1419)
@@ -331,7 +331,6 @@
 }
 
-/* Same for SCTP, accepts a list of remote addresses to connect to (see sctp_connectx for how they are used).
- * If src_list is not NULL and not empty, list of local addresses to connect from via sctp_bindx(). */
-struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list, struct fd_list * src_list)
+/* Same for SCTP, accepts a list of remote addresses to connect to (see sctp_connectx for how they are used) */
+struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list)
 {
 #ifdef DISABLE_SCTP
@@ -346,30 +345,13 @@
 	sSS primary;
 
-	TRACE_ENTRY("%p %p", list, src_list);
+	TRACE_ENTRY("%p", list);
 	CHECK_PARAMS_DO( list && !FD_IS_LIST_EMPTY(list), return NULL );
 
-	/* Log SCTP association source and destination endpoints */
+	fd_sa_sdump_numeric(sa_buf, &((struct fd_endpoint *)(list->next))->sa);
+
+	LOG_D("Connecting to SCTP %s:%hu...", sa_buf, port);
+
 	{
-		char * buf = NULL;
-		size_t len = 0, offset = 0;
-		CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, "Connecting SCTP endpoints"), );
-		CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, " source: "), );
-		if (src_list && !FD_IS_LIST_EMPTY(src_list)) {
-			CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, src_list ), );
-		} else {
-			CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, "(ANY)"), );
-		}
-		CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, ", destination: "), );
-		CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, list ), );
-		LOG_D("%s", buf ?: "Error determining SCTP endpoints");
-		free(buf);
-	}
-
-	fd_sa_sdump_numeric(sa_buf, &((struct fd_endpoint *)(list->next))->sa);
-
-	LOG_D("Connecting to SCTP %s:%hu...", sa_buf, port);
-
-	{
-		int ret = fd_sctp_client( &sock, no_ip6, port, list, src_list );
+		int ret = fd_sctp_client( &sock, no_ip6, port, list );
 		if (ret != 0) {
 			LOG_D("SCTP connection to [%s,...] failed: %s", sa_buf, strerror(ret));
Index: libfdcore/cnxctx.h
===================================================================
--- libfdcore/cnxctx.h	(revision 1540)
+++ libfdcore/cnxctx.h	(revision 1421)
@@ -118,5 +118,5 @@
 int fd_sctp_create_bind_server( int * sock, int family, struct fd_list * list, uint16_t port );
 int fd_sctp_listen( int sock );
-int fd_sctp_client( int *sock, int no_ip6, uint16_t port, struct fd_list * list, struct fd_list * src_list );
+int fd_sctp_client( int *sock, int no_ip6, uint16_t port, struct fd_list * list );
 int fd_sctp_get_local_ep(int sock,  struct fd_list * list);
 int fd_sctp_get_remote_ep(int sock, struct fd_list * list);
Index: libfdcore/config.c
===================================================================
--- libfdcore/config.c	(revision 1540)
+++ libfdcore/config.c	(revision 1415)
@@ -148,5 +148,4 @@
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Pref. proto .. : %s\n", fd_g_config->cnf_flags.pr_tcp ? "TCP" : "SCTP"), return NULL);
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - TLS method ... : %s\n", fd_g_config->cnf_flags.tls_alg ? "INBAND" : "Separate port"), return NULL);
-	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "          - Client bind .. : %s\n", fd_g_config->cnf_flags.no_bind ? "DISABLED" : "Enabled"), return NULL);
 	
 	CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "  TLS :   - Certificate .. : %s\n", fd_g_config->cnf_sec_data.cert_file ?: "(NONE)"), return NULL);
@@ -353,6 +352,5 @@
 	
 	/* Validate local endpoints */
-	fd_g_config->cnf_flags.no_bind = FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints);
-	if ((!fd_g_config->cnf_flags.no_bind) && (fd_g_config->cnf_flags.no_ip4 || fd_g_config->cnf_flags.no_ip6)) {
+	if ((!FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints)) && (fd_g_config->cnf_flags.no_ip4 || fd_g_config->cnf_flags.no_ip6)) {
 		struct fd_list * li;
 		for ( li = fd_g_config->cnf_endpoints.next; li != &fd_g_config->cnf_endpoints; li = li->next) {
Index: libfdcore/fdcore-internal.h
===================================================================
--- libfdcore/fdcore-internal.h	(revision 1540)
+++ libfdcore/fdcore-internal.h	(revision 1397)
@@ -343,5 +343,5 @@
 struct cnxctx * fd_cnx_serv_accept(struct cnxctx * serv);
 struct cnxctx * fd_cnx_cli_connect_tcp(sSA * sa, socklen_t addrlen);
-struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list, struct fd_list * src_list);
+struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list);
 int             fd_cnx_start_clear(struct cnxctx * conn, int loop);
 void		fd_cnx_sethostname(struct cnxctx * conn, DiamId_t hn);
Index: libfdcore/p_cnx.c
===================================================================
--- libfdcore/p_cnx.c	(revision 1540)
+++ libfdcore/p_cnx.c	(revision 1203)
@@ -262,5 +262,4 @@
 		switch (nc->proto) {
 			case IPPROTO_TCP:
-/* TODO: use no_bind and first of cnf_endpoints of nc->ss.sa_family ? */
 				cnx = fd_cnx_cli_connect_tcp((sSA *)&nc->ss, sSAlen(&nc->ss));
 				break;
@@ -268,6 +267,5 @@
 			case IPPROTO_SCTP:
 				cnx = fd_cnx_cli_connect_sctp((peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP) ? 1 : fd_g_config->cnf_flags.no_ip6, 
-							nc->port, &peer->p_hdr.info.pi_endpoints,
-							fd_g_config->cnf_flags.no_bind ? NULL : &fd_g_config->cnf_endpoints);
+							nc->port, &peer->p_hdr.info.pi_endpoints);
 				break;
 #endif /* DISABLE_SCTP */
Index: libfdcore/sctp.c
===================================================================
--- libfdcore/sctp.c	(revision 1541)
+++ libfdcore/sctp.c	(revision 1543)
@@ -59,32 +59,4 @@
 #endif /* USE_DEFAULT_SCTP_RTX_PARAMS */
 
-
-DECLARE_FD_DUMP_PROTOTYPE(fd_sa_dump_array, sSA * saddrs, int saddrs_count)
-{
-	union {
-		sSA	*sa;
-		uint8_t *buf;
-	} ptr;
-	int i;
-	int salen;
-
-	FD_DUMP_HANDLE_OFFSET();
-
-	ptr.sa = saddrs;
-	for (i = 0; i < saddrs_count; i++) {
-		salen = sSAlen(ptr.sa);
-		if (salen == 0) {
-			LOG_E("fd_sa_dump_array: Unknown sockaddr family");
-			break;
-		}
-		if (i > 0) {
-			CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " "), return NULL);
-		}
-		CHECK_MALLOC_DO( fd_sa_dump( FD_DUMP_STD_PARAMS, ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV), return NULL);
-		ptr.buf += salen;
-	}
-	return *buf;
-}
-
 /* Pre-binding socket options -- # streams read in config */
 static int fd_setsockopt_prebind(int sk)
@@ -111,5 +83,5 @@
 			sz = sizeof(rtoinfo);
 			/* Read socket defaults */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_RTOINFO, &rtoinfo, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_RTOINFO, &rtoinfo, &sz)  );
 			if (sz != sizeof(rtoinfo))
 			{
@@ -131,5 +103,5 @@
 		if (TRACE_BOOL(ANNOYING)) {
 			/* Check new values */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_RTOINFO, &rtoinfo, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_RTOINFO, &rtoinfo, &sz)  );
 			fd_log_debug( "New SCTP_RTOINFO : srto_initial : %u", rtoinfo.srto_initial);
 			fd_log_debug( "                   srto_max     : %u", rtoinfo.srto_max);
@@ -150,5 +122,5 @@
 			sz = sizeof(assoc);
 			/* Read socket defaults */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_ASSOCINFO, &assoc, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_ASSOCINFO, &assoc, &sz)  );
 			if (sz != sizeof(assoc))
 			{
@@ -171,5 +143,5 @@
 		if (TRACE_BOOL(ANNOYING)) {
 			/* Check new values */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_ASSOCINFO, &assoc, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_ASSOCINFO, &assoc, &sz)  );
 			fd_log_debug( "New SCTP_ASSOCINFO : sasoc_asocmaxrxt               : %hu", assoc.sasoc_asocmaxrxt);
 			fd_log_debug( "                     sasoc_number_peer_destinations : %hu", assoc.sasoc_number_peer_destinations);
@@ -347,5 +319,5 @@
 
 			/* Read socket defaults */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, &parms, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_PEER_ADDR_PARAMS, &parms, &sz)  );
 			if (sz != sizeof(parms))
 			{
@@ -376,5 +348,5 @@
 		if (TRACE_BOOL(ANNOYING)) {
 			/* Check new values */
-			CHECK_SYS(  getsockopt(sk, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, &parms, &sz)  );
+			CHECK_SYS(  sctp_opt_info(sk, 0, SCTP_PEER_ADDR_PARAMS, &parms, &sz)  );
 			fd_log_debug( "New SCTP_PEER_ADDR_PARAMS : spp_hbinterval    : %u",  parms.spp_hbinterval);
 			fd_log_debug( "                            spp_pathmaxrxt    : %hu", parms.spp_pathmaxrxt);
@@ -843,14 +815,19 @@
 			goto redo;
 		}
-
-		/* Debug: show bound addresses */
-		{
-			char * buf = NULL;
-			size_t len = 0;
-			CHECK_MALLOC_DO( fd_sa_dump_array( &buf, &len, 0, sar, count), );
-			LOG_D("SCTP server binding local addresses: %s", buf);
-			free(buf);
-		}
-
+		
+		#if 0
+			union {
+				sSA	*sa;
+				uint8_t *buf;
+			} ptr;
+			int i;
+			ptr.sa = sar;
+			fd_log_debug("Calling sctp_bindx with the following address array:");
+			for (i = 0; i < count; i++) {
+				TRACE_sSA(FD_LOG_DEBUG, FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+				ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6) ;
+			}
+		#endif
+		
 		/* Bind to this array */
 		CHECK_SYS(  sctp_bindx(*sock, sar, count, SCTP_BINDX_ADD_ADDR)  );
@@ -864,17 +841,20 @@
 	
 	/* Debug: show all local listening addresses */
-	{
-		sSA *sar = NULL;
-		int sz = 0;
-		char * buf = NULL;
-		size_t len = 0;
-
+	#if 0
+		sSA *sar;
+		union {
+			sSA	*sa;
+			uint8_t *buf;
+		} ptr;
+		int sz;
+		
 		CHECK_SYS(  sz = sctp_getladdrs(*sock, 0, &sar)  );
-
-		CHECK_MALLOC_DO( fd_sa_dump_array( &buf, &len, 0, sar, sz), );
-		LOG_D("SCTP server locally bound addresses: %s", buf);
+		
+		fd_log_debug("SCTP server bound on :");
+		for (ptr.sa = sar; sz-- > 0; ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6)) {
+			TRACE_sSA(FD_LOG_DEBUG, FULL, "    - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+		}
 		sctp_freeladdrs(sar);
-		free(buf);
-	}
+	#endif
 
 	return 0;
@@ -890,5 +870,5 @@
 
 /* Create a client socket and connect to remote server */
-int fd_sctp_client( int *sock, int no_ip6, uint16_t port, struct fd_list * list, struct fd_list * src_list )
+int fd_sctp_client( int *sock, int no_ip6, uint16_t port, struct fd_list * list )
 {
 	int family;
@@ -900,11 +880,9 @@
 	int count = 0;
 	int ret;
-	int bind_default = 1;	/* enable ASCONF in postbind */
 	
 	sar.buf = NULL;
 	
-	TRACE_ENTRY("%p %i %hu %p %p", sock, no_ip6, port, list, src_list);
+	TRACE_ENTRY("%p %i %hu %p", sock, no_ip6, port, list);
 	CHECK_PARAMS( sock && list && (!FD_IS_LIST_EMPTY(list)) );
-	CHECK_PARAMS( !src_list || (src_list && (!FD_IS_LIST_EMPTY(src_list))) );
 	
 	if (no_ip6) {
@@ -922,31 +900,5 @@
 	/* Set the socket options */
 	CHECK_FCT_DO( ret = fd_setsockopt_prebind(*sock), goto out );
-
-	/* Bind to explicit source addresses if requested */
-	if (src_list && !FD_IS_LIST_EMPTY(src_list)) {
-		sSA * bindsar = NULL; /* array of addresses */
-		size_t sz = 0; /* size of the array */
-		int sarcount = 0; /* number of sock addr in the array */
-
-		/* Create the array of configured addresses */
-		CHECK_FCT_DO( ret = add_addresses_from_list_mask((void *)&bindsar, &sz, &sarcount, family, 0, src_list, EP_FL_CONF, EP_FL_CONF), goto out );
-
-		if (sarcount) {
-			char * buf = NULL;
-			size_t len = 0;
-			CHECK_MALLOC_DO( fd_sa_dump_array( &buf, &len, 0, bindsar, sarcount), goto out );
-			LOG_A("SCTP client binding local addresses: %s", buf);
-			free(buf);
-
-			CHECK_SYS_DO( ret = sctp_bindx(*sock, bindsar, sarcount, SCTP_BINDX_ADD_ADDR), goto out );
-		}
-
-		/* Disable ASCONF option in postbind */
-		bind_default = 0;
-
-		/* We don't need bindsar anymore */
-		free(bindsar);
-	}
-
+	
 	/* Create the array of addresses, add first the configured addresses, then the discovered, then the other ones */
 	CHECK_FCT_DO( ret = add_addresses_from_list_mask(&sar.buf, &size, &count, family, htons(port), list, EP_FL_CONF,              EP_FL_CONF	), goto out );
@@ -955,12 +907,22 @@
 	
 	/* Try connecting */
-	{
-		char * buf = NULL;
-		size_t len = 0;
-		CHECK_MALLOC_DO( fd_sa_dump_array( &buf, &len, 0, sar.sa, count), goto out );
-		LOG_A("SCTP client connecting to addresses: %s", buf);
-		free(buf);
-	}
-
+	LOG_A("Attempting SCTP connection (%d addresses attempted) ", count);
+		
+#if 0
+		/* Dump the SAs */
+		union {
+			uint8_t *buf;
+			sSA	*sa;
+			sSA4	*sin;
+			sSA6	*sin6;
+		} ptr;
+		int i;
+		ptr.buf = sar.buf;
+		for (i=0; i< count; i++) {
+			TRACE_sSA(FD_LOG_DEBUG, FULL, "  - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
+			ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6);
+		}
+#endif
+	
 	/* Bug in some Linux kernel, the sctp_connectx is not a cancellation point. To avoid blocking freeDiameter, we allow async cancel here */
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
@@ -983,5 +945,5 @@
 	
 	/* Set the remaining sockopts */
-	CHECK_FCT_DO( ret = fd_setsockopt_postbind(*sock, bind_default),
+	CHECK_FCT_DO( ret = fd_setsockopt_postbind(*sock, 1), 
 		{ 
 			CHECK_SYS_DO( shutdown(*sock, SHUT_RDWR), /* continue */ );
@@ -1021,5 +983,5 @@
 #if 0
 		char sa_buf[sSA_DUMP_STRLEN];
-		fd_sa_sdump_numeric(sa_buf, (sSA *)&status.sstat_primary.spinfo_address);
+		fd_sa_sdump_numeric(sa_buf, &status.sstat_primary.spinfo_address);
 		fd_log_debug( "SCTP_STATUS : sstat_state                  : %i" , status.sstat_state);
 		fd_log_debug( "              sstat_rwnd  	          : %u" , status.sstat_rwnd);
@@ -1257,5 +1219,4 @@
 	if (mhdr.msg_flags & MSG_NOTIFICATION) {
 		union sctp_notification * notif = (union sctp_notification *) data;
-		char sa_buf[sSA_DUMP_STRLEN];
 		
 		TRACE_DEBUG(FULL, "Received %zdb data of notification on socket %d", datasize, conn->cc_socket);
@@ -1275,6 +1236,5 @@
 			case SCTP_PEER_ADDR_CHANGE:
 				TRACE_DEBUG(FULL, "Received SCTP_PEER_ADDR_CHANGE notification");
-				fd_sa_sdump_numeric(sa_buf, (sSA *)&(notif->sn_paddr_change.spc_aaddr));
-				TRACE_DEBUG(ANNOYING, "    intf_change : %s", sa_buf);
+				/* TRACE_sSA(FD_LOG_DEBUG, ANNOYING, "    intf_change : ", &(notif->sn_paddr_change.spc_aaddr), NI_NUMERICHOST | NI_NUMERICSERV, "" ); */
 				TRACE_DEBUG(ANNOYING, "          state : %d", notif->sn_paddr_change.spc_state);
 				TRACE_DEBUG(ANNOYING, "          error : %d", notif->sn_paddr_change.spc_error);
