olsrd.git
2 years agoAdd a missing include for olsr_random() on BSD. 28/head
Stefan Sperling [Mon, 12 Jun 2017 18:58:22 +0000 (20:58 +0200)]
Add a missing include for olsr_random() on BSD.

Signed-off-by: Stefan Sperling <stsp@stsp.name>
2 years agopud: only check gpsd status; no clear of info on bad fix or invalid signal
Ferry Huberts [Mon, 29 May 2017 09:41:26 +0000 (11:41 +0200)]
pud: only check gpsd status; no clear of info on bad fix or invalid signal

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: gradle: upgrade wrapper
Ferry Huberts [Mon, 29 May 2017 09:42:57 +0000 (11:42 +0200)]
info: java: gradle: upgrade wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.5

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: gradle: upgrade wrapper
Ferry Huberts [Mon, 6 Mar 2017 21:59:30 +0000 (22:59 +0100)]
info: java: gradle: upgrade wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.4.1

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: update jackson bundles
Ferry Huberts [Thu, 23 Feb 2017 17:58:43 +0000 (18:58 +0100)]
info: java: update jackson bundles

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: update workspace
Ferry Huberts [Thu, 23 Feb 2017 17:58:15 +0000 (18:58 +0100)]
info: java: update workspace

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: gradle: upgrade wrapper
Ferry Huberts [Mon, 20 Feb 2017 21:53:21 +0000 (22:53 +0100)]
info: java: gradle: upgrade wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.4

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge branch 'release-0.9.6'
Ferry Huberts [Fri, 10 Feb 2017 10:35:24 +0000 (11:35 +0100)]
Merge branch 'release-0.9.6'

* release-0.9.6:
  Update version after release of v0.9.6.1
  Release v0.9.6.1

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoUpdate version after release of v0.9.6.1
Henning Rogge [Fri, 10 Feb 2017 10:20:16 +0000 (11:20 +0100)]
Update version after release of v0.9.6.1

Signed-off-by: Henning Rogge <hrogge@gmail.com>
2 years agoRelease v0.9.6.1 v0.9.6.1
Henning Rogge [Fri, 10 Feb 2017 10:20:11 +0000 (11:20 +0100)]
Release v0.9.6.1

Signed-off-by: Henning Rogge <hrogge@gmail.com>
2 years agoMerge branch 'release-0.9.6'
Ferry Huberts [Wed, 8 Feb 2017 11:40:44 +0000 (12:40 +0100)]
Merge branch 'release-0.9.6'

* release-0.9.6:
  hello reception: only remove UNSPEC duplicates
  hello reception: remove duplicate neighbors
  lq_packet: do not report duplicate neighbours in HELLO messages
  hello reception: use link status ordering
  lq_packet: make the hello link order a define
  info: automatically detect whether the reply should have HTTP headers
  info: java: upgrade gradle wrapper

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agohello reception: only remove UNSPEC duplicates
Ferry Huberts [Fri, 3 Feb 2017 13:45:09 +0000 (14:45 +0100)]
hello reception: only remove UNSPEC duplicates

Only UNSPEC links can be duplicates, so only try to remove those.
This is quite a bit faster at the cost of some complexity.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agohello reception: remove duplicate neighbors
Iwan G. Flameling [Fri, 3 Feb 2017 13:33:55 +0000 (14:33 +0100)]
hello reception: remove duplicate neighbors

See the explanations in the descriptions of commits 2f38613 and
5089a79.

To fix the issue more thoroughly we need to ensure that no duplicate
neighbours are sent or received because that confuses the receiver.
This is especially true when the HELLO messages are fragmented, and
even more so when the fragments have some delay between them since
that causes link instability.

This commit fixes that for the receiving side.

Signed-off-by: Iwan G. Flameling <iwanovich@gmail.com>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agolq_packet: do not report duplicate neighbours in HELLO messages
Iwan G. Flameling [Fri, 3 Feb 2017 13:17:51 +0000 (14:17 +0100)]
lq_packet: do not report duplicate neighbours in HELLO messages

See the explanations in the descriptions of commits 2f38613 and
5089a79.

To fix the issue more thoroughly we need to ensure that no duplicate
neighbours are sent or received because that confuses the receiver.
This is especially true when the HELLO messages are fragmented, and
even more so when the fragments have some delay between them since
that causes link instability.

This commit fixes that for the sending side.

Signed-off-by: Iwan G. Flameling <iwanovich@gmail.com>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agohello reception: use link status ordering
Ferry Huberts [Mon, 30 Jan 2017 16:53:19 +0000 (17:53 +0100)]
hello reception: use link status ordering

See the explanation in the description of commit 2f38613.
This commit fixes the receive side of the described problem.

From this commit on 'broken' senders and 'fixed' receivers can
interoperate correctly.

The only case left unfixed is 'broken' senders and 'broken' receivers
(which is obviously unfixable), all other combinations are fixed.

'broken' = v0.6.6.1-136-g3d2fd73 <= olsrd < v0.9.5-82-g2f38613
'fixed'  = olsrd <  v0.6.6.1-136-g3d2fd73
           OR
           olsrd >= v0.9.5-82-g2f38613 (senders  )
           olsrd >= this commit        (receivers)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agolq_packet: make the hello link order a define
Ferry Huberts [Mon, 30 Jan 2017 16:24:07 +0000 (17:24 +0100)]
lq_packet: make the hello link order a define

This will be re-used later

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: automatically detect whether the reply should have HTTP headers
Ferry Huberts [Tue, 7 Feb 2017 12:28:06 +0000 (13:28 +0100)]
info: automatically detect whether the reply should have HTTP headers

This is the case when a HTTP request is done.
The request can still override whether or not HTTP headers are sent
by employing the 'http' and 'plain' request prefixes.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: automatically detect whether the reply should have HTTP headers
Ferry Huberts [Tue, 7 Feb 2017 12:28:06 +0000 (13:28 +0100)]
info: automatically detect whether the reply should have HTTP headers

This is the case when a HTTP request is done.
The request can still override whether or not HTTP headers are sent
by employing the 'http' and 'plain' request prefixes.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: upgrade gradle wrapper
Ferry Huberts [Mon, 6 Feb 2017 15:55:17 +0000 (16:55 +0100)]
info: java: upgrade gradle wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.3

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: upgrade gradle wrapper
Ferry Huberts [Mon, 6 Feb 2017 15:55:17 +0000 (16:55 +0100)]
info: java: upgrade gradle wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.3

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge branch 'release-0.9.6'
Ferry Huberts [Wed, 25 Jan 2017 06:45:02 +0000 (07:45 +0100)]
Merge branch 'release-0.9.6'

* release-0.9.6:
  changelog: fixup
  Update version after release of v0.9.6
  Release v0.9.6
  release: insert changelog just before the marker of the previous release
  release: minor improvements to the release script
  changelog: minor layout fixes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agochangelog: fixup
Ferry Huberts [Wed, 25 Jan 2017 06:41:08 +0000 (07:41 +0100)]
changelog: fixup

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoUpdate version after release of v0.9.6
Henning Rogge [Tue, 24 Jan 2017 19:50:48 +0000 (20:50 +0100)]
Update version after release of v0.9.6

Signed-off-by: Henning Rogge <hrogge@gmail.com>
2 years agoRelease v0.9.6 v0.9.6
Henning Rogge [Tue, 24 Jan 2017 19:50:32 +0000 (20:50 +0100)]
Release v0.9.6

Signed-off-by: Henning Rogge <hrogge@gmail.com>
2 years agorelease: insert changelog just before the marker of the previous release
Ferry Huberts [Fri, 20 Jan 2017 16:20:23 +0000 (17:20 +0100)]
release: insert changelog just before the marker of the previous release

So that the notes that are added manually stay on top.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agorelease: minor improvements to the release script
Ferry Huberts [Fri, 20 Jan 2017 15:28:28 +0000 (16:28 +0100)]
release: minor improvements to the release script

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agochangelog: minor layout fixes
Ferry Huberts [Fri, 20 Jan 2017 15:30:57 +0000 (16:30 +0100)]
changelog: minor layout fixes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoUpdate version after branch of v0.9.6
Ferry Huberts [Fri, 20 Jan 2017 12:34:45 +0000 (13:34 +0100)]
Update version after branch of v0.9.6

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoBranch v0.9.6
Ferry Huberts [Fri, 20 Jan 2017 12:34:45 +0000 (13:34 +0100)]
Branch v0.9.6

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agolq_packet: change link status ordering in hello messages
Ferry Huberts [Fri, 20 Jan 2017 12:15:56 +0000 (13:15 +0100)]
lq_packet: change link status ordering in hello messages

A while ago we noticed that neighbours of nodes with multiple interfaces
on the same medium report infinite costs on their links to those nodes.

This problem is 100% reproducible, and was traced down to
commit 3d2fd73a5528a9c7cdccd088f2dcca80b37e66b9
Author: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Date:   Mon Mar 31 11:18:30 2014 +0200

    Fix processing error for fragmented hellos

Below is the setup in which we noticed the problem.

       wlan0                                                 wlan0
       172.31.175.97/16                           172.31.175.61/16
    (((*))) ------------------------------------------------- (((*)))
       |                                                         |
       |                                                         |
       |                                                         |
   ____|___   172.29.175.97/15   ________  172.29.175.61/15  ____|____
  |         |-eth1.2580---------|        |--------eth1.2580-|         |
  | Node 97 |                   | Switch |                  | Node 61 |
  |_________|-eth2.2580---------|________|                  |_________|
              172.28.175.97/15

In this setup node 97 will report normal link costs for its (wired) links
to node 61 (see the first table below), while node 61 will report infinite
link costs for both its (wired) links to node 97 (see the second table
below).

  Table: Links (node 97)
  Local IP       Remote IP       Hyst.   LQ      NLQ     Cost
  172.29.175.97  172.29.175.61   0.000   1.000   1.000   0.100
  172.28.175.97  172.29.175.61   0.000   1.000   1.000   0.100
  172.31.175.97  172.31.175.61   0.000   1.000   1.000   1.000

  Table: Links (node 61)
  Local IP       Remote IP       Hyst.   LQ      NLQ     Cost
  172.29.175.61  172.29.175.97   0.000   1.000   0.000   INFINITE
  172.29.175.61  172.28.175.97   0.000   1.000   0.000   INFINITE
  172.31.175.61  172.31.175.97   0.000   1.000   1.000   1.000

Checking the HELLO messages that are received on node 61 from node 97,
we see the following:

  [node 61] # tcpdump -vni eth1.2580 udp port 698
  tcpdump: listening on eth1.2580, link-type EN10MB (Ethernet), capture size 262144 bytes
  06:21:23.528204 IP (tos 0xc0, ttl 1, id 42455, offset 0, flags [DF], proto UDP (17), length 80)
      172.28.175.97.698 > 255.255.255.255.698: OLSRv4, seq 0xf7c0, length 52
     Hello-LQ Message (0xc9), originator 172.31.175.97, ttl 1, hop 0
       vtime 3.000s, msg-seq 0x533d, length 48
       hello-time 1.000s, MPR willingness 3
         link-type Symmetric, neighbor-type Symmetric, len 12
           neighbor 172.29.175.61, link-quality 0.00%, neighbor-link-quality 0.00%
         link-type Unspecified, neighbor-type Symmetric, len 20
           neighbor 172.31.175.61, link-quality 0.00%, neighbor-link-quality 0.00%
           neighbor 172.29.175.61, link-quality 0.00%, neighbor-link-quality 0.00%

Node 61 receives HELLO messages from node 97 that report (amongst others):
1- a  SYMMETRIC   link-type to node 61 (172.29.175.61)
2- an UNSPECIFIED link-type to node 61 (172.29.175.61)

Clearly, this is 'confusing' and the root cause of why node 61 reports
infinite costs for the links, as shown above.

On node 61 - the receiving side - an entry with link type SYMMETRIC is
processed, but then later overwritten with UNSPECIFIED from the duplicate
entry.

For now we fix this problem by letting the sending side order the link
type statuses differently. In a future follow-up patch we'll fix both
the sending and receiving sides more thoroughly.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
2 years agochangelog: add a remark about updated plugin versions
Ferry Huberts [Fri, 20 Jan 2017 12:33:31 +0000 (13:33 +0100)]
changelog: add a remark about updated plugin versions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agotxtinfo: bump version
Ferry Huberts [Mon, 16 Jan 2017 20:44:15 +0000 (21:44 +0100)]
txtinfo: bump version

Needed because of extensive rework, using the 'info' base code, which
added one or more parameters.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agonetjson: bump version
Ferry Huberts [Mon, 16 Jan 2017 20:47:29 +0000 (21:47 +0100)]
netjson: bump version

Needed because of extensive rework, using the 'info' base code, which
added one or more parameters.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agojsoninfo: bump version
Ferry Huberts [Mon, 16 Jan 2017 20:43:28 +0000 (21:43 +0100)]
jsoninfo: bump version

Needed because of extensive rework, using the 'info' base code, which
added one or more parameters.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agopud: bump version
Ferry Huberts [Mon, 16 Jan 2017 20:44:39 +0000 (21:44 +0100)]
pud: bump version

Needed because of extensive rework, using gpsd

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agonameservice: fix typos of filewrite-interval plugin parameter
Ferry Huberts [Mon, 16 Jan 2017 21:57:50 +0000 (22:57 +0100)]
nameservice: fix typos of filewrite-interval plugin parameter

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agonameservice: fix plugin versions
Ferry Huberts [Mon, 16 Jan 2017 21:55:01 +0000 (22:55 +0100)]
nameservice: fix plugin versions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge pull request #18 from SvenRoederer/olsr-nameservice-version
Ferry Huberts [Sat, 14 Jan 2017 13:23:15 +0000 (14:23 +0100)]
Merge pull request #18 from SvenRoederer/olsr-nameservice-version

nameservice: bump version to 0.4

2 years agonameservice: bump version to 0.4 18/head
Sven Roederer [Sat, 14 Jan 2017 03:46:52 +0000 (04:46 +0100)]
nameservice: bump version to 0.4

for the new parameter "filewrite-interval" we should bump the version, so init-scripts can give correct parameters.
Automatic generate config-files (like in OpenWrt from UCI-settings) have no knowledge if this parameter can be added to configfile when there is all the same version.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2 years agoMerge pull request #16 from SvenRoederer/rename_sighup-interval
Ferry Huberts [Fri, 13 Jan 2017 13:33:50 +0000 (14:33 +0100)]
Merge pull request #16 from SvenRoederer/rename_sighup-interval

nameservice: rename parameter "sighup_interval" to "filewrite_interval"

2 years agonameservice: rename parameter "sighup_interval" to "filewrite_interval" 16/head
Sven Roederer [Thu, 12 Jan 2017 20:11:05 +0000 (21:11 +0100)]
nameservice: rename parameter "sighup_interval" to "filewrite_interval"

Playing around with the new option "sighup_interval" I found, that this
also controls the interval of calling the "name-change-script".
Checking the code points out that this is the maintimer for writing
any status-file to disk. So it's more consistent to change the parameter-
name to what it's really doing.

Also update the README to reference this parameter in the others
affected by it.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2 years agologging: work around bogus Coverity warning
Ferry Huberts [Tue, 10 Jan 2017 19:32:12 +0000 (20:32 +0100)]
logging: work around bogus Coverity warning

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agocfgparser: use superfasthash for the configuration checksum
Ferry Huberts [Tue, 10 Jan 2017 14:36:45 +0000 (15:36 +0100)]
cfgparser: use superfasthash for the configuration checksum

Saves space, by request of LEDE/OpenWRT

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agocfgparser: pull in openssl sha256 code to avoid linking to it
Ferry Huberts [Tue, 10 Jan 2017 11:10:19 +0000 (12:10 +0100)]
cfgparser: pull in openssl sha256 code to avoid linking to it

Obsoletes/removes the NOCONFIGCHECKSUM build option

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agocfgparser: use correct SHA256_DIGEST_LENGTH
Ferry Huberts [Tue, 10 Jan 2017 09:48:43 +0000 (10:48 +0100)]
cfgparser: use correct SHA256_DIGEST_LENGTH

Not SHA_DIGEST_LENGTH, which is for SHA1 checksums

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge pull request #14 from bittorf/master
Ferry Huberts [Tue, 10 Jan 2017 11:01:24 +0000 (12:01 +0100)]
Merge pull request #14 from bittorf/master

logging: show interface name during blocked socket error

2 years agologging: show interface name during blocked socket error 14/head
Bastian Bittorf [Tue, 10 Jan 2017 08:46:59 +0000 (09:46 +0100)]
logging: show interface name during blocked socket error

message was:
OLSR: sendto IPv4 Operation not permitted

message now:
OLSR: sendto IPv4 'Operation not permitted' on interface wlan1

(added also for the IPv6 case)

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
2 years agoMerge pull request #12 from booo/sighup-interval
Ferry Huberts [Mon, 9 Jan 2017 19:45:34 +0000 (20:45 +0100)]
Merge pull request #12 from booo/sighup-interval

nameservice: add new sighup-interval parameter

2 years agonameservice: add new sighup-interval parameter 12/head
Philipp Borgers [Mon, 9 Jan 2017 17:05:56 +0000 (18:05 +0100)]
nameservice: add new sighup-interval parameter

We add the 'sighup-interval' parameter to control the time interval
between sighups to the file specified by 'sighup-pid-file'.

Signed-off-by: Philipp Borgers <borgers@mi.fu-berlin.de>
2 years agofiles: update configuration generation script
Ferry Huberts [Fri, 6 Jan 2017 11:59:04 +0000 (12:59 +0100)]
files: update configuration generation script

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agofiles: get rid of net-tools usage
Ferry Huberts [Fri, 6 Jan 2017 11:22:32 +0000 (12:22 +0100)]
files: get rid of net-tools usage

net-tools has been deprecated well over a decade now.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agomake: remove -Wmissing-include-dirs
Ferry Huberts [Wed, 4 Jan 2017 17:12:35 +0000 (18:12 +0100)]
make: remove -Wmissing-include-dirs

It's causing grief for LEDE/OpenWRT and doesn't seem that useful in the
first place.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agogui: clean-ups
Ferry Huberts [Wed, 4 Jan 2017 14:12:50 +0000 (15:12 +0100)]
gui: clean-ups

Especially the gui olsr_protocol.h file was REALLY out of sync.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agomake: strip CC
Thorsten Maerz [Sun, 18 Dec 2016 14:25:57 +0000 (15:25 +0100)]
make: strip CC

Windows can't handle CC with leading/trailing whitespace.
Fixes msys/mingw build on win32.

Signed-off-by: Thorsten Maerz <info@netztorte.de>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agodoc: move pdf generation into new doc-pdf make target
Ferry Huberts [Wed, 4 Jan 2017 12:13:26 +0000 (13:13 +0100)]
doc: move pdf generation into new doc-pdf make target

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agodoc: fix warnings
Ferry Huberts [Wed, 4 Jan 2017 12:04:54 +0000 (13:04 +0100)]
doc: fix warnings

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agodoc: minor adjustment of the makefile
Ferry Huberts [Wed, 4 Jan 2017 12:09:01 +0000 (13:09 +0100)]
doc: minor adjustment of the makefile

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agodoc: upgrade doxygen configuration
Ferry Huberts [Wed, 4 Jan 2017 12:08:49 +0000 (13:08 +0100)]
doc: upgrade doxygen configuration

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: update java dependency bundles
Ferry Huberts [Wed, 4 Jan 2017 10:08:29 +0000 (11:08 +0100)]
info: update java dependency bundles

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agochangelog: add a note about the '/http' and '/plain' request prefixes
Ferry Huberts [Wed, 4 Jan 2017 09:52:16 +0000 (10:52 +0100)]
changelog: add a note about the '/http' and '/plain' request prefixes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: add request timeout configuration parameter
Ferry Huberts [Wed, 4 Jan 2017 08:09:51 +0000 (09:09 +0100)]
info: add request timeout configuration parameter

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: add sanitation of the configuration
Ferry Huberts [Wed, 4 Jan 2017 07:45:33 +0000 (08:45 +0100)]
info: add sanitation of the configuration

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: release changed java OSGi bundles
Ferry Huberts [Tue, 3 Jan 2017 21:48:29 +0000 (22:48 +0100)]
info: release changed java OSGi bundles

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: return 'REQUEST TIMEOUT' when receiving the request did not work
Ferry Huberts [Tue, 3 Jan 2017 10:59:44 +0000 (11:59 +0100)]
info: return 'REQUEST TIMEOUT' when receiving the request did not work

This effectively is the case when a user-operated telnet connection is
encountered - when the request is not present when the code tries to
receive it.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: do not block when receiving the request
Ferry Huberts [Tue, 3 Jan 2017 10:15:25 +0000 (11:15 +0100)]
info: do not block when receiving the request

Otherwise the whole of olsrd is blocked, since it's single-threaded.

Note: this will effectively disallow user-operated telnet connection, since
      the code will not wait for input and expects the request to be there
      once it tries to receive data.
      A normal telnet connection did not work before (v0.6.8.1 was checked)
      so no surprises here.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: allow a small delay between connection accept and request arrival
Ferry Huberts [Tue, 3 Jan 2017 10:31:39 +0000 (11:31 +0100)]
info: allow a small delay between connection accept and request arrival

To compensate for slow networks and far-away nodes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: fix drain_request to not block
Ferry Huberts [Tue, 3 Jan 2017 10:10:16 +0000 (11:10 +0100)]
info: fix drain_request to not block

Otherwise the whole of olsrd is blocked, since it's single-threaded

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: add a comment about the size of the receive buffer
Ferry Huberts [Tue, 3 Jan 2017 10:08:40 +0000 (11:08 +0100)]
info: add a comment about the size of the receive buffer

The maximum size really is a most the size of a single IP packet,
it is the assumption on which the code is designed. The request must
be in the first packet on the connection.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: move a comment
Ferry Huberts [Tue, 3 Jan 2017 10:06:44 +0000 (11:06 +0100)]
info: move a comment

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: fix levels of a few debug messages
Ferry Huberts [Tue, 3 Jan 2017 09:38:37 +0000 (10:38 +0100)]
info: fix levels of a few debug messages

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agojsoninfo: add cli arguments to the config object
Ferry Huberts [Mon, 2 Jan 2017 15:37:31 +0000 (16:37 +0100)]
jsoninfo: add cli arguments to the config object

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agojsoninfo: always output the configuration checksum
Ferry Huberts [Sun, 25 Dec 2016 12:44:00 +0000 (13:44 +0100)]
jsoninfo: always output the configuration checksum

So that the client knows when it has changed and thus when to
re-fetch the configuration related (startup) objects.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agomain: save argc and argv for later use
Ferry Huberts [Sun, 25 Dec 2016 13:30:49 +0000 (14:30 +0100)]
main: save argc and argv for later use

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoconf: calculate the checksum over the effective configuration
Ferry Huberts [Mon, 2 Jan 2017 14:14:47 +0000 (15:14 +0100)]
conf: calculate the checksum over the effective configuration

Can be disabled by compiling with 'NOCONFIGCHECKSUM=1'.

We can't simply checksum the olsr_cnf struct because it contains pointers
to other structs that would vary every time.
This is the simplest solution.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoconf: ensure the correct configuration file is stored in the configuration
Ferry Huberts [Sun, 25 Dec 2016 13:30:00 +0000 (14:30 +0100)]
conf: ensure the correct configuration file is stored in the configuration

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoconf: clear allocated default config before filling it.
Ferry Huberts [Sun, 25 Dec 2016 13:29:27 +0000 (14:29 +0100)]
conf: clear allocated default config before filling it.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: introduce command prefixes '/http' and '/plain'
Ferry Huberts [Mon, 2 Jan 2017 13:06:22 +0000 (14:06 +0100)]
info: introduce command prefixes '/http' and '/plain'

All info plugins support a number of request prefixes:
- /http : forces output WITH    http headers, temporarily overriding the
          configured "httpheaders" value.
- /plain: forces output WITHOUT http headers, temporarily overriding the
          configured "httpheaders" value.

These prefixes have to be at the start of the request string, can occur
only there, and can occur only once.

Note that this will NOT work when there is an internal error (only occurs
when the connection is not ready to be read, which is very unlikely).

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: sanitise the request right after it's been received
Ferry Huberts [Thu, 8 Dec 2016 09:30:30 +0000 (10:30 +0100)]
info: sanitise the request right after it's been received

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: read the request as early as possible
Ferry Huberts [Sat, 10 Dec 2016 17:05:27 +0000 (18:05 +0100)]
info: read the request as early as possible

So that the request is already known before (further) checking
pre-conditions. Will be used later.

Also check for too many requests in flight when replying with an
internal server error.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: fix a comment and add a comment
Ferry Huberts [Sat, 10 Dec 2016 17:00:24 +0000 (18:00 +0100)]
info: fix a comment and add a comment

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: be explicit about adding headers
Ferry Huberts [Wed, 7 Dec 2016 21:19:11 +0000 (22:19 +0100)]
info: be explicit about adding headers

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: rename stripEOLs to stripTrailingWhitespace
Ferry Huberts [Thu, 8 Dec 2016 08:54:48 +0000 (09:54 +0100)]
info: rename stripEOLs to stripTrailingWhitespace

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: protect cutAtFirstEOL against invalid input and zero length
Ferry Huberts [Thu, 8 Dec 2016 07:49:27 +0000 (08:49 +0100)]
info: protect cutAtFirstEOL against invalid input and zero length

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: protect stripTrailingSlashes against invalid input and zero length
Ferry Huberts [Thu, 8 Dec 2016 07:49:08 +0000 (08:49 +0100)]
info: protect stripTrailingSlashes against invalid input and zero length

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: protect skipLeadingWhitespace against invalid input and zero length
Ferry Huberts [Wed, 7 Dec 2016 23:12:37 +0000 (00:12 +0100)]
info: protect skipLeadingWhitespace against invalid input and zero length

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: protect skipMultipleSlashes against invalid input and zero length
Ferry Huberts [Thu, 8 Dec 2016 07:42:03 +0000 (08:42 +0100)]
info: protect skipMultipleSlashes against invalid input and zero length

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: protect stripEOLs against invalid input and zero length
Ferry Huberts [Wed, 7 Dec 2016 23:12:16 +0000 (00:12 +0100)]
info: protect stripEOLs against invalid input and zero length

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: improve readability of the 'empty request' check
Ferry Huberts [Wed, 7 Dec 2016 21:24:35 +0000 (22:24 +0100)]
info: improve readability of the 'empty request' check

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: trival debug output fix
Ferry Huberts [Wed, 7 Dec 2016 21:20:50 +0000 (22:20 +0100)]
info: trival debug output fix

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: trivial comment fix
Ferry Huberts [Wed, 7 Dec 2016 21:16:26 +0000 (22:16 +0100)]
info: trivial comment fix

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: drain the request when there are too many requests in flight
Ferry Huberts [Wed, 7 Dec 2016 22:24:15 +0000 (23:24 +0100)]
info: drain the request when there are too many requests in flight

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: send everything on empty requests
Ferry Huberts [Thu, 8 Dec 2016 10:46:00 +0000 (11:46 +0100)]
info: send everything on empty requests

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: rework HTTP request detection and request sanitation
Ferry Huberts [Sat, 10 Dec 2016 16:53:28 +0000 (17:53 +0100)]
info: rework HTTP request detection and request sanitation

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: ensure the request is initially empty
Ferry Huberts [Thu, 8 Dec 2016 10:34:40 +0000 (11:34 +0100)]
info: ensure the request is initially empty

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoinfo: java: upgrade gradle wrapper
Ferry Huberts [Tue, 3 Jan 2017 14:35:45 +0000 (15:35 +0100)]
info: java: upgrade gradle wrapper

The magical incantation is:
  gradle wrapper --gradle-version 3.2.1

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge branch 'release-0.9.5'
Ferry Huberts [Wed, 21 Dec 2016 22:35:39 +0000 (23:35 +0100)]
Merge branch 'release-0.9.5'

* release-0.9.5:
  main: blacklist UCLIBC for OLSR_HAVE_EXECINFO_H

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agomain: blacklist UCLIBC for OLSR_HAVE_EXECINFO_H
Ferry Huberts [Wed, 21 Dec 2016 22:24:02 +0000 (23:24 +0100)]
main: blacklist UCLIBC for OLSR_HAVE_EXECINFO_H

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agoMerge branch 'release-0.9.5'
Ferry Huberts [Wed, 21 Dec 2016 08:50:45 +0000 (09:50 +0100)]
Merge branch 'release-0.9.5'

* release-0.9.5:
  main: improve EXECINFO include handling a bit

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2 years agomain: improve EXECINFO include handling a bit
Ferry Huberts [Wed, 21 Dec 2016 08:38:05 +0000 (09:38 +0100)]
main: improve EXECINFO include handling a bit

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoMerge branch 'release-0.9.5'
Ferry Huberts [Tue, 6 Dec 2016 16:00:53 +0000 (17:00 +0100)]
Merge branch 'release-0.9.5'

* release-0.9.5:
  info: fix json Content-Type header
  txtinfo: do not use http headers by default

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>