All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables 1.3.6 not using /etc/networks
@ 2006-11-12  1:25 Laurence J. Lane
  2006-11-12  2:35 ` Laurence J. Lane
  0 siblings, 1 reply; 30+ messages in thread
From: Laurence J. Lane @ 2006-11-12  1:25 UTC (permalink / raw)
  To: netfilter-devel

http://bugs.debian.org/398082

iptables 1.3.5 and 1.3.6 appear to read /etc/networks, but the
information is lost somewhere with 1.3.6.

  # cat /etc/networks
  foonet 10.0.0.0

  # strace -s 255 -o /tmp/foo iptables -v -A INPUT -s foonet/8 -j
ACCEPT #1.3.5 [1]
  ACCEPT  all opt -- in * out *  10.0.0.0/8  -> 0.0.0.0/0

  # 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.

1. http://people.debian.org/~ljlane/stuff/strace-iptables-1.3.5.txt
2. http://people.debian.org/~ljlane/stuff/strace-iptables-1.3.6.txt

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: iptables 1.3.6 not using /etc/networks
@ 2006-11-13 17:00 Alexey Toptygin
  0 siblings, 0 replies; 30+ messages in thread
From: Alexey Toptygin @ 2006-11-13 17:00 UTC (permalink / raw)
  To: Martijn Lievaart; +Cc: Phil Oester, Laurence J. Lane, netfilter-devel


Sorry if this is a duplicate message, but I haven't seen the first copy 
show up in the list archives so I suspect my mail server ate it.

On Mon, 13 Nov 2006, Martijn Lievaart wrote:

> Alexey Toptygin wrote:
> 
>> I don't understand what you mean. I think if it starts with a digit, it must 
>> be an IP (or part of an IP with 0's dropped), else it is a network name or a 
>> domain name (since neither of those can start with digits). If it's an IP by 
>> the above logic, then pad it with '.0's as necessary (or translate directly 
>> into a number without padding first). If it's not an IP, first call 
>> getnetbyname on it and if that returns NULL call gethostbyname. I think this 
>> algorithm works in all cases, unless I'm missing something.
> 
> Domains can legitimately start with digits. F.i. 9292ov.nl. However, checking 
> for a valid IP address (in all forms) should be trivial.

No, domains can't start with a digit. See RFC 1034:

ftp://ftp.rfc-editor.org/in-notes/rfc1034.txt

>From which I quote:

> <domain> ::= <subdomain> | " "
> 
> <subdomain> ::= <label> | <subdomain> "." <label>
> 
> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
> 
> <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
> 
> <let-dig-hyp> ::= <let-dig> | "-"
> 
> <let-dig> ::= <letter> | <digit>
> 
> <letter> ::= any one of the 52 alphabetic characters A through Z in
> upper case and a through z in lower case
> 
> <digit> ::= any one of the ten digits 0 through 9

 			Alexey

^ permalink raw reply	[flat|nested] 30+ messages in thread
[parent not found: <200611131926.kADJPxur030380@mail3.jubileegroup.co.uk>]

end of thread, other threads:[~2006-11-29 14:21 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-12  1:25 iptables 1.3.6 not using /etc/networks Laurence J. Lane
2006-11-12  2:35 ` Laurence J. Lane
2006-11-12 17:33   ` Phil Oester
2006-11-12 19:36     ` Alexey Toptygin
2006-11-12 19:43       ` Phil Oester
2006-11-13  0:58         ` Alexey Toptygin
2006-11-13  7:23           ` Martijn Lievaart
2006-11-13 15:50             ` Alexey Toptygin
2006-11-13 20:20               ` Martijn Lievaart
2006-11-13 21:23                 ` Alexey Toptygin
2006-11-14  9:06                   ` offtopic " Amin Azez
2006-11-14  9:24               ` Benny Amorsen
2006-11-13 17:12           ` Phil Oester
2006-11-13 17:56             ` Alexey Toptygin
2006-11-13 19:50               ` scott comer (sccomer)
2006-11-18 22:09     ` Laurence J. Lane
2006-11-18 22:12       ` Laurence J. Lane
2006-11-20  0:00       ` Pablo Neira Ayuso
2006-11-23 14:10         ` Patrick McHardy
2006-11-23 20:56           ` Pablo Neira Ayuso
2006-11-24  5:55             ` Phil Oester
2006-11-24  8:43               ` Patrick McHardy
2006-11-29  4:44                 ` Phil Oester
2006-11-29 12:50                   ` Patrick McHardy
2006-11-29 14:09         ` Amin Azez
2006-11-29 14:21           ` Pablo Neira Ayuso
2006-11-19 20:34     ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2006-11-13 17:00 Alexey Toptygin
     [not found] <200611131926.kADJPxur030380@mail3.jubileegroup.co.uk>
2006-11-14 10:17 ` G.W. Haywood
2006-11-14 19:28   ` Grant Coady

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.