Attention is currently required from: laforge, osmith.
pespin uploaded patch set #3 to this change.
The following approvals got outdated and were removed: Code-Review+1 by laforge, Code-Review+1 by osmith, Verified+1 by Jenkins Builder
socket: Reimplement osmo_sock_init2_multiaddr()
This is an attempt to fix several downsides of current
osmo_sock_init2_multiaddr() API, mainly the requirement to pass an explicit
local address (!NULL). It also now works fine if OSMO_SOCK_F_BIND flag
is not used.
This reimplementation is based on the follwing logic:
- If caller passed family=AF_INET or family=AF_INET6, that same family
is used and kernel will fail if something is wrong.
- If caller passes family=AF_UNSPEC, the function will try to find the
required family to create the socket. The decision is taken on the
assumption that an AF_INET6 socket can handle both AF_INET6 and AF_INET
addresses (through v4v6 mapping). Hence, if any of the addresses in the
local or remote set of addresses resolves through getaddrinfo() to an
IPv6 address, then AF_INET6 is used; AF_INET is used otherwise.
Related: OS#6279
Change-Id: I2641fbaca6f477404b094dbc53c0c1a3dd3fd2fd
---
M src/core/socket.c
1 file changed, 128 insertions(+), 44 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/35232/3
To view, visit change 35232. To unsubscribe, or for help writing mail filters, visit settings.