BPF List
 help / color / mirror / Atom feed
* Need help in tracing nf_nat kprobe
@ 2024-01-02 11:14 P K
  2024-01-02 23:25 ` John Fastabend
  0 siblings, 1 reply; 2+ messages in thread
From: P K @ 2024-01-02 11:14 UTC (permalink / raw)
  To: bpf

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Need help in tracing nf_nat kprobe
  2024-01-02 11:14 Need help in tracing nf_nat kprobe P K
@ 2024-01-02 23:25 ` John Fastabend
  0 siblings, 0 replies; 2+ messages in thread
From: John Fastabend @ 2024-01-02 23:25 UTC (permalink / raw)
  To: P K, bpf

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-02 23:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02 11:14 Need help in tracing nf_nat kprobe P K
2024-01-02 23:25 ` John Fastabend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox