From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Alemayhu Subject: Re: [PATCH iptables] libxtables: fix wrong naddr when using localhost Date: Wed, 8 Mar 2017 12:10:46 +0100 Message-ID: <20170308111046.GB5717@gmail.com> References: <20170307232813.17428-1-alexander@alemayhu.com> <20170308095532.GA1723@salvia> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: netfilter-devel@vger.kernel.org To: Pablo Neira Ayuso Return-path: Received: from mail-wr0-f177.google.com ([209.85.128.177]:34688 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752703AbdCHLMZ (ORCPT ); Wed, 8 Mar 2017 06:12:25 -0500 Received: by mail-wr0-f177.google.com with SMTP id l37so20837784wrc.1 for ; Wed, 08 Mar 2017 03:10:54 -0800 (PST) Content-Disposition: inline In-Reply-To: <20170308095532.GA1723@salvia> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Wed, Mar 08, 2017 at 10:55:32AM +0100, Pablo Neira Ayuso wrote: > > This is actually a generic problem: > > # iptables -I INPUT -p tcp -s localhost > > results in: > > # iptables-save > # Generated by iptables-save v1.6.1 on Wed Mar 8 10:53:07 2017 > *filter > :INPUT ACCEPT [13:1628] > :FORWARD ACCEPT [0:0] > :OUTPUT ACCEPT [4:317] > -A INPUT -s 127.0.0.1/32 -p tcp > -A INPUT -s 127.0.0.1/32 -p tcp > COMMIT > # Completed on Wed Mar 8 10:53:07 2017 > What's the right way to fix this? I want to use iptables-translate in a web application[0] so I can copy and use the translations. Adding the extra line forces me to manually edit the output. > Original problem was introduce at: > > commit 2d2b5e046aa56a518160716a9ddf9df53fc79c1f > Author: Arpan Kapoor > Date: Thu Mar 17 18:27:19 2016 +0530 > > libxtables: Replace gethostbyname() with getaddrinfo() > > Did you also run iptables tests? See iptables-test.py, although I > guess our test infrastructure is not catching up this case. > Before and after patch I get: 102 test files, 706 unit tests, 687 passed Thanks. [0]: https://2nft.alemayhu.com/ -- Mit freundlichen Grüßen Alexander Alemayhu