Commit Graph

319 Commits

Author SHA1 Message Date
Jeremy Lakeman
c04d015bc6 Don't continuously toggle fd blocking mode 2016-03-30 16:25:43 +10:30
Jeremy Lakeman
cf8932d5ba Use trigger for interface up/down 2016-03-08 10:16:20 +10:30
Jeremy Lakeman
b8f10fd40d Delay interface re-detection after errors to rate limit continuous failures 2016-02-10 10:23:27 +10:30
Jeremy Lakeman
389f16d2bb Establish a unicast link to a configured host on demand 2016-01-27 16:27:47 +10:30
Jeremy Lakeman
d0da910b19 Avoid undefined behaviour as highlighted by clang 2016-01-27 16:27:47 +10:30
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
Jeremy Lakeman
88020a840d Add size cast to avoid compilation warning for some linux compilers 2016-01-11 14:52:29 +10:30
Jeremy Lakeman
912806360c Tweak netlink setup code in an attempt to prevent gcc mis-optimization 2016-01-11 14:40:23 +10:30
Jeremy Lakeman
fd38ddb892 Attempt to recover from transient network errors 2015-11-23 09:48:51 +10:30
Jeremy Lakeman
a075a8edbc Retry socket binding when interfaces come up 2015-11-16 12:54:59 +10:30
Andrew Bettison
a060642fdb Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
Andrew Bettison
3ab7e04497 Add buf_strncpy_nul(), use in place of strlcpy() 2015-11-02 10:11:41 +10:30
Jeremy Lakeman
0c275e67ef Clean up compilation warnings 2015-10-19 13:45:57 +10:30
Jeremy Lakeman
3049252c8a Poll netlink socket for interface changes on linux systems 2015-10-12 18:11:44 +10:30
Jeremy Lakeman
79e8a94792 Add route_link.h 2015-09-28 11:58:48 +09:30
Andrew Bettison
7d9a5faa4e Move if(config.debug.xxx) tests into DEBUGF()
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)
2015-07-13 16:00:05 +09:30
Jeremy Lakeman
fea91f3f82 Use configured reachable timeout for network links, read dummy files even when not ticking 2015-03-30 17:38:40 +10:30
Jeremy Lakeman
b048e8874f Reschedule alarm when tick_ms config changed 2015-03-23 13:35:22 +10:30
Jeremy Lakeman
f7dbe06836 Rearrange interface config to support unicast settings 2015-03-23 13:35:22 +10:30
Jeremy Lakeman
a9b9f51a9f Add support for mdp clients to provide a link layer packet transport 2015-03-02 15:44:34 +10:30
Andrew Bettison
7248d660e3 Fix non-deterministic assertion failure under load 2014-11-12 23:09:00 +10:30
gardners
6dca9fe6bf ensure netmask is set when initialising an interface. 2014-10-31 15:01:22 +10:30
gardners
6536953703 add debug output to diagnose interface selection based on
received address of packet.
2014-10-31 12:26:58 +10:30
Jeremy Lakeman
a37db8e958 Move most console commands to other files 2014-08-25 16:03:30 +09:30
Jeremy Lakeman
537a09812c Ignore some types of sendto errors 2014-06-27 12:45:53 +09:30
Jeremy Lakeman
f4e6841ed7 Ensure directory service tests aren't creating a global routing table 2014-06-16 17:22:46 +09:30
Jeremy Lakeman
dabd482ad8 Only send broadcast ticks every 5 seconds when we have no neighbours 2014-06-13 15:34:47 +09:30
Jeremy Lakeman
628a52ca87 Add monitor message for interface up/down events 2014-06-13 13:34:10 +09:30
Jeremy Lakeman
e5e848e838 Ensure interface and routing alarms stop when network interfaces are all down 2014-06-12 16:04:15 +09:30
Jeremy Lakeman
f93fba11af Stop polling interfaces if no phsical interfaces are enabled 2014-06-04 17:13:08 +09:30
Jeremy Lakeman
b6de3fcd34 Only send rhizome sync packets when we have neighbours 2014-05-30 15:03:22 +09:30
Jeremy Lakeman
7420f46653 Create new AF_UNIX based network simulator 2014-05-23 10:47:22 +09:30
Andrew Bettison
6371203703 Finish removing SLIP code and test case
More simplification of "serval.h"
2014-04-07 16:22:31 +09:30
Andrew Bettison
1f49ee47ae Add missing copyright messages 2014-04-07 14:39:21 +09:30
Andrew Bettison
53c1b1c04c Filesystem Heirarchy Standard (FHS) paths
If no instance directory specified, then use paths like
/etc/serval/serval.conf
/var/cache/serval
/var/log/serval
/var/run/serval
etc. for files, instead of all in a single directory.

Log all directory creation as INFO messages.

Interpretation of log.file.directory_path has changed slightly.

Updated servald configuration tech doc.
2014-03-26 15:35:43 +10:30
Jeremy Lakeman
2e4835d7d6 Ensure tests with packet filtering are using the dummy network interface 2014-03-12 14:32:59 +10:30
Jeremy Lakeman
7081e7044f Ensure AF_UNIX DGRAM sockets don't block during tests 2014-03-03 14:06:31 -08:00
Jeremy Lakeman
880117f6db Reduce peak bandwidth usage (though we really need a dynamic limit) 2014-03-01 05:28:54 +10:30
Jeremy Lakeman
b8971e51f4 Refactor socket helper functions to take socket_address struct 2014-02-20 14:44:38 +10:30
Jeremy Lakeman
04955f1ddd Fix interface name comparison for detecting real interfaces 2014-01-20 16:01:29 +10:30
Jeremy Lakeman
4bb3336b33 Generalise method for defining multiple interfaces 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
60a2aaa547 Ensure only interfaces that are UP are closed 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
506518ad06 Allow interfaces to use local unix addresses
- broadcast packets are sent to all sockets in the same folder
- switched most tests to use local sockets
2014-01-09 15:01: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
ebc3133f5c Change overlay_buffer fields from int to size_t
Fixes many -Wsign-compare warnings
2013-12-10 17:03:30 +10:30
Andrew Bettison
5d741361ea Fix -Wsign-compare warnings: make loop counters unsigned 2013-12-10 16:21:23 +10:30
Andrew Bettison
f79e6f703a Fix WHYF_perror() format string error 2013-12-10 10:38:03 +10:30
Andrew Bettison
30b2059608 Fix -Wunused-parameter warnings
New UNUSED(param) macro suppresses the warning for a specific parameter

In some cases, removed the unused parameters.  In others, used the
parameter in a DEBUGF() or assert() statement to document the intent.
2013-12-09 18:22:18 +10:30
Andrew Bettison
8db5f9c14a Merge branch 'anyservice' into 'development'
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
2013-12-01 05:44:01 +10:30
Andrew Bettison
72482b3427 Better error logging for recvwithttl() 2013-12-01 05:13:33 +10:30