summaryrefslogtreecommitdiff
path: root/samples/bpf/run_cookie_uid_helper_example.sh
diff options
context:
space:
mode:
authorChenbo Feng <fengc@google.com>2017-04-05 19:00:56 -0700
committerDavid S. Miller <davem@davemloft.net>2017-04-08 08:07:01 -0700
commit00f660eaf37808aa0a537c288c9e2dee73bd4316 (patch)
tree566ff6609ee3fc6ff216b9c18d3118dc50b3bf30 /samples/bpf/run_cookie_uid_helper_example.sh
parent5daab9db7b65df87da26fd8cfa695fb9546a1ddb (diff)
Sample program using SO_COOKIE
Added a per socket traffic monitoring option to illustrate the usage of new getsockopt SO_COOKIE. The program is based on the socket traffic monitoring program using xt_eBPF and in the new option the data entry can be directly accessed using socket cookie. The cookie retrieved allow us to lookup an element in the eBPF for a specific socket. Signed-off-by: Chenbo Feng <fengc@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/run_cookie_uid_helper_example.sh')
-rwxr-xr-x[-rw-r--r--]samples/bpf/run_cookie_uid_helper_example.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/run_cookie_uid_helper_example.sh b/samples/bpf/run_cookie_uid_helper_example.sh
index 40da8aa75c44..f898cfa2b1aa 100644..100755
--- a/samples/bpf/run_cookie_uid_helper_example.sh
+++ b/samples/bpf/run_cookie_uid_helper_example.sh
@@ -4,11 +4,11 @@ root_dir=$local_dir/../..
mnt_dir=$(mktemp -d --tmp)
on_exit() {
- iptables -D INPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT
+ iptables -D OUTPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT
umount ${mnt_dir}
rm -r ${mnt_dir}
}
trap on_exit EXIT
mount -t bpf bpf ${mnt_dir}
-./per_socket_stats_example ${mnt_dir}/bpf_prog
+./per_socket_stats_example ${mnt_dir}/bpf_prog $1