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 коммит произвёл David S. Miller
Родитель 785ed9c32a
Коммит b346c0c858
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

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