Skip to content

Commit

Permalink
hep_udp listener: Fix "use_children" regression
Browse files Browse the repository at this point in the history
Commit 899f65c introduced a regression where "use_children" would be
ignored for the HEP UDP protocol, possibly leading to extra forked
workers after an OpenSIPS upgrade, failed restarts due to exceeded MySQL
max connections, etc.

(cherry picked from commit 2801fae)
  • Loading branch information
liviuchircu committed Aug 18, 2020
1 parent 1f9b433 commit 7b3a482
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion net/trans.h
Expand Up @@ -73,7 +73,10 @@ extern struct proto_info protos[];
*/

#define is_udp_based_proto(_p) \
(protos[_p].net.flags&PROTO_NET_USE_UDP)
((_p==PROTO_HEP_UDP) || protos[_p].net.flags&PROTO_NET_USE_UDP)
/* XXX: ^ the PROTO_NET_USE_UDP concept is currently broken, since the macro
* may be used well before trans_load() is invoked, thus the "extra" protocols
* from @protos are still uninitialized and the macro will fail to see them */

#define proto_has_listeners(_p) \
(protos[_p].listeners != NULL)
Expand Down
2 changes: 1 addition & 1 deletion socket_info.c
Expand Up @@ -161,7 +161,7 @@ static struct socket_info* new_sock_info( struct socket_id *sid)
memcpy(si->tag.s, sid->tag, si->tag.len+1);
}

if ( si->proto!=PROTO_UDP && si->proto!=PROTO_SCTP ) {
if (!is_udp_based_proto(si->proto)) {
if (sid->workers)
LM_WARN("number of workers per non UDP-based <%.*s> listener not "
"supported -> ignoring...\n", si->name.len, si->name.s);
Expand Down

0 comments on commit 7b3a482

Please sign in to comment.