Commit b9626f45 authored by Taeung Song's avatar Taeung Song Committed by Daniel Borkmann

samples/bpf: Fix tc and ip paths in xdp2skb_meta.sh

The below path error can occur:

  # ./xdp2skb_meta.sh --dev eth0 --list
  ./xdp2skb_meta.sh: line 61: /usr/sbin/tc: No such file or directory

So just use command names instead of absolute paths of tc and ip.
In addition, it allow callers to redefine $TC and $IP paths

Fixes: 36e04a2d ("samples/bpf: xdp2skb_meta shows transferring info from XDP to SKB")
Reviewed-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarTaeung Song <treeze.taeung@gmail.com>
Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent f292b87d
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
BPF_FILE=xdp2skb_meta_kern.o BPF_FILE=xdp2skb_meta_kern.o
DIR=$(dirname $0) DIR=$(dirname $0)
export TC=/usr/sbin/tc [ -z "$TC" ] && TC=tc
export IP=/usr/sbin/ip [ -z "$IP" ] && IP=ip
function usage() { function usage() {
echo "" echo ""
...@@ -53,7 +53,7 @@ function _call_cmd() { ...@@ -53,7 +53,7 @@ function _call_cmd() {
local allow_fail="$2" local allow_fail="$2"
shift 2 shift 2
if [[ -n "$VERBOSE" ]]; then if [[ -n "$VERBOSE" ]]; then
echo "$(basename $cmd) $@" echo "$cmd $@"
fi fi
if [[ -n "$DRYRUN" ]]; then if [[ -n "$DRYRUN" ]]; then
return return
......
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