From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: xtables: restrict several matches to ipv4 and ipv6
Date: Wed, 15 Apr 2026 13:20:13 +0200 [thread overview]
Message-ID: <ad90bW_55v9hU-x5@chamomile> (raw)
In-Reply-To: <ad9z8Bv9-BvL-cPd@strlen.de>
On Wed, Apr 15, 2026 at 01:18:08PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > diff --git a/net/netfilter/xt_realm.c b/net/netfilter/xt_realm.c
> > index 6df485f4403d..130ebe5d1c43 100644
> > --- a/net/netfilter/xt_realm.c
> > +++ b/net/netfilter/xt_realm.c
> > @@ -27,24 +27,35 @@ realm_mt(const struct sk_buff *skb, struct xt_action_param *par)
> > return (info->id == (dst->tclassid & info->mask)) ^ info->invert;
> > }
> >
> > -static struct xt_match realm_mt_reg __read_mostly = {
> > - .name = "realm",
> > - .match = realm_mt,
> > - .matchsize = sizeof(struct xt_realm_info),
> > - .hooks = (1 << NF_INET_POST_ROUTING) | (1 << NF_INET_FORWARD) |
> > - (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_LOCAL_IN),
> > - .family = NFPROTO_UNSPEC,
> > - .me = THIS_MODULE
> > +static struct xt_match realm_mt_reg[] __read_mostly = {
> > + {
> > + .name = "realm",
> > + .match = realm_mt,
> > + .matchsize = sizeof(struct xt_realm_info),
> > + .hooks = (1 << NF_INET_POST_ROUTING) | (1 << NF_INET_FORWARD) |
> > + (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_LOCAL_IN),
> > + .family = NFPROTO_IPV4,
> > + .me = THIS_MODULE
> > + },
> > + {
> > + .name = "realm",
> > + .match = realm_mt,
> > + .matchsize = sizeof(struct xt_realm_info),
> > + .hooks = (1 << NF_INET_POST_ROUTING) | (1 << NF_INET_FORWARD) |
> > + (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_LOCAL_IN),
> > + .family = NFPROTO_IPV6,
> > + .me = THIS_MODULE
> > + }
> > };
>
> Is this for possible users of ip6tables ... -t realm?
> AFAICS dst->tclassid is never populated for ipv6, so while its possible
> to use it from ip6tables I don't think it can match.
>
> I don't object to this change of course. I just wonder why this was
> ever changed from ipt_realm to xt in the first place.
Patch description is quite terse...
I can just restrict realm to IPv4 only, sending v2.
> It was done as part of 2e4e6a17af35 ("[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables").
prev parent reply other threads:[~2026-04-15 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 10:47 [PATCH nf] netfilter: xtables: restrict several matches to ipv4 and ipv6 Pablo Neira Ayuso
2026-04-15 11:18 ` Florian Westphal
2026-04-15 11:20 ` Pablo Neira Ayuso [this message]
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=ad90bW_55v9hU-x5@chamomile \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@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 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.