diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-01-17 11:56:12 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-01-23 12:56:30 +0100 |
commit | bbebce8eb9a54091b9a66121fd26b7caabd76895 (patch) | |
tree | dfb861823eea11cf3a564b1a86fbe0e846241f6f /tools/testing/selftests/bpf/test_tcpnotify_user.c | |
parent | c76e4c228b053eb108e6c3221bef338aa2c98fac (diff) | |
download | linux-bbebce8eb9a54091b9a66121fd26b7caabd76895.tar.gz linux-bbebce8eb9a54091b9a66121fd26b7caabd76895.tar.bz2 linux-bbebce8eb9a54091b9a66121fd26b7caabd76895.zip |
selftests/bpf: don't hardcode iptables/nc path in test_tcpnotify_user
system() is calling shell which should find the appropriate full path
via $PATH. On some systems, full path to iptables and/or nc might be
different that we one we have hardcoded.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_tcpnotify_user.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_tcpnotify_user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/test_tcpnotify_user.c b/tools/testing/selftests/bpf/test_tcpnotify_user.c index 4e4353711a86..86152d9ae95b 100644 --- a/tools/testing/selftests/bpf/test_tcpnotify_user.c +++ b/tools/testing/selftests/bpf/test_tcpnotify_user.c @@ -148,17 +148,17 @@ int main(int argc, char **argv) pthread_create(&tid, NULL, poller_thread, (void *)&pmu_fd); sprintf(test_script, - "/usr/sbin/iptables -A INPUT -p tcp --dport %d -j DROP", + "iptables -A INPUT -p tcp --dport %d -j DROP", TESTPORT); system(test_script); sprintf(test_script, - "/usr/bin/nc 127.0.0.1 %d < /etc/passwd > /dev/null 2>&1 ", + "nc 127.0.0.1 %d < /etc/passwd > /dev/null 2>&1 ", TESTPORT); system(test_script); sprintf(test_script, - "/usr/sbin/iptables -D INPUT -p tcp --dport %d -j DROP", + "iptables -D INPUT -p tcp --dport %d -j DROP", TESTPORT); system(test_script); |