problem with default local port(nl_pid) when netlink used both via libnl and directly in same application

Thomas Graf tgraf at infradead.org
Mon May 7 12:16:29 EDT 2012


On Mon, May 07, 2012 at 11:47:53AM -0400, Laine Stump wrote:
> I did notice during my investigation the nl_connect() will automatically
> set SOCK_CLOEXEC in the call to socket(2) (if it's defined on the
> platform), so this will be taken care of for you. (hopefully nobody will
> ever need a libnl-created socket to be maintained across a fork)
> 
> I'm not sure what platforms, if any, don't have SOCK_CLOEXEC, but
> fortunately all the platforms I'm concerned about do :-)

I found the SOCK_CLOEXEC to be the wiser choice by default. Naturally
any application is free to change this. I'll add some explicit
documentation about this.



More information about the libnl mailing list