For typed hash tables, enforce the correct type in the arguments to the
hashing and equality functions.
Adapt existing affected callback functions and change their arguments
from void* to the respective types.
Add reverse casts to GHashFunc and GEqualFunc in instances where these
functions are used in non-typed hash tables (that should be converted at
a later point).
Add convenience macro to create typed wrapper functions for hash tables
that use "direct" hashing (i.e. the pointer value).
Add wrappers for existing GLib functions that have generic arguments so
that they can be used in typed hash tables.
Change-Id: I43bb32969208f4aae49584d95c0df8353df6e2a0
Use the kernel/user shared memory to keep track of interface stats. This
eliminates the need to update the userspace stats counters with the
values from the kernel, and vice versa when updating the kernel streams.
Add a function to reverse map userspace mapped memory address to kernel
space addresses.
Change-Id: Iaa5f9488061a12103e57faf27b3979521778cea8
To support asynchronous pollers which may hold references on underlying
sockets, let the poller close the socket after it has released its
references. This prevents cases of file descriptor re-use while an
underlying socket is still open.
Add reset_socket() to be used in place of close_socket() which does the
same thing except the actual closing of the socket.
Add poller_del_item_callback() for cases where more action than just
closing the file descriptor is needed.
Change-Id: Iefda1487ecb89263729120ecb964436dd79b2a0e
Try open an IPv4 socket if IPv6 fails with EAFNOSUPPORT in order to
support kernels without IPv6 support.
closes#1784
Change-Id: I2cf4065450a8b19b738c572e7d9ad6f8548ecc04
Similar to recvfrom_ts, this return the local (destination) address of
the received packet, extracted from the PKTINFO struct.
Change-Id: Icfed12eb7d9bf6c9d707318e85363fcff8d9aca6
Make sure we don't try to send on closed sockets or to endpoints which
haven't been initialised.
Fixes unexpected fallout from 83c7336e
Change-Id: If73d61e52edeb72257515adab7428ecef82c2797
Use the address family of the address object to do the conversion, not
the family of the socket. This allows for v4-in-v6 socket usage.
Change-Id: I4d23b7036207e71f5e70706d621d8ec2b7ca0934
When ports are closed early (while the call is still running), we must
first update a slave rtpengine with this new information (that these
ports are now closed) before actually releasing the ports ourselves. Not
doing so leads to a race condition where the master instance re-uses a
port that was just closed before the slave instance knows about the port
being closed.
We implement this using a thread-local list to keep track of ports that
were released while processing a control message, and process this list
to actually close the ports only after Redis has been updated.
Additional calls to the function to close the ports are placed in
strategic locations to make sure this is triggered in every code path.
closes#1495
Change-Id: I803f4594f30ca315da0b84c6e76893f54ca3a7c9
Handling of dual stack v4/v6 was previously done by the individual
listener objects for INADDR_ANY listening addresses. If listening on
INADDR_ANY was requested, then each listener would create two instances,
one for IPv4 and one for IPv6. This works fine for INADDR_ANY but fails
for listening on host names that resolve to multiple addresses, such as
`localhost`.
Solve this by relieving the listener objects from handling this and
instead handle it in the code setting up the listeners. If a host name
resolves to multiple addresses, then set up multiple listeners (up to
two supported currently). This allows us to listen on `localhost` by
default and have both 127.0.0.1 and ::1 active. INADDR_ANY is handled
specially by also setting up :: in that case.
Change-Id: I2a1e1d7090d7d23863c7a9bb1e89b85ad2ea44f4