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 3E4BF266B3 for ; Thu, 22 Aug 2019 09:15:25 -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 HdW3Cj-2-6mC for ; Thu, 22 Aug 2019 09:15:25 -0400 (EDT) Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 D841225405 for ; Thu, 22 Aug 2019 09:15:24 -0400 (EDT) Date: Thu, 22 Aug 2019 16:15:23 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] Replace sendmsg with sendto shortcut Message-ID: <20190822131523.vzrn56cifuryq7vg@tarantool.org> References: <20190820120102.60158-1-m.melentiev@corp.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190820120102.60158-1-m.melentiev@corp.mail.ru> 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: tarantool-patches@freelists.org Cc: Max Melentiev Hello, On 20 Aug 15:01, Max Melentiev wrote: > There is a problem with calculating .msg_namelen field > of msghdr struct. Instead of > > .msg_name = &sa, > .msg_namelen = sizeof(sa.sun_family) + strlen(sd_unix_path), > > it must set as > > .msg_namelen = sizeof(sa) // larger value than current invalid one > > It works on linux but when I tried to enable this feature for macOS > it didn't (maybe because of different order of fields in the struct). > > Instead of fixing calculation, I've replaced original sendmsg call > with sendto, because it's a convenient shortcut which > simplifies code and can prevent such mistakes. I've checked your patch into 1.10, 2.1, 2.2 and master. -- Regards, Kirill Yukhin