Subject: Re: [PATCH net-next 01/38] selftests/net: add lib.sh

From: Petr Machata <[email-masked]>
Date: Fri, 24 Nov 2023 16:25:33 +0100

Petr Machata <[email-masked]> writes:

> Hangbin Liu <[email-masked]> writes:
>
>> +# By default, remove all netns before EXIT.
>> +cleanup_all_ns()
>> +{
>> +	cleanup_ns $NS_LIST
>> +}
>> +trap cleanup_all_ns EXIT
>
> Hmm, OK, this is a showstopper for inclusion from forwarding/lib.sh,
> because basically all users of forwarding/lib.sh use the EXIT trap.
[...]
> So just ignore the bit about including from forwarding/lib.sh.

Actually I take this back. The cleanup should be invoked from where the
init was called. I don't think the library should be auto-invoking it,
the client scripts should. Whether through a trap or otherwise.