diff --git a/src/chat/chat_channel.c b/src/chat/chat_channel.c index 5770c00b..5b19f8a8 100644 --- a/src/chat/chat_channel.c +++ b/src/chat/chat_channel.c @@ -59,6 +59,7 @@ static int collect_my_addrs(uint8_t* buf, int max_buf_sz) { struct ETCP_SOCKET* s = g_cc.inst->etcp_sockets; while (s) { + if (s->is_tcp) { s = s->next; continue; } struct sockaddr_storage* sa = s->interface_addr.ss_family ? &s->interface_addr : NULL; if (!sa) sa = s->local_addr.ss_family ? &s->local_addr : NULL; if (sa && sa->ss_family == AF_INET) { diff --git a/src/chat/chat_profile.c b/src/chat/chat_profile.c index a03b8e30..d41fe867 100644 --- a/src/chat/chat_profile.c +++ b/src/chat/chat_profile.c @@ -120,6 +120,7 @@ void chat_core_sync_my_addresses(void) { int sock_count = 0, written = 0, tcp_written = 0, skipped = 0; while (sock) { sock_count++; + if (sock->is_tcp) { sock = sock->next; continue; } if (sock->type == CFG_SERVER_TYPE_PRIVATE || sock->type == CFG_SERVER_TYPE_LOCAL) { skipped++; sock = sock->next; continue; } int sock_family = sock->local_addr.ss_family ? sock->local_addr.ss_family : 0; struct sockaddr_storage* sa = (sock->interface_addr.ss_family == sock_family) ? &sock->interface_addr : NULL; diff --git a/tools/chatgui/src/joindialog.cpp b/tools/chatgui/src/joindialog.cpp index df86461d..39c18713 100644 --- a/tools/chatgui/src/joindialog.cpp +++ b/tools/chatgui/src/joindialog.cpp @@ -104,7 +104,10 @@ JoinDialog::JoinDialog(UtunNode* node, DbManager* db, QWidget* parent, } else { addrStr = QString("ipv6:%1").arg(a.address.toHex().constData()); } - addrList.append(QString("%1:%2").arg(addrStr).arg(a.port)); + QString protoName = (a.proto == INVITE_PROTO_TCP) ? "TCP" + : (a.proto == INVITE_PROTO_UDP) ? "UDP" + : QString("?%1").arg(a.proto); + addrList.append(QString("%1:%2 (%3)").arg(addrStr).arg(a.port).arg(protoName)); } setStatus(QString("Node: 0x%1 | %2") .arg(nodeId, 16, 16, QLatin1Char('0')) diff --git a/tools/chatgui/transport/utun_node.cpp b/tools/chatgui/transport/utun_node.cpp index 45953866..c7148b37 100644 --- a/tools/chatgui/transport/utun_node.cpp +++ b/tools/chatgui/transport/utun_node.cpp @@ -171,7 +171,7 @@ QList UtunNode::getInviteAddresses(DbManager* db) { if (conn && conn->initialized && conn->links_up > 0) { struct ETCP_LINK* link = conn->links; while (link) { - if (link->link_state == 3 && link->nat_type == NAT_TYPE_DIRECT) { + if (!link->is_tcp && link->link_state == 3 && link->nat_type == NAT_TYPE_DIRECT) { struct sockaddr_storage* sa = &link->remote_addr; if (sa->ss_family == AF_INET) { struct sockaddr_in* sin = (struct sockaddr_in*)sa; @@ -195,6 +195,7 @@ QList UtunNode::getInviteAddresses(DbManager* db) { { struct ETCP_SOCKET* sock = m_instance->etcp_sockets; while (sock) { + if (sock->is_tcp) { sock = sock->next; continue; } struct sockaddr_storage* sa = NULL; if (sock->nat_addr.ss_family != 0) sa = &sock->nat_addr;