Skip to content

Commit

Permalink
selftest: txtimestamp: fix net ns entry logic
Browse files Browse the repository at this point in the history
According to 'man 8 ip-netns', if `ip netns identify` returns an empty string,
there's no net namespace associated with current PID: fix the net ns entrance
logic.

Signed-off-by: Paolo Pisati <[email protected]>
Acked-by: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
piso77 authored and davem330 committed Jul 21, 2020
1 parent 785ed9c commit b346c0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/txtimestamp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ main() {
fi
}

if [[ "$(ip netns identify)" == "root" ]]; then
if [[ -z "$(ip netns identify)" ]]; then
./in_netns.sh $0 $@
else
main $@
Expand Down

0 comments on commit b346c0c

Please sign in to comment.