Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: "Linus Lüssing" <linus.luessing@c0d3.blue>
Cc: netfilter@vger.kernel.org
Subject: Re: bridge-nf-call-iptables: checking bridge vs. IP context?
Date: Mon, 29 Mar 2021 21:02:55 +0200	[thread overview]
Message-ID: <20210329190255.GE8998@breakpoint.cc> (raw)
In-Reply-To: <20210329180827.GE2742@otheros>

Linus Lüssing <linus.luessing@c0d3.blue> wrote:
> I'm wondering whether I'm currently overlooking a simple solution
> for the following:
> 
> When setting bridge-nf-call-iptables = 1, is there a simple way to
> check within one iptables rule whether it matched from a bridge
> netfilter hook or from an IP netfilter hook?

What is the use case? I would try to not use nf-call-iptables if possible.

If its a bridge netfiler hook, its only visible in ebtables.
If its a "native" IP netfilter hook, the skb has no bridge netfilter
extension, --physdev-is-in/out will never match.

> "--physdev-is-bridged" seemingly is not quite what I'm looking
> for, as it will only match after a bridging decision, in the
> FORWARD or POSTROUTING chains.

Yes, for some reason it was tied to output interface.

  reply	other threads:[~2021-03-29 19:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 18:08 bridge-nf-call-iptables: checking bridge vs. IP context? Linus Lüssing
2021-03-29 19:02 ` Florian Westphal [this message]
2021-03-29 23:24   ` Linus Lüssing
2021-03-30 17:33     ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210329190255.GE8998@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=linus.luessing@c0d3.blue \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox