Changeset 1540:407e0a889c7e in freeDiameter for libfdcore/cnxctx.c
- Timestamp:
- May 1, 2020, 5:20:33 PM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/cnxctx.c
r1419 r1540 331 331 } 332 332 333 /* Same for SCTP, accepts a list of remote addresses to connect to (see sctp_connectx for how they are used) */ 334 struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list) 333 /* Same for SCTP, accepts a list of remote addresses to connect to (see sctp_connectx for how they are used). 334 * If src_list is not NULL and not empty, list of local addresses to connect from via sctp_bindx(). */ 335 struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list, struct fd_list * src_list) 335 336 { 336 337 #ifdef DISABLE_SCTP … … 345 346 sSS primary; 346 347 347 TRACE_ENTRY("%p ",list);348 TRACE_ENTRY("%p %p", list, src_list); 348 349 CHECK_PARAMS_DO( list && !FD_IS_LIST_EMPTY(list), return NULL ); 349 350 351 /* Log SCTP association source and destination endpoints */ 352 { 353 char * buf = NULL; 354 size_t len = 0, offset = 0; 355 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, "Connecting SCTP endpoints"), ); 356 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, " source: "), ); 357 if (src_list && !FD_IS_LIST_EMPTY(src_list)) { 358 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, src_list ), ); 359 } else { 360 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, "(ANY)"), ); 361 } 362 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset, ", destination: "), ); 363 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, list ), ); 364 LOG_D("%s", buf ?: "Error determining SCTP endpoints"); 365 free(buf); 366 } 367 350 368 fd_sa_sdump_numeric(sa_buf, &((struct fd_endpoint *)(list->next))->sa); 351 369 … … 353 371 354 372 { 355 int ret = fd_sctp_client( &sock, no_ip6, port, list );373 int ret = fd_sctp_client( &sock, no_ip6, port, list, src_list ); 356 374 if (ret != 0) { 357 375 LOG_D("SCTP connection to [%s,...] failed: %s", sa_buf, strerror(ret));
Note: See TracChangeset
for help on using the changeset viewer.