|
|
|
|
@ -79,11 +79,11 @@ static void connect_create_links_v4(struct ETCP_CONNECT* ctx, struct TOPO_GROUP_
|
|
|
|
|
memcpy(&sin.sin_addr.s_addr, a->addr, 4); sin.sin_port = htons(a->port); |
|
|
|
|
struct sockaddr_storage sa; memcpy(&sa, &sin, sizeof(sin)); |
|
|
|
|
int addr_links = 0; |
|
|
|
|
if (!(a->protocol & TOPO_PROTO_TCP)) { |
|
|
|
|
if (a->protocol & TOPO_PROTO_UDP) { |
|
|
|
|
struct ETCP_SOCKET* s = ctx->instance->etcp_sockets; |
|
|
|
|
while (s) { if (s->local_addr.ss_family == AF_INET && etcp_link_new(ctx->conn, s, &sa, 0)) { link_count++; addr_links++; } s = s->next; } |
|
|
|
|
} |
|
|
|
|
if ((a->protocol & TOPO_PROTO_TCP)) { |
|
|
|
|
if (a->protocol & TOPO_PROTO_TCP) { |
|
|
|
|
struct ETCP_SOCKET* s = ctx->instance->etcp_sockets; |
|
|
|
|
while (s) { if (s->is_tcp && s->local_addr.ss_family == AF_INET) { |
|
|
|
|
struct ETCP_LINK *tlink = etcp_link_new(ctx->conn, s, &sa, 0); |
|
|
|
|
@ -111,7 +111,7 @@ static void connect_create_links_v6(struct ETCP_CONNECT* ctx, struct TOPO_GROUP_
|
|
|
|
|
memcpy(&sin6.sin6_addr, a->addr, 16); sin6.sin6_port = htons(a->port); |
|
|
|
|
int is_ll = (a->addr[0] == 0xfe && (a->addr[1] & 0xc0) == 0x80); |
|
|
|
|
int addr_links = 0; |
|
|
|
|
if (!(a->protocol & TOPO_PROTO_TCP)) { |
|
|
|
|
if (a->protocol & TOPO_PROTO_UDP) { |
|
|
|
|
struct ETCP_SOCKET* s = ctx->instance->etcp_sockets; |
|
|
|
|
while (s) { if (s->local_addr.ss_family == AF_INET6) { |
|
|
|
|
if (is_ll) sin6.sin6_scope_id = s->netif_index; |
|
|
|
|
|