Was failing because recvmsg(2) on OSX does not nul terminate the
pathname of local (AF_UNIX) sockets in the returned sockaddr buffer.
Zerofilling the buffer before calling recvmsg() does the trick.
In the process, improved debug and error logging, replacing
recvwithttl() with recv_message() and recv_message_frag(). The
mdp_net.c source file was retired.
Original DEBUG() and DEBUGF() macros renamed to _DEBUG() and _DEBUGF()
New DEBUG() and DEBUGF() macros, first argument is flagname
New DEBUGF2(foo, bar, ...) macro does if(config.debug.foo||config.debug.bar) test
Replace almost all config.debug.xxx references to IF_DEBUG(xxx)
Make .o files in separate subdirectories for servald and library
Factor struct __sourceloc and __WHENCE__ from "log.h" into "whence.h"
Factor sid_t etc from "serval.h" into "serval_types.h"
Factor rhizome_bid_t etc from "rhizome.h" into "rhizome_types.h"
Do not include "serval.h" in library sources
Add log_stderr.c and logMessage.c for stand-alone executables
Make all V2 MDP interface calls take a __whence argument
mdp_recv() always sets error before returning -1, does not set
errno=0 otherwise
mdp_recv() does not log errors on EINTR or EAGAIN (EWOULDBLOCK)
mdp_recv() sets errno=EOVERFLOW if local socket name is too long
mdp_recv() sets errno=EBADMSG if malformed or spurious packet
received
Remove redundant mdp_recv() error logging from "mdp ping" and
"config sync" and several "id" commands
Packet stats now exclude duplicate pong replies
With <count> arg, exits immediately once a pong has been received for
every ping, unless new --wait-for-duplicates option given
Routing tests for unreliable links now assert all pongs received and
very few duplicates
Allows any valid "service" manifest field in the "rhizome add file"
command
Many improvements in Rhizome manifest parsing; stricter manifest syntax
rules (no comment or blank lines, field names must be alphanumeric
identifiers), faster preliminary manifest inspection when receiving
manifest advertisements or syncing manifests
The 'development' branch introduces "struct socket_address" which
coincidentally fixed the recently encountered Linux kernel 3.12
recvmsg(2) EINVAL problem, so that 'rhizomeprotocol' tests which fail on
the 'anyservice' branch will pass after this merge
Add struct sockaddr_in 'inet' union field, rename 'addr_un' union field
to 'local'
Replace recvwithttl()'s (struct sockaddr *) and socklen_t pair of args
with single (struct socket_address *) arg
Remove stowSid() at last
Change API of tohex() and strbuf_tohex(), to pass string length instead of
binary byte count. This allows odd numbers of hex digits to be produced.
Remove alloca_tohex_sid(); replace with alloca_tohex_sid_t()
New alloca_tohex_sid_t_trunc() macro
The recently added cmp_sockaddr() function does not call stat(2) any
more to compare local AF_UNIX socket address paths, so not it is stable
enough to use for ordering sockaddr structs.
New function: real_sockaddr() converts the file path of a local AF_UNIX
file socket using realpath(3). The MDP client uses it on the sender
address of every MDP reply packet it receives to ensure that symlinks in
the instance path do not cause MDP client failures.
Rename recently added socket_setname() function: make_local_sockaddr().
Finish the work started by Daniel in 2012, by using abstract local
AF_UNIX sockets on platforms that support them (Linux, Android).
Fix all sorts of bugs and issues that prevented the existing MDP and
Monitor client and server code from working with abstract socket names.