lib/socket: don't fail if no more local ports can be assigned in nl_socket_alloc
lib/socket: don't fail if no more local ports can be assigned in nl_socket_alloc

By failing inside of nl_socket_alloc(), the user can not even work around
when running out of local ports. This patch changes that if there are no more
local ports, we set the port to UINT32_MAX. This is a consistent behavior
to calling nl_socket_set_local_port(sk, 0).

In general, since nl_socket_set_local_port() does not restict the generated
ports in any way we cannot assume to have a valid port. So the check in
the constructor was harmful and users who ever encountered it (because they
created 1024 libnl3 sockets) could not even work around it.

Acked-by: Thomas Graf <17c2d8920621522552b392f72d8fdb4d1e866b44@suug.ch>
Signed-off-by: Thomas Haller <16e26612e4159990a6b3691e92592e691ff74132@redhat.com>

baloo/libnl,kolyshkin/libnl,UnicronNL/libnl3,cfriedt/libnl,tgraf/libnl,houstar/libnl,honsys/libnl,cyclops8456/libnl3,tgraf/libnl,tgraf/libnl,mshirley/libnl,claudelee/libnl,vyos/libnl3,congwang/libnl,HolyShitMan/libnl-1,dsahern/libnl,honsys/libnl,congwang/libnl,houstar/libnl,kolyshkin/libnl,mshirley/libnl,congwang/libnl,baloo/libnl,UnicronNL/libnl3,baloo/libnl,HolyShitMan/libnl-1,cyclops8456/libnl3,cfriedt/libnl,greearb/libnl-ct,houstar/libnl,claudelee/libnl,kolyshkin/libnl,cfriedt/libnl,greearb/libnl-ct,vyos/libnl3,honsys/libnl,baloo/libnl,tklauser/libnl,thom311/libnl,dsahern/libnl,cyclops8456/libnl3,vyos/libnl3,mshirley/libnl,thom311/libnl,vyos/libnl3,tgraf/libnl,houstar/libnl,UnicronNL/libnl3,dsahern/libnl,claudelee/libnl,mshirley/libnl,dsahern/libnl,honsys/libnl,UnicronNL/libnl3,thom311/libnl,HolyShitMan/libnl-1,HolyShitMan/libnl-1,claudelee/libnl,tklauser/libnl,tklauser/libnl,greearb/libnl-ct,cyclops8456/libnl3,kolyshkin/libnl,tklauser/libnl,congwang/libnl,cfriedt/libnl