Commit a1140168 authored by Paul Chaignon's avatar Paul Chaignon

tcpconnect: Remove unnecessary bpf_probe_read calls

parent f1e9abe7
...@@ -75,12 +75,10 @@ static int trace_connect_return(struct pt_regs *ctx, short ipver) ...@@ -75,12 +75,10 @@ static int trace_connect_return(struct pt_regs *ctx, short ipver)
struct sock *skp = *skpp; struct sock *skp = *skpp;
u32 saddr = 0, daddr = 0; u32 saddr = 0, daddr = 0;
u16 dport = 0; u16 dport = 0;
bpf_probe_read(&dport, sizeof(dport), &skp->__sk_common.skc_dport); dport = skp->__sk_common.skc_dport;
if (ipver == 4) { if (ipver == 4) {
bpf_probe_read(&saddr, sizeof(saddr), saddr = skp->__sk_common.skc_rcv_saddr;
&skp->__sk_common.skc_rcv_saddr); daddr = skp->__sk_common.skc_daddr;
bpf_probe_read(&daddr, sizeof(daddr),
&skp->__sk_common.skc_daddr);
// output // output
bpf_trace_printk("4 %x %x %d\\n", saddr, daddr, ntohs(dport)); bpf_trace_printk("4 %x %x %d\\n", saddr, daddr, ntohs(dport));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment