Navigation


Changeset 1540:407e0a889c7e in freeDiameter for libfdcore/p_cnx.c


Ignore:
Timestamp:
May 1, 2020, 5:20:33 PM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

SCTP ConnectPeer?: sctp_bindx() to local endpoints

When connecting to an SCTP peer using sctp_connectx() with local
addresses configured with ListenOn?, bind to the ListenOn? addresses
using sctp_bindx() so that the SCTP INIT only contains the
configured local addresses, matching what is advertised in the CER,
and disable SCTP_AUTO_ASCONF.

If no local addresses are configured with ListenOn?, the previous
behaviour of sctp_connectx() and enable SCTP_AUTO_ASCONF is used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_cnx.c

    r1203 r1540  
    262262                switch (nc->proto) {
    263263                        case IPPROTO_TCP:
     264/* TODO: use no_bind and first of cnf_endpoints of nc->ss.sa_family ? */
    264265                                cnx = fd_cnx_cli_connect_tcp((sSA *)&nc->ss, sSAlen(&nc->ss));
    265266                                break;
     
    267268                        case IPPROTO_SCTP:
    268269                                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,
    269                                                         nc->port, &peer->p_hdr.info.pi_endpoints);
     270                                                        nc->port, &peer->p_hdr.info.pi_endpoints,
     271                                                        fd_g_config->cnf_flags.no_bind ? NULL : &fd_g_config->cnf_endpoints);
    270272                                break;
    271273#endif /* DISABLE_SCTP */
Note: See TracChangeset for help on using the changeset viewer.