Skip to content

Commit b346c0c

Browse files
piso77davem330
authored andcommitted
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>
1 parent 785ed9c commit b346c0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/testing/selftests/net/txtimestamp.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ main() {
7575
fi
7676
}
7777

78-
if [[ "$(ip netns identify)" == "root" ]]; then
78+
if [[ -z "$(ip netns identify)" ]]; then
7979
./in_netns.sh $0 $@
8080
else
8181
main $@

0 commit comments

Comments
 (0)