invite: убрать BOTH-протокол — адрес либо UDP либо TCP
This commit is contained in:
1 parent
37ef08a015
commit
bcea4bc335
4 files changed
+6
-7
No files matched your search
@@ -17,7 +17,6 @@
|
||||
|
||||
#define INVITE_PROTO_UDP 0x01
|
||||
#define INVITE_PROTO_TCP 0x02
|
||||
#define INVITE_PROTO_BOTH 0x03
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user