olsrd.git
6 years ago fix wrong sizeof() parameter
Henning Rogge [Mon, 22 Oct 2012 12:34:31 +0000 (14:34 +0200)]
fix wrong sizeof() parameter

    Coverity:

    CID 739610 (#1 of 1): Incorrect sizeof expression (BAD_SIZEOF)
    Taking the size of pointer parameter "lower_border_ip" is suspicious.

    CID 739611 (#1 of 1): Incorrect sizeof expression (BAD_SIZEOF)
    Taking the size of pointer parameter "upper_border_ip" is suspicious.

    CID 739692 (#1 of 2): Wrong sizeof argument (SIZEOF_MISMATCH)
    Passing argument "lower_border_ip" of type "union olsr_ip_addr *" and argument "8UL /* sizeof (lower_border_ip) */" to function "memset(void *, int, size_t)" is suspicious. Did you intend to use "sizeof(*lower_border_ip)" instead of "sizeof (lower_border_ip)" ?

    CID 739692 (#2 of 2): Wrong sizeof argument (SIZEOF_MISMATCH)
    Passing argument "upper_border_ip" of type "union olsr_ip_addr *" and argument "8UL /* sizeof (upper_border_ip) */" to function "memset(void *, int, size_t)" is suspicious. Did you intend to use "sizeof(*upper_border_ip)" instead of "sizeof (upper_border_ip)" ?

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
6 years ago fix control flow if kill() command fails to end program
Henning Rogge [Mon, 22 Oct 2012 12:29:30 +0000 (14:29 +0200)]
fix control flow if kill() command fails to end program

    Coverity:
    CID 739665 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
    At (17): "ifp->olsr_socket" is passed to a parameter that cannot be negative.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
6 years agopud: nmealib: fix invalid format string conversion
Ferry Huberts [Mon, 22 Oct 2012 10:14:05 +0000 (12:14 +0200)]
pud: nmealib: fix invalid format string conversion

Coverity:
CID 739674 (#1 of 1): Printf format string issue (PW.BAD_PRINTF_FORMAT_STRING)
At (1): invalid format string conversion

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: nmealib: fix buffer overrun
Ferry Huberts [Mon, 22 Oct 2012 10:08:32 +0000 (12:08 +0200)]
pud: nmealib: fix buffer overrun

Coverity:
CID 739669 (#1 of 1): Out-of-bounds write (OVERRUN)
At (11): Overrunning array of 64 bytes at byte offset 64 by dereferencing
         pointer "psSatInfo".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: nmealib: fix buffer overrun
Ferry Huberts [Mon, 22 Oct 2012 10:07:54 +0000 (12:07 +0200)]
pud: nmealib: fix buffer overrun

Coverity:
CID 739668 (#1 of 1): Out-of-bounds write (OVERRUN)
At (10): Overrunning array of 64 bytes at byte offset 64 by dereferencing
         pointer "psSatPrn".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: nmealib: fix copy/paste error
Ferry Huberts [Mon, 22 Oct 2012 09:50:59 +0000 (11:50 +0200)]
pud: nmealib: fix copy/paste error

Coverity:
CID 739627 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
"lat" in "pos->lat" looks like a copy-paste error.
Should it say "lon" instead?

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: fix getBestUplinkGateway
Ferry Huberts [Mon, 22 Oct 2012 11:01:18 +0000 (13:01 +0200)]
pud: fix getBestUplinkGateway

Coverity:
CID 739645 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
At (18): Passing null pointer "&gw_best->originator.v4" to function
         "ip4cmp(struct in_addr const *, struct in_addr const *)", which
         dereferences it.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: fix position file stat/use race
Ferry Huberts [Mon, 22 Oct 2012 10:48:29 +0000 (12:48 +0200)]
pud: fix position file stat/use race

Coverity:
CID 739696 (#1 of 1): Time of check time of use (TOCTOU)
At (1): Calling function "stat(char const * restrict,
                               struct stat * restrict)"
        to perform check on "fileName".
At (4): Calling function "fopen(char const * restrict,
                                char const * restrict)"
        that uses "fileName" after a check function. This can cause a
        time-of-check, time-of-use race condition.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: fix socket error
Ferry Huberts [Mon, 22 Oct 2012 11:45:40 +0000 (13:45 +0200)]
pud: fix socket error

Coverity:
CID 739663 (#2 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
At (8): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: fix socket error
Ferry Huberts [Mon, 22 Oct 2012 10:19:25 +0000 (12:19 +0200)]
pud: fix socket error

Coverity:
CID 739662 (#2 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
At (9): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agopud: fix resource leak
Ferry Huberts [Mon, 22 Oct 2012 09:48:21 +0000 (11:48 +0200)]
pud: fix resource leak

Coverity:
CID 739679 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (24): Variable "fd" going out of scope leaks the storage it points to.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agocommon: fix varargs cleanup
Ferry Huberts [Mon, 22 Oct 2012 11:26:30 +0000 (13:26 +0200)]
common: fix varargs cleanup

Coverity:
CID 739703 (#1 of 1): Missing varargs init or cleanup (VARARGS)
At (4): va_end was not called for "ap2".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agoimprove VERBOSE handling
Ferry Huberts [Fri, 19 Oct 2012 22:59:50 +0000 (00:59 +0200)]
improve VERBOSE handling

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agoandroid: gcc 4.6 comes with NDK r8b and is not in NDK r8
Hans-Christoph Steiner [Fri, 19 Oct 2012 15:08:58 +0000 (11:08 -0400)]
android: gcc 4.6 comes with NDK r8b and is not in NDK r8

6 years agoandroid: update to use gcc 4.6, available starting with NDK r8
Hans-Christoph Steiner [Fri, 19 Oct 2012 14:38:08 +0000 (10:38 -0400)]
android: update to use gcc 4.6, available starting with NDK r8

6 years agoMoved regex library to a makefile of its own to solve the issues with compiler warnings.
Henning Rogge [Fri, 19 Oct 2012 14:16:18 +0000 (16:16 +0200)]
Moved regex library to a makefile of its own to solve the issues with compiler warnings.

6 years agobsd: fixup comment
Ferry Huberts [Thu, 18 Oct 2012 09:26:03 +0000 (11:26 +0200)]
bsd: fixup comment

to make it the same as in the release-0.6.4 branch

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
6 years agoFix slightly insulting error message.
Henning Rogge [Thu, 18 Oct 2012 09:17:04 +0000 (11:17 +0200)]
Fix slightly insulting error message.

6 years agochose the proper #define in order to take the right #include
Aaron Kaplan [Thu, 18 Oct 2012 08:44:57 +0000 (10:44 +0200)]
chose the proper #define in order to take the right #include
dependencies

7 years agoAdd VERBOSE flag to makefile to display full gcc commands
Henning Rogge [Tue, 16 Oct 2012 06:47:14 +0000 (08:47 +0200)]
Add VERBOSE flag to makefile to display full gcc commands

7 years agoAdd -Werror=format-security
Henning Rogge [Tue, 16 Oct 2012 06:43:54 +0000 (08:43 +0200)]
Add -Werror=format-security
Add -O2 -D_FORTIFY_SOURCE=2 for non-debug builds (unless overwritten)

7 years agoFix buffer overflow in mdns plugin
Henning Rogge [Mon, 15 Oct 2012 06:00:17 +0000 (08:00 +0200)]
Fix buffer overflow in mdns plugin

7 years agoadd gcc hardening flags to linux-gtk GUI
Hans-Christoph Steiner [Fri, 12 Oct 2012 20:10:07 +0000 (16:10 -0400)]
add gcc hardening flags to linux-gtk GUI

7 years agomdns: fix a compilation warning / copy-paste error
Ferry Huberts [Thu, 11 Oct 2012 08:49:09 +0000 (10:49 +0200)]
mdns: fix a compilation warning / copy-paste error

src/RouterElection.c: In function ‘electTimer’:
src/RouterElection.c:177:17: warning: ‘tmp’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agomdns: fix compilation warnings
Ferry Huberts [Thu, 11 Oct 2012 08:15:45 +0000 (10:15 +0200)]
mdns: fix compilation warnings

src/mdns.c: In function ‘isInFilteredList’:
src/mdns.c:406:7: warning: passing argument 2 of ‘olsr_ip_to_string’ from incompatible pointer type [enabled by default]
In file included from src/mdns.c:65:0:
../../src/ipcalc.h:146:1: note: expected ‘const union olsr_ip_addr *’ but argument is of type ‘struct in_addr *’
src/mdns.c:406:7: warning: passing argument 2 of ‘olsr_ip_to_string’ from incompatible pointer type [enabled by default]
In file included from src/mdns.c:65:0:
../../src/ipcalc.h:146:1: note: expected ‘const union olsr_ip_addr *’ but argument is of type ‘struct in_addr *’
src/mdns.c:411:7: warning: passing argument 2 of ‘olsr_ip_to_string’ from incompatible pointer type [enabled by default]
In file included from src/mdns.c:65:0:
../../src/ipcalc.h:146:1: note: expected ‘const union olsr_ip_addr *’ but argument is of type ‘struct in6_addr *’
src/mdns.c:411:7: warning: passing argument 2 of ‘olsr_ip_to_string’ from incompatible pointer type [enabled by default]
In file included from src/mdns.c:65:0:
../../src/ipcalc.h:146:1: note: expected ‘const union olsr_ip_addr *’ but argument is of type ‘struct in6_addr *’

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: merge the olsr_get_ipv{4,6}_inet_gateway functions
Ferry Huberts [Wed, 29 Aug 2012 09:52:52 +0000 (11:52 +0200)]
gateway: merge the olsr_get_ipv{4,6}_inet_gateway functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoremove most '#if 0' blocks
Ferry Huberts [Tue, 28 Aug 2012 11:57:30 +0000 (13:57 +0200)]
remove most '#if 0' blocks

Leave mpr related blocks alone.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoMerge remote-tracking branch 'origin/mDNS-plugin-GSoC-2012'
Saverio Proto [Wed, 3 Oct 2012 15:40:39 +0000 (17:40 +0200)]
Merge remote-tracking branch 'origin/mDNS-plugin-GSoC-2012'

7 years agofixed misspelling: usefull -> useful
Hans-Christoph Steiner [Tue, 2 Oct 2012 23:05:53 +0000 (19:05 -0400)]
fixed misspelling: usefull -> useful

7 years agofix misspelling: 'adress' --> 'address'
Hans-Christoph Steiner [Tue, 2 Oct 2012 23:05:21 +0000 (19:05 -0400)]
fix misspelling: 'adress' --> 'address'

    - an 'address' represents a location, i.e. MAC address

    - 'adress' is a verb meaning "to speak to"

7 years agoolsrd-adhoc-setup: configure NetworkManager to be nice when adhoc is manually setup
Hans-Christoph Steiner [Wed, 12 Sep 2012 00:42:24 +0000 (20:42 -0400)]
olsrd-adhoc-setup: configure NetworkManager to be nice when adhoc is manually setup

7 years agoolsrd-adhoc-setup: use static BSSID by default to assoc. with the right mesh
Hans-Christoph Steiner [Tue, 11 Sep 2012 22:35:06 +0000 (18:35 -0400)]
olsrd-adhoc-setup: use static BSSID by default to assoc. with the right mesh

7 years agoFix optional compilation of the nl80211 lq plugin
Frank de Brabander [Mon, 3 Sep 2012 11:38:38 +0000 (13:38 +0200)]
Fix optional compilation of the nl80211 lq plugin

Signed-off-by: Frank de Brabander <brabander@fox-it.com>
7 years agoIncorporate fix by Ferry Hubert for float to double promotion
Frank de Brabander [Fri, 31 Aug 2012 11:34:29 +0000 (13:34 +0200)]
Incorporate fix by Ferry Hubert for float to double promotion

Signed-off-by: Frank de Brabander <brabander@fox-it.com>
7 years agoMerge branch with new lq plugin for NL80211 support
Frank de Brabander [Fri, 31 Aug 2012 11:24:20 +0000 (13:24 +0200)]
Merge branch with new lq plugin for NL80211 support

Signed-off-by: Frank de Brabander <brabander@fox-it.com>
7 years agogateway: rename 2 variables
Ferry Huberts [Mon, 27 Aug 2012 12:27:54 +0000 (14:27 +0200)]
gateway: rename 2 variables

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoolsrd_plugin: remove #if 1
Ferry Huberts [Tue, 28 Aug 2012 11:47:33 +0000 (13:47 +0200)]
olsrd_plugin: remove #if 1

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoupdate comments on all ifdefs
Ferry Huberts [Tue, 28 Aug 2012 11:43:44 +0000 (13:43 +0200)]
update comments on all ifdefs

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoifdef: fix some include ifdefs
Ferry Huberts [Tue, 28 Aug 2012 11:43:41 +0000 (13:43 +0200)]
ifdef: fix some include ifdefs

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agouse the Microsoft standard '_WIN32' macro instead of the self-defined 'WIN32'
Hans-Christoph Steiner [Mon, 27 Aug 2012 19:25:05 +0000 (15:25 -0400)]
use the Microsoft standard '_WIN32' macro instead of the self-defined 'WIN32'

http://msdn.microsoft.com/en-us/library/ff540443.aspx

7 years agouse the POSIX standard '__linux__' macro instead of 'linux'
Hans-Christoph Steiner [Mon, 27 Aug 2012 18:58:24 +0000 (14:58 -0400)]
use the POSIX standard '__linux__' macro instead of 'linux'

"Use __linux__ for this purpose, not linux. Although the latter is defined, it is not POSIX compliant."
http://www.faqs.org/docs/Linux-HOWTO/GCC-HOWTO.html#INDEX.25

7 years agohttp_info: pud satellites in use are now green, not in use are red
Ferry Huberts [Mon, 27 Aug 2012 11:04:11 +0000 (13:04 +0200)]
http_info: pud satellites in use are now green, not in use are red

To improve readability

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: include nmealib v1.0.3
Ferry Huberts [Mon, 27 Aug 2012 08:24:57 +0000 (10:24 +0200)]
pud: include nmealib v1.0.3

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: force pending buffer out if not enough space for our message
Ferry Huberts [Fri, 24 Aug 2012 13:10:51 +0000 (15:10 +0200)]
pud: force pending buffer out if not enough space for our message

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoPud: Do not use the variable name strlen.
Henning Rogge [Sat, 25 Aug 2012 11:03:08 +0000 (13:03 +0200)]
Pud: Do not use the variable name strlen.

7 years agogateway: merge 2 code blocks
Ferry Huberts [Fri, 24 Aug 2012 08:50:46 +0000 (10:50 +0200)]
gateway: merge 2 code blocks

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: prevent 2 NULL dereferences
Ferry Huberts [Thu, 23 Aug 2012 12:53:48 +0000 (14:53 +0200)]
gateway: prevent 2 NULL dereferences

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: the gateway to set must either be an IPv4 or IPv6 gateway or both
Ferry Huberts [Thu, 23 Aug 2012 12:42:24 +0000 (14:42 +0200)]
gateway: the gateway to set must either be an IPv4 or IPv6 gateway or both

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: the gateway to set must be in the gateway tree
Ferry Huberts [Thu, 23 Aug 2012 12:40:28 +0000 (14:40 +0200)]
gateway: the gateway to set must be in the gateway tree

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: merge 2 code blocks
Ferry Huberts [Thu, 23 Aug 2012 12:33:28 +0000 (14:33 +0200)]
gateway: merge 2 code blocks

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: push an if condition into its nested if's
Ferry Huberts [Thu, 23 Aug 2012 12:31:54 +0000 (14:31 +0200)]
gateway: push an if condition into its nested if's

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: simplify a condition
Ferry Huberts [Thu, 23 Aug 2012 12:15:54 +0000 (14:15 +0200)]
gateway: simplify a condition

Because of the preceding
  if (ipv4) {
    current_ipv4_gw = NULL;
  }
  if (ipv6) {
    current_ipv6_gw = NULL;
  }

The condition(s)
   if (ipvX && entry != current_ipvX_gw
Are effectively
   if (ipvX && entry != NULL
Also, the test
   entry != NULL
was already performed by the enclosing if statement

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: rename a function
Ferry Huberts [Tue, 21 Aug 2012 12:52:12 +0000 (14:52 +0200)]
gateway: rename a function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: inline olsr_trigger_inetgw_selection function
Ferry Huberts [Wed, 22 Aug 2012 10:48:16 +0000 (12:48 +0200)]
gateway: inline olsr_trigger_inetgw_selection function

To simplify and reduce the number of functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: inline olsr_find_gateway_entry function
Ferry Huberts [Wed, 22 Aug 2012 10:47:50 +0000 (12:47 +0200)]
gateway: inline olsr_find_gateway_entry function

To simplify and reduce the number of functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: add comments to struct olsr_gw_handler function prototypes
Ferry Huberts [Wed, 22 Aug 2012 11:28:11 +0000 (13:28 +0200)]
gateway: add comments to struct olsr_gw_handler function prototypes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: rename hooks
Ferry Huberts [Wed, 22 Aug 2012 11:26:19 +0000 (13:26 +0200)]
gateway: rename hooks

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: add init and cleanup hooks for gateway plugins
Ferry Huberts [Wed, 22 Aug 2012 11:22:02 +0000 (13:22 +0200)]
gateway: add init and cleanup hooks for gateway plugins

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: clear gw_handler during cleanup
Ferry Huberts [Tue, 14 Aug 2012 08:08:36 +0000 (10:08 +0200)]
gateway: clear gw_handler during cleanup

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: add asserts to validate gw_handler
Ferry Huberts [Tue, 14 Aug 2012 08:18:41 +0000 (10:18 +0200)]
gateway: add asserts to validate gw_handler

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: remove 'unused' v{4,6}gw_choosen_external
Ferry Huberts [Thu, 23 Aug 2012 12:02:22 +0000 (14:02 +0200)]
gateway: remove 'unused' v{4,6}gw_choosen_external

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: formatting
Ferry Huberts [Wed, 22 Aug 2012 11:15:20 +0000 (13:15 +0200)]
gateway: formatting

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: reorder functions to reflect order in header
Ferry Huberts [Wed, 22 Aug 2012 10:40:42 +0000 (12:40 +0200)]
gateway: reorder functions to reflect order in header

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agogateway: clarify header with extra comments and ordering
Ferry Huberts [Fri, 24 Aug 2012 08:25:40 +0000 (10:25 +0200)]
gateway: clarify header with extra comments and ordering

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Reviewed-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agosgwdynspeed: make sure to update the smart gw netmask
Ferry Huberts [Tue, 21 Aug 2012 13:05:36 +0000 (15:05 +0200)]
sgwdynspeed: make sure to update the smart gw netmask

when the uplink and/or downlink speeds change, because the smart gw
netmask carries the uplink and downlink speeds that are advertised
to other nodes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: move refresh_smartgw_netmask to exported functions section
Ferry Huberts [Tue, 21 Aug 2012 13:02:14 +0000 (15:02 +0200)]
gateway: move refresh_smartgw_netmask to exported functions section

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: export refresh_smartgw_netmask function
Ferry Huberts [Tue, 21 Aug 2012 13:01:48 +0000 (15:01 +0200)]
gateway: export refresh_smartgw_netmask function

we need it when we adjust the uplink and/or downlink speeds

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoMerge branch 'master' into stable master-stable-switch
Henning Rogge [Wed, 15 Aug 2012 16:00:55 +0000 (18:00 +0200)]
Merge branch 'master' into stable

7 years agoRevert "mDNS: init ListOfFilteredHosts in the proper place and not at every received...
Saverio Proto [Mon, 13 Aug 2012 22:09:47 +0000 (00:09 +0200)]
Revert "mDNS: init ListOfFilteredHosts in the proper place and not at every received packet"

This reverts commit 0b0ddb77c04ca8f490ede4438acf7073f5a47be1.

Conflicts:

lib/mdns/src/mdns.c

It caused a segfault

7 years agomDNS: Fixed typo in README
Saverio Proto [Mon, 13 Aug 2012 21:29:02 +0000 (23:29 +0200)]
mDNS: Fixed typo in README

7 years agomDNS: better debug support for filtered hosts feature
Saverio Proto [Mon, 13 Aug 2012 20:03:17 +0000 (22:03 +0200)]
mDNS: better debug support for filtered hosts feature

7 years agomDNS: trivial, removed TODO from code for something that was implemented
Saverio Proto [Mon, 13 Aug 2012 19:40:41 +0000 (21:40 +0200)]
mDNS: trivial, removed TODO from code for something that was implemented

7 years agomDNS: init ListOfFilteredHosts in the proper place and not at every received packet
Saverio Proto [Mon, 13 Aug 2012 19:27:39 +0000 (21:27 +0200)]
mDNS: init ListOfFilteredHosts in the proper place and not at every received packet

7 years agomDNS: Change version of mdns plugin to 1.0.1 after GSoC 2012 work by Alessandro Gnagni
Saverio Proto [Wed, 30 May 2012 17:18:45 +0000 (19:18 +0200)]
mDNS: Change version of mdns plugin to 1.0.1 after GSoC 2012 work by Alessandro Gnagni

7 years agomDNS: trivial debug print fix and code readibility improvement
Saverio Proto [Sun, 12 Aug 2012 12:35:42 +0000 (14:35 +0200)]
mDNS: trivial debug print fix and code readibility improvement

7 years agomDNS: BUGFIX, mDNS plugin, hello message of router election not sent if debug = 0
Alessandro [Sun, 12 Aug 2012 11:12:31 +0000 (13:12 +0200)]
mDNS: BUGFIX, mDNS plugin, hello message of router election not sent if debug = 0

7 years agomDNS: Update checksum field of the IPv4 Header after altering TTL
Saverio Proto [Sat, 28 Jul 2012 16:10:38 +0000 (18:10 +0200)]
mDNS: Update checksum field of the IPv4 Header after altering TTL

7 years agomDNS: Reworked logic of router Election. The election is now handled on interface...
Alessandro [Thu, 26 Jul 2012 14:03:07 +0000 (16:03 +0200)]
mDNS: Reworked logic of router Election. The election is now handled on interface basis, because the router could have one interface where it needs to be master and another interface where it needs to be disabled. There was a logical bug in the earlier implementation.

7 years agomDNS: Updated README file for mDNS plugin
Alessandro [Wed, 18 Jul 2012 09:47:39 +0000 (11:47 +0200)]
mDNS: Updated README file for mDNS plugin

7 years agomDNS: Implemented Host Filtering for ipv4 and ipv6, writing in the config file which...
Alessandro [Sat, 14 Jul 2012 14:56:45 +0000 (16:56 +0200)]
mDNS: Implemented Host Filtering for ipv4 and ipv6, writing in the config file which hosts to ignore. The mDNS packets from the ignored hosts will be ignored and not propagated in the network

7 years agomDNS: Fix most of the warnings from the compiler
Saverio Proto [Fri, 20 Jul 2012 12:35:25 +0000 (14:35 +0200)]
mDNS: Fix most of the warnings from the compiler

7 years agomDNS: Implemented router election mechansim to have only 1 active mDNS OLSR router...
Alessandro Gnagni [Wed, 13 Jun 2012 15:48:32 +0000 (17:48 +0200)]
mDNS: Implemented router election mechansim to have only 1 active mDNS OLSR router in 1 LAN

Implemented IPv4 and IPv6 socket that should
capture the router election signalling packets (hellos)

Hellos are sent out with a timer

A second time triggers the router to decide if he is master

7 years agomDNS: review of Alessandro Gnagni patch, inserted a config value to enable or disable...
Alessandro Gnagni [Tue, 5 Jun 2012 07:20:46 +0000 (09:20 +0200)]
mDNS: review of Alessandro Gnagni patch, inserted a config value to enable or disable TTL check and change, default is enabled.

7 years agomDNS: Upgrading the container_of.h that was backported from src/common in master
Saverio Proto [Thu, 10 May 2012 07:50:03 +0000 (09:50 +0200)]
mDNS: Upgrading the container_of.h that was backported from src/common in master

A newer version is present in master and this commit makes the upgrade

7 years agomDNS: Skeleton code for new host filter feature in mDNS plugin
Saverio Proto [Tue, 8 May 2012 13:42:17 +0000 (15:42 +0200)]
mDNS: Skeleton code for new host filter feature in mDNS plugin

Skeleton code of the new feature of mDNS to filter
out some hosts to prevent forwarding of services
we dont want to propagate in the mesh

In the configuration file we can write which IP address we want to discard
and do not propagate in the mDNS flooding.

For example if I have Apple AirPort at home, do not giving out any service
I dont want those mDNS packets travelling in the all mesh network.

7 years agomDNS: Fixing loops for mDNS packets when mDNS plugin is misconfigured
Alessandro Gnagni [Sat, 5 May 2012 21:41:20 +0000 (23:41 +0200)]
mDNS: Fixing loops for mDNS packets when mDNS plugin is misconfigured

If two mDNS plug-in enabled OLSR routers are attached to the same HNA network, then mDNS packets will loop back and forth between the two, also flooding the whole OLSR network. For the moment the temporary solution to this problem was to enable the plug-in on one router at a time on the same HNA. A real implemented here is  the following:

    usually mDNS packets have a TTL != 1, so:
    capture only mDNS packets with TTL != 1
    when decapsulating mDNS packets, set TTL = 1
    where TTL is the IP Time-to-live field or the IPv6 HopLimit field

 * Modified code to forward mdns packet from HNA into OLSRd network changing TTL/Hlim to 1
 * Now the mDns plugin discard all packet from HNA that have TTL/Hlim equals to 1

7 years agoPUD: nmealib: use fully qualified path to ldconfig
Ferry Huberts [Thu, 9 Aug 2012 20:16:40 +0000 (22:16 +0200)]
PUD: nmealib: use fully qualified path to ldconfig

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agolinux: rework usage of defines w.r.t. IPv6 tunnel
Ferry Huberts [Wed, 8 Aug 2012 12:31:58 +0000 (14:31 +0200)]
linux: rework usage of defines w.r.t. IPv6 tunnel

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agolinux: name is required to be non-null in olsr_os_cleanup_iptunnel
Ferry Huberts [Wed, 8 Aug 2012 12:05:52 +0000 (14:05 +0200)]
linux: name is required to be non-null in olsr_os_cleanup_iptunnel

Mainly to get rid of TUNNEL_ENDPOINT_IF and TUNNEL_ENDPOINT_IF6
usage here.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agolinux: consolidate os_ip4_tunnel and os_ip6_tunnel
Ferry Huberts [Wed, 8 Aug 2012 12:25:17 +0000 (14:25 +0200)]
linux: consolidate os_ip4_tunnel and os_ip6_tunnel

the code was almost the same, so merge the functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: add SmartGatewayWeightExitLink and SmartGatewayWeightEtx
Ferry Huberts [Thu, 26 Jul 2012 14:15:21 +0000 (16:15 +0200)]
pud: add SmartGatewayWeightExitLink and SmartGatewayWeightEtx

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: add exit link weighing
Ferry Huberts [Fri, 3 Aug 2012 09:16:41 +0000 (11:16 +0200)]
gateway: add exit link weighing

Only performed when the weighing factors are set

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: calculate with uint64_t i.s.o. olsr_linkcost
Ferry Huberts [Wed, 1 Aug 2012 10:30:41 +0000 (12:30 +0200)]
gateway: calculate with uint64_t i.s.o. olsr_linkcost

The next change needs larger numbers

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agocfg: add SmartGateway weighing parameters
Ferry Huberts [Fri, 3 Aug 2012 09:12:22 +0000 (11:12 +0200)]
cfg: add SmartGateway weighing parameters

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: cfg: mark BMF interface as non-persistent
Ferry Huberts [Fri, 3 Aug 2012 17:57:46 +0000 (19:57 +0200)]
pud: cfg: mark BMF interface as non-persistent

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agobmf: allow marking the BMF network interface as non-persistent
Ferry Huberts [Fri, 3 Aug 2012 17:53:30 +0000 (19:53 +0200)]
bmf: allow marking the BMF network interface as non-persistent

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agotc_set.c duplicate_set.c: small bug-fix - case ipv6 - ipwidth 30-->39
harald [Wed, 1 Aug 2012 15:29:25 +0000 (17:29 +0200)]
tc_set.c duplicate_set.c: small bug-fix - case ipv6 - ipwidth 30-->39

7 years agogateway: rename a variable
Ferry Huberts [Mon, 30 Jul 2012 13:07:08 +0000 (15:07 +0200)]
gateway: rename a variable

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: make smart gateway threshold parameter work properly.
Ferry Huberts [Mon, 30 Jul 2012 13:04:09 +0000 (15:04 +0200)]
gateway: make smart gateway threshold parameter work properly.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agogateway: add helper function gw_default_calc_threshold
Ferry Huberts [Mon, 30 Jul 2012 11:07:52 +0000 (13:07 +0200)]
gateway: add helper function gw_default_calc_threshold

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