selftest: txtimestamp: fix net ns entry logic

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 <paolo.pisati@canonical.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Paolo Pisati 2020-07-21 18:17:10 +02:00 committed by David S. Miller
parent 785ed9c32a
commit b346c0c858

View File

@ -75,7 +75,7 @@ main() {
fi
}
if [[ "$(ip netns identify)" == "root" ]]; then
if [[ -z "$(ip netns identify)" ]]; then
./in_netns.sh $0 $@
else
main $@