Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2006 12:35:30 +0200
From:      Daniel Hartmeier <daniel@benzedrine.cx>
To:        Boris Polevoy <vapcom@mail.ru>
Cc:        mlaier@freebsd.org, pf@benzedrine.cx, freebsd-pf@freebsd.org
Subject:   Re: PF with subanchors possible bug
Message-ID:  <20060428103529.GL19449@insomnia.benzedrine.cx>
In-Reply-To: <E1FZOYH-0002ho-00.vapcom-mail-ru@f22.mail.ru>
References:  <E1FZOYH-0002ho-00.vapcom-mail-ru@f22.mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 28, 2006 at 12:42:13PM +0400, Boris Polevoy wrote:

> Is it bug or not?

Yes, it looks like a bug. Or, more than one, actually.

I assume what you expect the sequence to do is the same as

  # echo 'anchor "external"' | pfctl -f -
  # echo 'anchor "internal"' | pfctl -a external -f -
  # echo 'pass all' | pfctl -a external/internal -f -

(leaving out the table, which isn't really relevant, I think)

i.e. you expect "internal" to be nested within "external", like

  # pfctl -vsA
  external
  external/internal

  # pfctl -sr
  anchor "external" all

  # pfctl -a external -sr
  anchor "internal" all

  # pfctl -a external/internal -sr
  pass all

Your patch fixes that. But there is another one, when doing
"pfctl -a external -f", it doesn't prefix the (relative!) paths
within the input with the anchor specified through -a.

Therefore, when I do the same (it should be the same, IMO) with files,
like

  # cat x
  anchor "external"
  load anchor "external" from "y"

  # cat y
  anchor "internal"
  load anchor "internal" from "z"

  # cat z
  pass z

  # pfctl -f x

  # pfctl -vsA
  external
  external/internal
  internal

  # pfctl -a external/internal -sr
  [ empty ]

  # pfctl -a internal -sr
  pass all

the rule loaded from z is not placed into the right anchor
(external/internal), but a second anchor (internal) is created for it.

I'll have to find the right place to fix THAT, too.

Daniel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060428103529.GL19449>