From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix use of sockaddr_in Date: Sun, 14 May 2017 17:20:33 +0300 Message-ID: <8337c78qq6.fsf@gnu.org> References: <83shk989r5.fsf@gnu.org> <20170513150837.31184-1-phst@google.com> <83h90o8zt9.fsf@gnu.org> <877f1kefhi.fsf@linux-m68k.org> <83a86g8siw.fsf@gnu.org> <87y3u0cyjy.fsf@linux-m68k.org> <838tm088yj.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1494771693 13220 195.159.176.226 (14 May 2017 14:21:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 May 2017 14:21:33 +0000 (UTC) Cc: phst@google.com, p.stephani2@gmail.com, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 14 16:21:27 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9uOl-0003HD-J0 for ged-emacs-devel@m.gmane.org; Sun, 14 May 2017 16:21:27 +0200 Original-Received: from localhost ([::1]:32893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9uOp-0002cy-Bw for ged-emacs-devel@m.gmane.org; Sun, 14 May 2017 10:21:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9uOD-0002ch-Rz for emacs-devel@gnu.org; Sun, 14 May 2017 10:20:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9uOA-0000YW-OL for emacs-devel@gnu.org; Sun, 14 May 2017 10:20:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9uOA-0000YO-L9; Sun, 14 May 2017 10:20:50 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d9uO9-0008Lj-Ov; Sun, 14 May 2017 10:20:50 -0400 In-reply-to: (message from Andreas Schwab on Sun, 14 May 2017 08:11:01 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214841 Archived-At: > From: Andreas Schwab > Cc: p.stephani2@gmail.com, phst@google.com, emacs-devel@gnu.org > Date: Sun, 14 May 2017 08:11:01 +0200 > > On Mai 14 2017, Eli Zaretskii wrote: > > > But the original patch (and the original code) didn't handle that > > case. > > What do you want to say? I guess I'm saying that I didn't understand your comment. AFAIU, your comment says that when getsockname is called for AF_UNIX sockets, it returns a structure that doesn't report a port, only a file name. The original code didn't handle this use case, so if your intent was to say that this condition should be added to the code, i.e. for AF_UNIX we should not try to compute the port, then I agree. However, this is orthogonal to my suggestion, which only affected AF_INET and AF_INET6 cases. For those cases, the port is at the same offset, and adding an assertion about that is IMO all that's needed.