BPF List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: P K <pkopensrc@gmail.com>,  bpf@vger.kernel.org
Subject: RE: Need help in tracing nf_nat kprobe
Date: Tue, 02 Jan 2024 15:25:12 -0800	[thread overview]
Message-ID: <65949b58d9a1a_11e86208cc@john.notmuch> (raw)
In-Reply-To: <CAL0j0DFrjP=y2TMCmsFr7yYL+dxZ7oJTc49_1WUj-YvK-78kMw@mail.gmail.com>

P K wrote:
> Hi,
> 
> I want to track the Source IP for outgoing packets which are
> masqueraded via iptables in Linux kernel while routing the packet to
> destination.
> 
> I was using kprobe for nf_nat_ipv4_manip_pkt for the same but which is
> not working anymore in the latest kernel 6.1.66-1 onwards.
> 
> What would be the best way to do the same in bpf or kprobe?
> 

Why is it not working anymore. Presumably because the function
was removed or maybe got inlined in newer kernels. Either way
looking for a similar function on 6.1.+ would be one answer.

Perhaps a more stable approach would be ot use the sock ops
hooks. I would just grep for sockops in ./tools/testing/sefltests/bpf/
to see examples on how to do this.

Thanks,
John

      reply	other threads:[~2024-01-02 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 11:14 Need help in tracing nf_nat kprobe P K
2024-01-02 23:25 ` John Fastabend [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=65949b58d9a1a_11e86208cc@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=pkopensrc@gmail.com \
    /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