lkml.org 
[lkml]   [2020]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.7 14/25] selftest: txtimestamp: fix net ns entry logic
    Date
    From: Paolo Pisati <paolo.pisati@canonical.com>

    [ Upstream commit b346c0c85892cb8c53e8715734f71ba5bbec3387 ]

    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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    tools/testing/selftests/net/txtimestamp.sh | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/testing/selftests/net/txtimestamp.sh b/tools/testing/selftests/net/txtimestamp.sh
    index eea6f5193693f..31637769f59f6 100755
    --- a/tools/testing/selftests/net/txtimestamp.sh
    +++ b/tools/testing/selftests/net/txtimestamp.sh
    @@ -75,7 +75,7 @@ main() {
    fi
    }

    -if [[ "$(ip netns identify)" == "root" ]]; then
    +if [[ -z "$(ip netns identify)" ]]; then
    ./in_netns.sh $0 $@
    else
    main $@
    --
    2.25.1
    \
     
     \ /
      Last update: 2020-07-28 01:29    [W:4.549 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site