BPF List
 help / color / mirror / Atom feed
From: "D. Wythe" <alibuda@linux.alibaba.com>
To: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de,
	coreteam@netfilter.org, pabeni@redhat.com, ast@kernel.org,
	netfilter-devel@vger.kernel.org, bpf@vger.kernel.org
Subject: Can netfilter-ebpf modify packets ?
Date: Mon, 18 Dec 2023 14:26:43 +0800	[thread overview]
Message-ID: <e616c2ac-e68b-3814-eac3-304e49eb39b8@linux.alibaba.com> (raw)


Hello everyone,

I've noticed that it's not possible to modify packets via netfilter-ebpf 
right now. I'm curious if this is by design.

Currently, I've observed some issues, such as:

1. The dynptr obtained through bpf_dynptr_from_skb in the netfilter-ebpf 
prog is read-only.
2. In addition to modification, applications may also need to delete or 
append some data in the skb, which dynptr_write cannot meet.
3. Modifying packets involves recalculating csum, or updating 
transparent header, etc.
4. The BPF_PROG_TYPE_SCHED_ACT provides a large number of helpers that 
can meet various packet modification scenarios. However, due to arg_type 
type checks(ARG_PTR_TO_CTX), we cannot use them directly in netfilter yet.

Looking forward to any feedback.

Best wishes,
D. Wythe

                 reply	other threads:[~2023-12-18  6:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=e616c2ac-e68b-3814-eac3-304e49eb39b8@linux.alibaba.com \
    --to=alibuda@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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