From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3B0002C793 for ; Thu, 25 Apr 2019 09:50:16 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LJISAGOoTWqo for ; Thu, 25 Apr 2019 09:50:16 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E1F422ADF9 for ; Thu, 25 Apr 2019 09:50:15 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 4/6] swim: wrap sio_strfaddr() References: <73ba32c413ce9371b845ac161a0d5ea698fac575.1556116199.git.v.shpilevoy@tarantool.org> <20190424164039.GD13687@atlas> <68d992e3-e92f-680c-73a3-eb2e5ad1f6b3@tarantool.org> <20190425103440.GD29257@atlas> From: Vladislav Shpilevoy Message-ID: <3d540888-2e1b-1676-3d71-2e867cef2957@tarantool.org> Date: Thu, 25 Apr 2019 16:50:13 +0300 MIME-Version: 1.0 In-Reply-To: <20190425103440.GD29257@atlas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Konstantin Osipov Cc: tarantool-patches@freelists.org On 25/04/2019 13:34, Konstantin Osipov wrote: > * Vladislav Shpilevoy [19/04/25 00:46]: >>> This is minor, but I would make sio_strfaddr() use the same set of >>> buffers as provided by tt_static_buf() instead, with a static >>> assert that the buffer size is large enough. >> >> As I said, the tt_static_buf is not big enough. SIO uses NI_MAXHOST >> constant which on Linux is 1025 > size of tt_static_buf. >> >> http://man7.org/linux/man-pages/man3/getnameinfo.3.html >> >> If you still think we will not break anything, I can do that. Just >> confirm that you are sure. >> >> It will not eliminate swim_inaddr_str() though, because most of >> the problems were about huge cast to 'const struct sockaddr *' >> and passing sizeof(struct sockaddr_in) each time - it made code >> unreadable. > > I don't have a strong opinion either way, but the length problem > could be fixed by increasing tt_static_buf() size, and adding a > static assert that it's greater than NI_MAXHOST. Done in a separate commit. > > It's OK to keep swim_inaddr_str() wrapper. > > -- > Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 > http://tarantool.io - www.twitter.com/kostja_osipov >