From: Alexey Toptygin Subject: Re: iptables 1.3.6 not using /etc/networks Date: Sun, 12 Nov 2006 19:36:34 +0000 (UTC) Message-ID: References: <20061112173312.GA2593@linuxace.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "Laurence J. Lane" , netfilter-devel@lists.netfilter.org Return-path: To: Phil Oester In-Reply-To: <20061112173312.GA2593@linuxace.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org On Sun, 12 Nov 2006, Phil Oester wrote: > On Sat, Nov 11, 2006 at 09:35:08PM -0500, Laurence J. Lane wrote: >> On 11/11/06, Laurence J. Lane wrote: >> >>> # strace -s 255 -o /tmp/bar iptables -v -A INPUT -s foonet/8 -j >>> ACCEPT #1.3.6 [2] >>> iptables v1.3.6: host/network `foonet.0.0.0' not found >>> Try `iptables -h' or 'iptables --help' for more information. >> >> This looks like something with the pad_cidr() call in >> parse_hostnetworkmask(). ltrace shows the code calling >> getnetbyname("foonet.0.0.0") instead of getentbyname("foonet"). > > Correct. This was added between 1.3.5 and 1.3.6 to more sanely > handle CIDR notation. See the commit: > > https://lists.netfilter.org/pipermail/netfilter-cvslog/2006-July/005122.html > > Not sure offhand how we can satisfy both cases here, but I'd posit > that more people use x.x.x/24 than use foonet/x notation. Isn't it always true that foonet/y starts with a letter and x.x.x/y starts with a digit? In this case, checking that the string starts with a digit before searching it for '.' characters and appending '.0's should work. Alexey