Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#1656 closed defect (invalid)

It may be a bug of udp rbtree init in function ngx_set_inherited_sockets

Reported by: chronolaw@… Owned by:
Priority: minor Milestone: nginx-1.15
Component: nginx-core Version: 1.15.x
Keywords: udp listen Cc:
uname -a:
nginx -V: nginx version: nginx/1.15.3

Description

Nginx 1.15.0 introduce udp session feature, but when we update new binary then function ngx_set_inherited_sockets has not init rbtree properly.

So I commit a patch try to fix it, thanks all.

# HG changeset patch
# User chronolaw <chronolaw@…>
# Date 1539836512 -28800
# Thu Oct 18 12:21:52 2018 +0800
# Node ID 7f75bc03620617a93185935a8f04db6e018c20e5
# Parent 8b68d50090e4f134a35da60146fefd5e63770759
Fix the bug of udp rbtree init in ngx_set_inherited_sockets

diff -r 8b68d50090e4 -r 7f75bc036206 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c Wed Oct 03 14:08:51 2018 +0300
+++ b/src/core/ngx_connection.c Thu Oct 18 12:21:52 2018 +0800
@@ -214,6 +214,10 @@

ls[i].addr_text.len = len;


+#if !(NGX_WIN32)
+ ngx_rbtree_init(&ls[i].rbtree, &ls[i].sentinel, ngx_udp_rbtree_insert_value);
+#endif
+

ls[i].backlog = NGX_LISTEN_BACKLOG;


olen = sizeof(int);

Attachments (1)

ngx_connection.c.patch (749 bytes ) - added by chronolaw@… 6 years ago.

Download all attachments as: .zip

Change History (3)

by chronolaw@…, 6 years ago

Attachment: ngx_connection.c.patch added

comment:1 by Roman Arutyunyan, 6 years ago

Resolution: invalid
Status: newclosed

ngx_set_inherited_sockets() is only called for the init_cycle which is a fake cycle only used as an inheritance base for a real cycle. Real connections never work with that cycle, which makes this initialization useless. if you have any issues with nginx udp streaming presumably caused by the missing initialization, please report them.

comment:2 by maxim, 5 years ago

Milestone: 1.15nginx-1.15

Milestone renamed

Note: See TracTickets for help on using tickets.