mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
Fix upnp binding loop when not getting provided port
This commit is contained in:
parent
0f9f315cbb
commit
5ede7a56fa
2 changed files with 6 additions and 7 deletions
|
|
@ -558,9 +558,8 @@ int linphone_upnp_context_send_add_port_binding(UpnpContext *lupnp, UpnpPortBind
|
|||
mapping.local_port = port->local_port;
|
||||
mapping.local_host = port->local_addr;
|
||||
if(port->external_port == -1)
|
||||
mapping.remote_port = rand()%(0xffff - 1024) + 1024;
|
||||
else
|
||||
mapping.remote_port = port->external_port;
|
||||
port->external_port = rand()%(0xffff - 1024) + 1024;
|
||||
mapping.remote_port = port->external_port;
|
||||
mapping.remote_host = "";
|
||||
snprintf(description, 128, "%s %s at %s:%d",
|
||||
PACKAGE_NAME,
|
||||
|
|
@ -882,7 +881,7 @@ void linphone_upnp_update_port_binding(UpnpContext *lupnp, UpnpPortBinding **por
|
|||
}
|
||||
}
|
||||
if(*port_mapping == NULL) {
|
||||
*port_mapping = linphone_upnp_port_binding_new_or_collect(lupnp->pending_bindings, protocol, port, port);
|
||||
*port_mapping = linphone_upnp_port_binding_new_or_collect(lupnp->pending_bindings, protocol, port, -1);
|
||||
}
|
||||
|
||||
// Get addresses
|
||||
|
|
@ -1112,8 +1111,8 @@ void linphone_upnp_port_binding_log(int level, const char *msg, const UpnpPortBi
|
|||
|
||||
bool_t linphone_upnp_port_binding_equal(const UpnpPortBinding *port1, const UpnpPortBinding *port2) {
|
||||
return port1->protocol == port2->protocol &&
|
||||
port1->local_port == port2->local_port &&
|
||||
port1->external_port == port2->external_port;
|
||||
port1->local_port == port2->local_port &&
|
||||
(port1->external_port == -1 || port2->external_port == -1 || port1->external_port == port2->external_port);
|
||||
}
|
||||
|
||||
UpnpPortBinding *linphone_upnp_port_binding_equivalent_in_list(MSList *list, const UpnpPortBinding *port) {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 8e7337469af474929fd038f1e4743737ff0a904b
|
||||
Subproject commit f6c51a11f1ef1156c6f768b8466698a2305a2188
|
||||
Loading…
Add table
Reference in a new issue