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 <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 785ed9c commit b346c0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)