Commit Graph

14 Commits

Author SHA1 Message Date
Andrew Bettison
c3375d0501 Fix MDP client packet receive bug on OSX
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.
2016-01-19 04:05:46 +10:30
Andrew Bettison
e8e87b8a34 Fix broken clang and Android builds
Recent addition of the GCC __attribute__(alloc_size) to some functions
in mem.h broke the build when using Clang 3.5.  This commit introduces
configure-time checks for all GCC attributes used in the Serval source
code, and adapts accordingly.
2015-11-23 15:00:25 +10:30
Andrew Bettison
0a061e0fe8 Include "whence.h" instead of "log.h" where suitable
Some inclusions of "log.h" were simply to get struct __sourceloc and
__WHENCE__
2015-07-13 18:24:16 +09:30
Jeremy Lakeman
a9b9f51a9f Add support for mdp clients to provide a link layer packet transport 2015-03-02 15:44:34 +10:30
Jeremy Lakeman
b8971e51f4 Refactor socket helper functions to take socket_address struct 2014-02-20 14:44:38 +10:30
Jeremy Lakeman
5f2c6e364a Refactor interface addresses to use new socket_address struct 2014-01-09 15:01:38 +10:30
Andrew Bettison
5226e47ef6 Uniform #ifdef __SERVAL_DNA__... for headers 2013-12-04 17:15:36 +10:30
Andrew Bettison
9b64bb87e0 Uniform copyright notices
Added some missing copyright/license block comments
2013-12-04 17:15:36 +10:30
Andrew Bettison
42ab9aec4c Merge branch 'development' into 'naf4'
Remove two redundant calls to rhizome_retrieve_manifest() in meshms.c,
revealed by an assert() in the stricter manifest parsing code

Fix header files included by socket.h
2013-12-02 17:17:47 +10:30
Andrew Bettison
dafa1fc186 Improve struct socket_address
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
2013-11-29 12:56:59 +10:30
Jeremy Lakeman
0d5d878521 Refactor socket name and address length handling 2013-11-27 13:08:37 +10:30
Andrew Bettison
2b3119b49b Issue #20: merge branch 'sockets' into 'development'
Daniel's improvements to the local file/abstract socket code, with many
improvements to bring it up to date.
2013-09-19 04:30:14 +09:30
Daniel O'Connor
fd1f91db8d Refactor unix domain socket naming to a separate file instead.
Handle selection between normal & abstract sockets in a single place.

overlay_mdp.c tried to have both but this seems like a bug so I've removed the second socket (needs tests).
2012-07-30 11:19:25 +09:30
Daniel O'Connor
9cf4d5529a Refactor out socket name setting code into one place.
This consistently handles abstract vs normal sockets with a single switch.

overlay mdp tries to have both (abstract & normal) but the code paths seem different, I have consolidated them.

Needs more testing.
2012-07-29 22:20:54 +09:30