From: "Laura García Liébana" <nevola@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development Mailing list 
	<netfilter-devel@vger.kernel.org>,
	devel@zevenet.com
Subject: Re: [PATCH nf-next 2/2] netfilter: nft: add support of reject verdict from ingress
Date: Fri, 12 Jun 2020 10:34:12 +0200	[thread overview]
Message-ID: <CAF90-Wib46a=cmVYa=shEeWDWOfxJ3HrdcGHpwQWeFwsCFw47Q@mail.gmail.com> (raw)
In-Reply-To: <20200609153541.GA25538@salvia>
Hi Pablo,
On Tue, Jun 9, 2020 at 5:35 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> Hi Laura,
>
> On Mon, Jun 08, 2020 at 09:01:03PM +0200, Laura Garcia Liebana wrote:
> > diff --git a/net/netfilter/nft_reject_netdev.c b/net/netfilter/nft_reject_netdev.c
> > new file mode 100644
> > index 000000000000..64123d80210d
> > --- /dev/null
> > +++ b/net/netfilter/nft_reject_netdev.c
> [...]
> > +static void nft_reject_netdev_eval(const struct nft_expr *expr,
> > +                                struct nft_regs *regs,
> > +                                const struct nft_pktinfo *pkt)
> > +{
> > +     switch (ntohs(pkt->skb->protocol)) {
> > +     case ETH_P_IP:
> > +             nft_reject_ipv4_eval(expr, regs, pkt);
> > +             break;
> > +     case ETH_P_IPV6:
> > +             nft_reject_ipv6_eval(expr, regs, pkt);
> > +             break;
> > +     }
>
> We should reuse nft_reject_br_send_v4_tcp_reset() and
> nft_reject_br_send_v4_unreach() and call dev_queue_xmit() to send the
> reject packet.
>
> No need to inject this from LOCAL_OUT, given this packet is being
> rejects from the ingress path.
>
> The reject action for netdev is more similar to the one that bridge
> supports than what we have for inet actually.
>
> You can probably move the bridge functions to
> net/netfilter/nf_reject.c so this code can be shared between bridge
> reject and netdev.
>
Thank you for your review, I'll apply the changes.
> I like your code refactoring in patch 1 though.
     prev parent reply	other threads:[~2020-06-12  8:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 19:01 [PATCH nf-next 2/2] netfilter: nft: add support of reject verdict from ingress Laura Garcia Liebana
2020-06-09 15:35 ` Pablo Neira Ayuso
2020-06-12  8:34   ` Laura García Liébana [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='CAF90-Wib46a=cmVYa=shEeWDWOfxJ3HrdcGHpwQWeFwsCFw47Q@mail.gmail.com' \
    --to=nevola@gmail.com \
    --cc=devel@zevenet.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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;
as well as URLs for NNTP newsgroup(s).