netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Eugene Crosser <crosser@average.org>
Cc: Jan Engelhardt <jengelh@inai.de>, netfilter-devel@vger.kernel.org
Subject: Re: ebtables: load-on-demand extensions
Date: Fri, 19 Jun 2020 17:15:30 +0200	[thread overview]
Message-ID: <20200619151530.GA3894@salvia> (raw)
In-Reply-To: <874fd8a8-dfd2-f6c3-ae01-61884ca9bcff@average.org>

On Fri, Jun 19, 2020 at 03:45:57PM +0200, Eugene Crosser wrote:
> On 6/16/20 6:33 PM, Jan Engelhardt wrote:
>
> >>> Why not make a patch to publicly expose the skb's data via nft_meta?
> >>> No more custom modules, no more userspace modifications [..]
> >>
> >> For our particular use case, we are running the skb through the kernel
> >> function `skb_validate_network_len()` with custom mtu size [..]
> >
> > I find no such function in the current or past kernels. Perhaps you could post
> > the code of the module(s) you already have, and we can assess if it, or the
> > upstream ideals, can be massaged to make the code stick.
>
> I really really don't see our module being useful for anyone else! Even
> for us, it's just a stopgap measure, hopefully to be dropped after a few
> months. That said, I believe that the company will have no objections
> against publishing it. I've uploaded initial (untested) code on github
> here https://github.com/crosser/ebt-pmtud, in case anyone is interested.

I think there is a way to achieve this with nft 0.9.6 ?

commit 2a20b5bdbde8a1b510f75b1522772b07e51a77d7
Author: Michael Braun <...>
Date:   Wed May 6 11:46:23 2020 +0200

    datatype: add frag-needed (ipv4) to reject options

    This enables to send icmp frag-needed messages using reject target.

    I have a bridge with connects an gretap tunnel with some ethernet lan.
    On the gretap device I use ignore-df to avoid packets being lost without
    icmp reject to the sender of the bridged packet.

    Still I want to avoid packet fragmentation with the gretap packets.
    So I though about adding an nftables rule like this:

    nft insert rule bridge filter FORWARD \
      ip protocol tcp \
      ip length > 1400 \
      ip frag-off & 0x4000 != 0 \
      reject with icmp type frag-needed

    This would reject all tcp packets with ip dont-fragment bit set that are
    bigger than some threshold (here 1400 bytes). The sender would then receive
    ICMP unreachable - fragmentation needed and reduce its packet size (as
    defined with PMTU).

  reply	other threads:[~2020-06-19 15:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 14:48 ebtables: load-on-demand extensions Eugene Crosser
2020-06-16 15:21 ` Jan Engelhardt
2020-06-16 15:54   ` Eugene Crosser
2020-06-16 16:33     ` Jan Engelhardt
2020-06-19 13:45       ` Eugene Crosser
2020-06-19 15:15         ` Pablo Neira Ayuso [this message]
2020-06-19 16:21           ` Eugene Crosser
2020-06-20 10:34           ` Expose skb_gso_validate_network_len() [Was: ebtables: load-on-demand extensions] Eugene Crosser
2020-06-20 11:04             ` Florian Westphal
2020-06-20 21:16               ` Eugene Crosser
2020-06-21  3:24                 ` Florian Westphal
2020-06-21 10:03                   ` Jan Engelhardt
2020-06-21 18:48                     ` Eugene Crosser
2020-06-21 23:52                     ` Florian Westphal
2020-06-22  4:50                       ` Jan Engelhardt
2020-06-22  7:41                         ` Eugene Crosser

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=20200619151530.GA3894@salvia \
    --to=pablo@netfilter.org \
    --cc=crosser@average.org \
    --cc=jengelh@inai.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 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).