olsrd.git
7 years agosecure: can only work for IPv4, so assert on it
Ferry Huberts [Tue, 23 Oct 2012 07:43:25 +0000 (09:43 +0200)]
secure: can only work for IPv4, so assert on it

Because of:
  memcpy(&rrmsg.destination, to, olsr_cnf->ipsize);
with
  rrmsg.destination being an uint32_t

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agohttpdinfo: fix resource leak
Ferry Huberts [Mon, 22 Oct 2012 13:45:07 +0000 (15:45 +0200)]
httpdinfo: fix resource leak

Coverity:
CID 739676 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (18): Handle variable "client_socket" going out of scope leaks the
handle.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agohttpinfo: do not close an 'error' socket return value
Ferry Huberts [Mon, 22 Oct 2012 13:31:51 +0000 (15:31 +0200)]
httpinfo: do not close an 'error' socket return value

Coverity:
CID 739658 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (5): "client_socket" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agobmf: do not dereference NULL pointer
Ferry Huberts [Mon, 22 Oct 2012 13:29:15 +0000 (15:29 +0200)]
bmf: do not dereference NULL pointer

Coverity:
CID 739667 (#1 of 1): Dereference null return value (NULL_RETURNS)
At (31): Dereferencing a null pointer "bestIntf".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agobmf: do not close an 'error' socket return value
Ferry Huberts [Mon, 22 Oct 2012 13:27:00 +0000 (15:27 +0200)]
bmf: do not close an 'error' socket return value

Coverity:
CID 739657 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (12): "listeningSkfd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agobmf: explicitly cast fgetc result into a char
Ferry Huberts [Mon, 22 Oct 2012 13:24:25 +0000 (15:24 +0200)]
bmf: explicitly cast fgetc result into a char

Coverity:
CID 739615 (#1 of 1): Truncated stdio return value (CHAR_IO)
Assigning the return value of "fgetc(FILE *)" to char "EthTapSpoofState"
truncates its value.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agoFix scanf() format vulnerabilities
Henning Rogge [Mon, 22 Oct 2012 13:25:18 +0000 (15:25 +0200)]
Fix scanf() format vulnerabilities

7 years ago Close file descriptor if error happens
Henning Rogge [Mon, 22 Oct 2012 13:13:46 +0000 (15:13 +0200)]
Close file descriptor if error happens

    Coverity:

    CID 739686 (#1 of 3): Resource leak (RESOURCE_LEAK)
    At (8): Handle variable "fd" going out of scope leaks the handle.

    CID 739686: Resource leak (RESOURCE_LEAK)
    At (12): Handle variable "fd" going out of scope leaks the handle.

    CID 739686: Resource leak (RESOURCE_LEAK)
    At (14): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years ago Check inet_pton return value
Henning Rogge [Mon, 22 Oct 2012 13:08:56 +0000 (15:08 +0200)]
Check inet_pton return value

    Coverity:

    CID 739622 (#1 of 1): Unchecked return value (CHECKED_RETURN)
    At (8): Calling function "inet_pton(int, char const * restrict, void * restrict)" without checking return value (as is done elsewhere 22 out of 25 times).

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years ago Use strscpy instead of strncpy.
Henning Rogge [Mon, 22 Oct 2012 13:06:57 +0000 (15:06 +0200)]
Use strscpy instead of strncpy.

    Coverity:

    CID 739613 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (6): Calling strncpy with a maximum size argument of 16 bytes on destination array "t->if_name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#1 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (4): Calling strncpy with a maximum size argument of 16 bytes on destination array "p4.name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#2 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (4): Calling strncpy with a maximum size argument of 16 bytes on destination array "p6.name" of size 16 bytes might leave the destination string unterminated.

    CID 739614 (#3 of 3): Buffer not null terminated (BUFFER_SIZE_WARNING)
    At (5): Calling strncpy with a maximum size argument of 16 bytes on destination array "ifr.ifr_ifrn.ifrn_name" of size 16 bytes might leave the destination string unterminated.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years agoMerge branch 'master' of http://olsr.org/git/olsrd
Henning Rogge [Mon, 22 Oct 2012 13:03:20 +0000 (15:03 +0200)]
Merge branch 'master' of http://olsr.org/git/olsrd

7 years agosgwdynspeed: fix resource leak and file stat/use race
Ferry Huberts [Mon, 22 Oct 2012 12:46:14 +0000 (14:46 +0200)]
sgwdynspeed: fix resource leak and file stat/use race

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

CID 739697 (#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>
7 years agopud: fix checking of downlink message IP version
Ferry Huberts [Mon, 22 Oct 2012 12:37:23 +0000 (14:37 +0200)]
pud: fix checking of downlink message IP version

Coverity:
CID 739637 (#1 of 1): Logically dead code (DEADCODE)
Execution cannot reach this expression ""false"" inside statement
"pudError(false, "Received w...".

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: fix closing fd
Ferry Huberts [Mon, 22 Oct 2012 12:20:16 +0000 (14:20 +0200)]
pud: fix closing fd

Coverity:
CID 739704 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
At (7): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: nmealib: fix invalid format string conversion
Ferry Huberts [Mon, 22 Oct 2012 12:28:45 +0000 (14:28 +0200)]
pud: nmealib: fix invalid format string conversion

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years agopud: nmealib: fix invalid format string conversion
Ferry Huberts [Mon, 22 Oct 2012 12:28:36 +0000 (14:28 +0200)]
pud: nmealib: fix invalid format string conversion

Coverity:
CID 739671 (#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>
7 years agoadd a COVERITY instructions text file
Ferry Huberts [Mon, 22 Oct 2012 12:55:33 +0000 (14:55 +0200)]
add a COVERITY instructions text file

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
7 years ago Close socket if bind() fails.
Henning Rogge [Mon, 22 Oct 2012 13:02:33 +0000 (15:02 +0200)]
Close socket if bind() fails.

    Coverity:

    CID 739685 (#1 of 1): Resource leak (RESOURCE_LEAK)
    At (8): Handle variable "sock" going out of scope leaks the handle.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years ago Protect against stupid data from ACPI
Henning Rogge [Mon, 22 Oct 2012 12:57:56 +0000 (14:57 +0200)]
Protect against stupid data from ACPI

    Coverity:

    CID 739643 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
    At (29): In expression "bat_val * 100 / bat_max", division by expression "bat_max" which may be zero has undefined behavior.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 years ago Convert allocated memory into temporary variable
Henning Rogge [Mon, 22 Oct 2012 12:48:30 +0000 (14:48 +0200)]
Convert allocated memory into temporary variable

    Coverity:

    CID 739683 (#1 of 1): Resource leak (RESOURCE_LEAK)
    At (14): Variable "net_msg" going out of scope leaks the storage it points to.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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

7 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.

7 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>
7 years agoFix slightly insulting error message.
Henning Rogge [Thu, 18 Oct 2012 09:17:04 +0000 (11:17 +0200)]
Fix slightly insulting error message.

7 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