[PATCH rtems-libbsd v2] ipsec-tools/pfkey: Fix socket leak

Christian MAUDERER christian.mauderer at embedded-brains.de
Tue May 11 06:49:43 UTC 2021


Thanks. I pushed them (with separate tickets for 5 and 6).

Am 10.05.21 um 22:52 schrieb Gedare Bloom:
> looks good, thanks. for the backport please open a separate ticket to 5.
> 
> On Mon, May 10, 2021 at 11:26 AM Christian MAUDERER
> <christian.mauderer at embedded-brains.de> wrote:
>>
>> Only change is a better description.
>>
>> Am 10.05.21 um 08:50 schrieb Christian Mauderer:
>>> setkey uses pfkey_open to open a socket. But setkey doesn't close the
>>> socket.
>>>
>>> The libipsec functions are used only by user space applications (setkey
>>> and racoon). Adding the wrapper for socket makes sure that the opened
>>> socket is registered and closes if the application exits.
>>>
>>> Fixes #4404
>>> ---
>>>    ipsec-tools/src/libipsec/pfkey.c | 7 +++++++
>>>    1 file changed, 7 insertions(+)
>>>
>>> diff --git a/ipsec-tools/src/libipsec/pfkey.c b/ipsec-tools/src/libipsec/pfkey.c
>>> index a621be12..385a21a9 100644
>>> --- a/ipsec-tools/src/libipsec/pfkey.c
>>> +++ b/ipsec-tools/src/libipsec/pfkey.c
>>> @@ -1,5 +1,12 @@
>>>    #include <machine/rtems-bsd-user-space.h>
>>>
>>> +#ifdef __rtems__
>>> +/* Only need socket from rtems-bsd-program wrappers! */
>>> +int
>>> +rtems_bsd_program_socket(int domain, int type, int protocol);
>>> +#define socket(domain, type, protocol) \
>>> +    rtems_bsd_program_socket(domain, type, protocol)
>>> +#endif /* __rtems__ */
>>>    /*  $NetBSD: pfkey.c,v 1.21.2.1 2011/11/14 13:25:06 tteras Exp $    */
>>>
>>>    /*  $KAME: pfkey.c,v 1.47 2003/10/02 19:52:12 itojun Exp $  */
>>>
>>
>> --
>> --------------------------------------------
>> embedded brains GmbH
>> Herr Christian MAUDERER
>> Dornierstr. 4
>> 82178 Puchheim
>> Germany
>> email: christian.mauderer at embedded-brains.de
>> phone: +49-89-18 94 741 - 18
>> fax:   +49-89-18 94 741 - 08
>>
>> Registergericht: Amtsgericht München
>> Registernummer: HRB 157899
>> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
>> Unsere Datenschutzerklärung finden Sie hier:
>> https://embedded-brains.de/datenschutzerklaerung/
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
phone: +49-89-18 94 741 - 18
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list