xref: /kernel/linux/linux-6.6/samples/bpf/run_cookie_uid_helper_example.sh
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/samples/bpf/
162306a36Sopenharmony_ci#!/bin/bash
262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
362306a36Sopenharmony_cilocal_dir="$(pwd)"
462306a36Sopenharmony_ciroot_dir=$local_dir/../..
562306a36Sopenharmony_cimnt_dir=$(mktemp -d --tmp)
662306a36Sopenharmony_ci
762306a36Sopenharmony_cion_exit() {
862306a36Sopenharmony_ci	iptables -D OUTPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT
962306a36Sopenharmony_ci	umount ${mnt_dir}
1062306a36Sopenharmony_ci	rm -r ${mnt_dir}
1162306a36Sopenharmony_ci}
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_citrap on_exit EXIT
1462306a36Sopenharmony_cimount -t bpf bpf ${mnt_dir}
1562306a36Sopenharmony_ci./per_socket_stats_example ${mnt_dir}/bpf_prog $1
16

Indexes created Thu Nov 07 10:32:03 CST 2024