olsrd.git
3 years agotxtinfo: move a function
Ferry Huberts [Fri, 4 Mar 2016 12:56:52 +0000 (13:56 +0100)]
txtinfo: move a function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: output an error on unknown status codes too
Ferry Huberts [Fri, 4 Mar 2016 12:56:02 +0000 (13:56 +0100)]
txtinfo: output an error on unknown status codes too

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomain: cleanup the gateways earlier on shutdown
Ferry Huberts [Tue, 1 Mar 2016 10:29:37 +0000 (11:29 +0100)]
main: cleanup the gateways earlier on shutdown

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomain: print the received signal name instead of the signal number
Ferry Huberts [Tue, 1 Mar 2016 10:28:50 +0000 (11:28 +0100)]
main: print the received signal name instead of the signal number

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoscheduler: fix olsr_flush_timers to not hang
Ferry Huberts [Tue, 1 Mar 2016 10:39:32 +0000 (11:39 +0100)]
scheduler: fix olsr_flush_timers to not hang

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agocfgparser: remove some unreachable code
Ferry Huberts [Sat, 27 Feb 2016 12:12:43 +0000 (13:12 +0100)]
cfgparser: remove some unreachable code

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomain: ensure all timers are stopped in shutdown
Ferry Huberts [Fri, 26 Feb 2016 23:48:28 +0000 (00:48 +0100)]
main: ensure all timers are stopped in shutdown

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoscheduler: mark timers for removal and only remove them in a cleanup walk
Ferry Huberts [Fri, 26 Feb 2016 23:20:24 +0000 (00:20 +0100)]
scheduler: mark timers for removal and only remove them in a cleanup walk

Fixes crashes in networks with many nodes.

*** olsr.org - pre-0.9.1-git_dd7c5a0-hash_b9729ef932ee0c718b5da79dcf6a5fce ***
 Build date: 2016-02-24 21:02:23 on jenkins
 http://www.olsr.org

/usr/sbin/olsrd               (olsr_segv_handler)          src/main.c:323
/lib/i386-linux-gnu/libc.so.6 (+0x2de78)                   [0xb760ce78]
/usr/sbin/olsrd               (list_remove)                src/common/list.c:105
/usr/sbin/olsrd               (olsr_stop_timer)            src/scheduler.c:874
/usr/sbin/olsrd               (olsr_del_nbr2_list)         src/neighbor_table.c:85
/usr/sbin/olsrd               (olsr_delete_neighbor_table) src/neighbor_table.c:211
/usr/sbin/olsrd               (olsr_delete_link_entry)     src/link_set.c:375
/usr/sbin/olsrd               (olsr_expire_link_entry)     src/link_set.c:495
/usr/sbin/olsrd               (walk_timers)                src/scheduler.c:650
/usr/sbin/olsrd               (olsr_scheduler)             src/scheduler.c:506
/usr/sbin/olsrd               (main)                       src/main.c:705

olsrd crashed, stack trace follows
/usr/sbin/olsrd               (olsr_segv_handler)          src/main.c:323
/lib/i386-linux-gnu/libc.so.6 (+0x2de78)                   [0xb764ce78]
/usr/sbin/olsrd               (list_remove)                src/common/list.c:105
/usr/sbin/olsrd               (olsr_stop_timer)            src/scheduler.c:874
/usr/sbin/olsrd               (olsr_update_gateway_entry)  src/gateway.c:1208
/usr/sbin/olsrd               (olsr_input_hna)             src/hna_set.c:446
/usr/sbin/olsrd               (parse_packet)               src/parser.c:393
/usr/sbin/olsrd               (olsr_input)                 src/parser.c:496
/usr/sbin/olsrd               (poll_sockets)               src/scheduler.c:341
/usr/sbin/olsrd               (olsr_scheduler)             src/scheduler.c:499
/usr/sbin/olsrd               (main)                       src/main.c:705

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoscheduler: fix a typo
Ferry Huberts [Fri, 26 Feb 2016 21:11:01 +0000 (22:11 +0100)]
scheduler: fix a typo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: add new GCC 6 warning flags
Ferry Huberts [Tue, 23 Feb 2016 23:00:12 +0000 (00:00 +0100)]
make: add new GCC 6 warning flags

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoquagga: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:24:19 +0000 (19:24 +0100)]
quagga: fix GCC 6 warnings

src/plugin.c:57:66: error: logical ‘and’ of equal expressions [-Werror=logical-op]
   for (i = 0; i < ARRAYSIZE(zroute_types) && i < ZEBRA_ROUTE_MAX; i++) {
                                                                  ^~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agopud: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:51:50 +0000 (19:51 +0100)]
pud: fix GCC 6 warnings

src/netTools.c: In function ‘getIPv4Address’:
src/netTools.c:96:55: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  return &((struct sockaddr_in *)(void *) &ifr->ifr_addr)->sin_addr;
                                                       ^

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agop2pd: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:49:01 +0000 (19:49 +0100)]
p2pd: fix GCC 6 warnings

src/NetworkInterfaces.c: In function ‘CreateInterface’:
src/NetworkInterfaces.c:247:50: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->intAddr.v4 = ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr;
                                                  ^
src/NetworkInterfaces.c:260:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->broadAddr.v4 = ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr))->sin_addr;
                                                    ^
src/NetworkInterfaces.c: In function ‘CreateNonOlsrNetworkInterfaces’:
src/NetworkInterfaces.c:368:40: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ipAddr.v4 = ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&ifr->ifr_addr))->sin_addr;
                                        ^

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomdns: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:46:20 +0000 (19:46 +0100)]
mdns: fix GCC 6 warnings

src/NetworkInterfaces.c: In function ‘CreateRouterElectionSocket’:
src/NetworkInterfaces.c:288:59: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ipv4_addr = ((struct sockaddr_in *)(void *) &req.ifr_addr)->sin_addr;
                                                           ^
src/NetworkInterfaces.c: In function ‘CreateHelloSocket’:
src/NetworkInterfaces.c:383:59: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ipv4_addr = ((struct sockaddr_in *)(void *) &req.ifr_addr)->sin_addr;
                                                           ^
src/NetworkInterfaces.c: In function ‘CreateInterface’:
src/NetworkInterfaces.c:541:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->intAddr.v4 = ((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr;
                                                 ^
src/NetworkInterfaces.c:554:51: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->broadAddr.v4 = ((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr))->sin_addr;
                                                   ^
src/NetworkInterfaces.c: In function ‘CreateBmfNetworkInterfaces’:
src/NetworkInterfaces.c:662:39: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ipAddr.v4 = ((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr->ifr_addr))->sin_addr;
                                       ^

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agobmf: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:16:12 +0000 (19:16 +0100)]
bmf: fix GCC 6 warnings

src/NetworkInterfaces.c: In function ‘CreateLocalEtherTunTap’:
src/NetworkInterfaces.c:1275:25: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ((struct sockaddr_in*) ARM_NOWARN_ALIGN(&ifreq.ifr_addr))->sin_addr.s_addr = htonl(EtherTunTapIp);
                         ^
src/NetworkInterfaces.c:1280:27: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ((struct sockaddr_in*) ARM_NOWARN_ALIGN(&ifreq.ifr_netmask))->sin_addr.s_addr = htonl(EtherTunTapIpMask);
                           ^
src/NetworkInterfaces.c:1285:29: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ((struct sockaddr_in*) ARM_NOWARN_ALIGN(&ifreq.ifr_broadaddr))->sin_addr.s_addr = htonl(EtherTunTapIpBroadcast);
                             ^
src/NetworkInterfaces.c: In function ‘CreateInterface’:
src/NetworkInterfaces.c:1497:50: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->intAddr.v4 = ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr;
                                                  ^
src/NetworkInterfaces.c:1513:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       newIf->broadAddr.v4 = ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr))->sin_addr;
                                                    ^
src/NetworkInterfaces.c: In function ‘CreateBmfNetworkInterfaces’:
src/NetworkInterfaces.c:1626:40: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ipAddr.v4 =  ((struct sockaddr_in*) ARM_NOWARN_ALIGN(&ifr->ifr_addr))->sin_addr;
                                        ^
src/NetworkInterfaces.c: In function ‘AddMulticastRoute’:
src/NetworkInterfaces.c:1944:12: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&kernel_route.rt_dst))->sin_addr.s_addr = htonl(0xE0000000);
            ^~~~~~~~~~~
src/NetworkInterfaces.c:1945:12: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&kernel_route.rt_genmask))->sin_addr.s_addr = htonl(0xF0000000);
            ^~~~~~~~~~~
src/NetworkInterfaces.c: In function ‘DeleteMulticastRoute’:
src/NetworkInterfaces.c:1989:14: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&kernel_route.rt_dst))->sin_addr.s_addr = htonl(0xE0000000);
              ^~~~~~~~~~~
src/NetworkInterfaces.c:1990:14: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ((struct sockaddr_in *) ARM_NOWARN_ALIGN(&kernel_route.rt_genmask))->sin_addr.s_addr = htonl(0xF0000000);
              ^~~~~~~~~~~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoparser: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:25:31 +0000 (19:25 +0100)]
parser: fix GCC 6 warnings

src/parser.c:450:30: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       void * src = &((struct sockaddr_in *)(void *)&from)->sin_addr;
                              ^~~~~~~~~~~
src/parser.c:454:30: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       void * src = &((struct sockaddr_in6 *)(void *)&from)->sin6_addr;
                              ^~~~~~~~~~~~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agosgw: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 21:48:04 +0000 (22:48 +0100)]
sgw: fix GCC 6 warnings

src/gateway.c: In function ‘takeDownExpensiveGateways’:
src/gateway.c:701:17: error: potential null pointer dereference [-Werror=null-dereference]
     if (worst_gw->gw->path_cost < current_gw_cost_boundary) {
         ~~~~~~~~^~~~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolink_set: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 21:55:18 +0000 (22:55 +0100)]
link_set: fix GCC 6 warnings

src/link_set.c: In function ‘update_link_entry’:
src/link_set.c:335:24: error: potential null pointer dereference [-Werror=null-dereference]
   for (mult = cfg_inter->cnf->lq_mult; mult != NULL; mult = mult->next) {
               ~~~~~~~~~^~~~~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agounix: fix GCC 6 warnings
Ferry Huberts [Tue, 23 Feb 2016 18:36:46 +0000 (19:36 +0100)]
unix: fix GCC 6 warnings

src/unix/ifnet.c:270:109: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         (&((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifp->int_addr))->sin_addr.s_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr.s_addr,
                                                                                                             ^
src/unix/ifnet.c:277:45: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifp->int_addr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr);
                                             ^
src/unix/ifnet.c:278:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       memcpy(&ifp->ip_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr.s_addr, olsr_cnf->ipsize);
                                                    ^
src/unix/ifnet.c:296:112: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         (&((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifp->int_netmask))->sin_addr.s_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask))->sin_addr.s_addr,
                                                                                                                ^
src/unix/ifnet.c:303:48: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifp->int_netmask = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask);
                                                ^
src/unix/ifnet.c:332:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         ifp->int_broadaddr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr);
                                                    ^
src/unix/ifnet.c: In function ‘chk_if_up’:
src/unix/ifnet.c:604:44: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifs.int_addr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr);
                                            ^
src/unix/ifnet.c:612:45: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ifs.int_netmask = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask);
                                             ^
src/unix/ifnet.c:625:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifs.int_broadaddr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr);
                                                 ^

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: sort warnings flags and make that section a bit easier to read
Ferry Huberts [Tue, 23 Feb 2016 22:54:54 +0000 (23:54 +0100)]
make: sort warnings flags and make that section a bit easier to read

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: remove conditionals in WARNINGS section, no longer needed
Ferry Huberts [Tue, 23 Feb 2016 22:55:46 +0000 (23:55 +0100)]
make: remove conditionals in WARNINGS section, no longer needed

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: need to load the OS specific makefile before evaluating WARNINGS
Ferry Huberts [Tue, 23 Feb 2016 22:42:36 +0000 (23:42 +0100)]
make: need to load the OS specific makefile before evaluating WARNINGS

Otherwise the compiler flag detection will not use the correct CC

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: add more recognised formats to the gcc-warnings script
Ferry Huberts [Tue, 23 Feb 2016 22:42:04 +0000 (23:42 +0100)]
make: add more recognised formats to the gcc-warnings script

And fix a typo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agochangelog: update for info/jsoninfo/txtinfo changes
Ferry Huberts [Sun, 21 Feb 2016 17:51:40 +0000 (18:51 +0100)]
changelog: update for info/jsoninfo/txtinfo changes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: /config & /plugins are not implemented: return "not found" (404)
Ferry Huberts [Sun, 21 Feb 2016 17:26:39 +0000 (18:26 +0100)]
txtinfo: /config & /plugins are not implemented: return "not found" (404)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: respond with "no content" (204) on empty output
Ferry Huberts [Sun, 21 Feb 2016 16:20:22 +0000 (17:20 +0100)]
info: respond with "no content" (204) on empty output

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: respond with "not found" (404) on invalid commands
Ferry Huberts [Sun, 21 Feb 2016 15:26:07 +0000 (16:26 +0100)]
info: respond with "not found" (404) on invalid commands

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: add function to the function table to output an error
Ferry Huberts [Sun, 21 Feb 2016 13:28:18 +0000 (14:28 +0100)]
info: add function to the function table to output an error

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: prepare for more HTTP status codes
Ferry Huberts [Sun, 21 Feb 2016 14:05:35 +0000 (15:05 +0100)]
info: prepare for more HTTP status codes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: requesting / now is equivalent to /all
Ferry Huberts [Sun, 21 Feb 2016 14:11:23 +0000 (15:11 +0100)]
info: requesting / now is equivalent to /all

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: rename an HTTP status define
Ferry Huberts [Sun, 21 Feb 2016 14:09:23 +0000 (15:09 +0100)]
info: rename an HTTP status define

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: also handle empty requests
Ferry Huberts [Sun, 21 Feb 2016 14:37:51 +0000 (15:37 +0100)]
info: also handle empty requests

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: requests that are too large must set s to < 0
Ferry Huberts [Sun, 21 Feb 2016 14:41:03 +0000 (15:41 +0100)]
info: requests that are too large must set s to < 0

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: preserve debugging info when NOSTRIP is set
Ferry Huberts [Wed, 24 Feb 2016 18:11:31 +0000 (19:11 +0100)]
make: preserve debugging info when NOSTRIP is set

Facilitates more accurate stack traces

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomain: musl does not support execinfo.h (the backtrace functions)
Ferry Huberts [Wed, 24 Feb 2016 00:07:03 +0000 (01:07 +0100)]
main: musl does not support execinfo.h (the backtrace functions)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agochangelog: update the warning about txtinfo/jsoninfo
Ferry Huberts [Sun, 21 Feb 2016 12:35:46 +0000 (13:35 +0100)]
changelog: update the warning about txtinfo/jsoninfo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify interfaces
Ferry Huberts [Sun, 21 Feb 2016 12:06:19 +0000 (13:06 +0100)]
txtinfo: simplify interfaces

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: add an empty line after the version, like all other tables
Ferry Huberts [Sun, 21 Feb 2016 12:03:51 +0000 (13:03 +0100)]
txtinfo: add an empty line after the version, like all other tables

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify sgw
Ferry Huberts [Sun, 21 Feb 2016 12:02:13 +0000 (13:02 +0100)]
txtinfo: simplify sgw

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify gateways
Ferry Huberts [Sun, 21 Feb 2016 11:49:46 +0000 (12:49 +0100)]
txtinfo: simplify gateways

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: clarify that using /gat and /sgw on non-Linux is an error
Ferry Huberts [Sat, 20 Feb 2016 19:17:13 +0000 (20:17 +0100)]
txtinfo: clarify that using /gat and /sgw on non-Linux is an error

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify and fix printing MIDs
Ferry Huberts [Sun, 21 Feb 2016 11:41:03 +0000 (12:41 +0100)]
txtinfo: simplify and fix printing MIDs

This changes the format when vtime is set to true.
The code for vtime did not account for multiple aliases.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify printing HNAs
Ferry Huberts [Sun, 21 Feb 2016 10:54:02 +0000 (11:54 +0100)]
txtinfo: simplify printing HNAs

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify printing topology
Ferry Huberts [Sun, 21 Feb 2016 10:46:39 +0000 (11:46 +0100)]
txtinfo: simplify printing topology

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: avoid a potential null deref in routes
Ferry Huberts [Sat, 20 Feb 2016 10:58:31 +0000 (11:58 +0100)]
txtinfo: avoid a potential null deref in routes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify printing routes
Ferry Huberts [Sun, 21 Feb 2016 10:40:30 +0000 (11:40 +0100)]
txtinfo: simplify printing routes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: avoid a potential null deref in links
Ferry Huberts [Sat, 20 Feb 2016 10:55:24 +0000 (11:55 +0100)]
txtinfo: avoid a potential null deref in links

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify printing links
Ferry Huberts [Sun, 21 Feb 2016 10:38:10 +0000 (11:38 +0100)]
txtinfo: simplify printing links

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: avoid a potential null deref in 2-hop
Ferry Huberts [Sat, 20 Feb 2016 10:54:56 +0000 (11:54 +0100)]
txtinfo: avoid a potential null deref in 2-hop

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxinfo: fix 2-hop output
Ferry Huberts [Sun, 21 Feb 2016 10:21:17 +0000 (11:21 +0100)]
txinfo: fix 2-hop output

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: simplify isCommand function
Ferry Huberts [Sat, 20 Feb 2016 08:40:18 +0000 (09:40 +0100)]
txtinfo: simplify isCommand function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: minor fixes to the README
Ferry Huberts [Sat, 20 Feb 2016 08:31:27 +0000 (09:31 +0100)]
txtinfo: minor fixes to the README

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: be a bit more explicit in determine_mime_type
Ferry Huberts [Sat, 20 Feb 2016 09:01:46 +0000 (10:01 +0100)]
jsoninfo: be a bit more explicit in determine_mime_type

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: minor improvements
Ferry Huberts [Sat, 20 Feb 2016 09:01:14 +0000 (10:01 +0100)]
jsoninfo: minor improvements

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo / sgw: isGwSelectable function is common, use it as such
Ferry Huberts [Sat, 20 Feb 2016 08:51:54 +0000 (09:51 +0100)]
jsoninfo / sgw: isGwSelectable function is common, use it as such

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: simplify isCommand function
Ferry Huberts [Sat, 20 Feb 2016 08:41:56 +0000 (09:41 +0100)]
jsoninfo: simplify isCommand function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: simplify send_info function
Ferry Huberts [Sat, 20 Feb 2016 21:36:13 +0000 (22:36 +0100)]
info: simplify send_info function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: introduce and use ARRAY_SIZE define
Ferry Huberts [Sat, 20 Feb 2016 21:35:56 +0000 (22:35 +0100)]
info: introduce and use ARRAY_SIZE define

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: do not send buffers of zero length, wget can't handle that
Ferry Huberts [Sat, 20 Feb 2016 20:47:13 +0000 (21:47 +0100)]
info: do not send buffers of zero length, wget can't handle that

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: fix send result error check in write_data
Ferry Huberts [Sat, 20 Feb 2016 20:48:54 +0000 (21:48 +0100)]
info: fix send result error check in write_data

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: minor update to the README
Ferry Huberts [Sat, 20 Feb 2016 08:31:14 +0000 (09:31 +0100)]
info: minor update to the README

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: extract printing a gateway to a function
Ferry Huberts [Fri, 19 Feb 2016 16:36:03 +0000 (17:36 +0100)]
jsoninfo: extract printing a gateway to a function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: review /links and show more information
Ferry Huberts [Fri, 19 Feb 2016 15:37:15 +0000 (16:37 +0100)]
jsoninfo: review /links and show more information

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: also show local HNAs, like txtinfo does
Ferry Huberts [Fri, 19 Feb 2016 15:03:10 +0000 (16:03 +0100)]
jsoninfo: also show local HNAs, like txtinfo does

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: also show the hops for /sgw, like for /gateways
Ferry Huberts [Fri, 19 Feb 2016 13:09:43 +0000 (14:09 +0100)]
jsoninfo: also show the hops for /sgw, like for /gateways

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: protect against a possible null-deref in ipc_print_neighbors
Ferry Huberts [Fri, 19 Feb 2016 12:32:43 +0000 (13:32 +0100)]
jsoninfo: protect against a possible null-deref in ipc_print_neighbors

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: protect abuf_json_ip_address against a NULL IP address
Ferry Huberts [Fri, 19 Feb 2016 12:25:23 +0000 (13:25 +0100)]
jsoninfo: protect abuf_json_ip_address against a NULL IP address

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: add forgotten 2hop in function table
Ferry Huberts [Fri, 19 Feb 2016 13:55:34 +0000 (14:55 +0100)]
jsoninfo: add forgotten 2hop  in function table

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: add forgotten 2hop in function table
Ferry Huberts [Fri, 19 Feb 2016 13:55:24 +0000 (14:55 +0100)]
txtinfo: add forgotten 2hop  in function table

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: review /hna
Ferry Huberts [Fri, 19 Feb 2016 13:02:10 +0000 (14:02 +0100)]
txtinfo: review /hna

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: review /nei and /2ho
Ferry Huberts [Fri, 19 Feb 2016 13:01:58 +0000 (14:01 +0100)]
txtinfo: review /nei and /2ho

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: review /lin
Ferry Huberts [Fri, 19 Feb 2016 12:48:48 +0000 (13:48 +0100)]
txtinfo: review /lin

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agopud: nmealib: be less strict about satellite elevation
Ferry Huberts [Fri, 19 Feb 2016 16:49:53 +0000 (17:49 +0100)]
pud: nmealib: be less strict about satellite elevation

Sometimes satellites are seen with elevation -91

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoifnet: ensure string termination
Ferry Huberts [Wed, 17 Feb 2016 17:58:44 +0000 (18:58 +0100)]
ifnet: ensure string termination

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoFix 2 Coverity warnings
Ferry Huberts [Wed, 17 Feb 2016 12:53:09 +0000 (13:53 +0100)]
Fix 2 Coverity warnings

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoall: use the getInterfaceLinkState function
Ferry Huberts [Wed, 10 Feb 2016 13:19:01 +0000 (14:19 +0100)]
all: use the getInterfaceLinkState function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoifnet: add getInterfaceLinkState function
Ferry Huberts [Wed, 10 Feb 2016 13:17:59 +0000 (14:17 +0100)]
ifnet: add getInterfaceLinkState function

This Linux-only function queries a network interface to see if it has a
carrier (cable (dis)connected, medium up/down, etc).

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: simplify an if/else
Ferry Huberts [Wed, 10 Feb 2016 12:49:34 +0000 (13:49 +0100)]
linux: netlink_process_link: simplify an if/else

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: compute up status only once
Ferry Huberts [Wed, 10 Feb 2016 12:48:41 +0000 (13:48 +0100)]
linux: netlink_process_link: compute up status only once

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: simplify a comparison
Ferry Huberts [Wed, 10 Feb 2016 12:22:26 +0000 (13:22 +0100)]
linux: netlink_process_link: simplify a comparison

To make it easier to read

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: always determine the oif
Ferry Huberts [Wed, 10 Feb 2016 09:47:57 +0000 (10:47 +0100)]
linux: netlink_process_link: always determine the oif

This simplifies it a bit more.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: always determine the interface name
Ferry Huberts [Wed, 10 Feb 2016 09:45:58 +0000 (10:45 +0100)]
linux: netlink_process_link: always determine the interface name

This simplifies it a bit more.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agolinux: netlink_process_link: simplify NULL comparisons and add some braces
Ferry Huberts [Wed, 10 Feb 2016 09:38:46 +0000 (10:38 +0100)]
linux: netlink_process_link: simplify NULL comparisons and add some braces

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoifnet: remove unused function set_flag
Ferry Huberts [Wed, 10 Feb 2016 10:23:08 +0000 (11:23 +0100)]
ifnet: remove unused function set_flag

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoAdd a safety net in the segfault handler
Ferry Huberts [Sun, 7 Feb 2016 21:09:27 +0000 (22:09 +0100)]
Add a safety net in the segfault handler

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomain: add & enable a new SEGV handler (Linux only)
Ferry Huberts [Sun, 7 Feb 2016 11:27:26 +0000 (12:27 +0100)]
main: add & enable a new SEGV handler (Linux only)

It outputs the stack trace to syslog and then tries to
clean up through olsr_shutdown.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: fix processing of command per HTTP request
Ferry Huberts [Thu, 4 Feb 2016 10:00:20 +0000 (11:00 +0100)]
info: fix processing of command per HTTP request

Reported-by: Bastian Bittorf <bittorf@bluebottle.com>
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: do not try to interpret the request when it is too large
Ferry Huberts [Thu, 4 Feb 2016 09:48:33 +0000 (10:48 +0100)]
info: do not try to interpret the request when it is too large

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agocookie: split assert to see which part actually triggers the assert
Ferry Huberts [Sat, 30 Jan 2016 07:54:42 +0000 (08:54 +0100)]
cookie: split assert to see which part actually triggers the assert

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoCHANGELOG: add a note about txtinfo and jsoninfo being merged
Ferry Huberts [Wed, 27 Jan 2016 14:33:10 +0000 (15:33 +0100)]
CHANGELOG: add a note about txtinfo and jsoninfo being merged

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoinfo: strip EOLs from the command
Ferry Huberts [Tue, 5 Jan 2016 10:35:48 +0000 (11:35 +0100)]
info: strip EOLs from the command

After commits dc2719d and 20ed604 this is needed

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: review of /hna
Ferry Huberts [Mon, 4 Jan 2016 10:32:27 +0000 (11:32 +0100)]
txtinfo: review of /hna

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: review of /hna
Ferry Huberts [Mon, 4 Jan 2016 10:32:14 +0000 (11:32 +0100)]
jsoninfo: review of /hna

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agojsoninfo: use strcmp instead of strstr
Ferry Huberts [Mon, 4 Jan 2016 07:30:58 +0000 (08:30 +0100)]
jsoninfo: use strcmp instead of strstr

To avoid matching on substrings

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agotxtinfo: use strcmp instead of strstr
Ferry Huberts [Mon, 4 Jan 2016 07:30:52 +0000 (08:30 +0100)]
txtinfo: use strcmp instead of strstr

To avoid matching on substrings

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agoModify .gitignore file to keep full default example
Henning Rogge [Wed, 9 Dec 2015 10:54:52 +0000 (11:54 +0100)]
Modify .gitignore file to keep full default example

3 years agoMerge branch 'master' of git://olsr.org/olsrd
Henning Rogge [Wed, 9 Dec 2015 10:54:02 +0000 (11:54 +0100)]
Merge branch 'master' of git://olsr.org/olsrd

3 years agoConfiguration file cleanup
Henning Rogge [Wed, 9 Dec 2015 10:51:49 +0000 (11:51 +0100)]
Configuration file cleanup

Rename "full" config file (its not full anymore, its default only)
Add txtinfo to default configuration examples
Add some more explanation to README

3 years agoall: fixes resulting from building with clang
Ferry Huberts [Wed, 9 Dec 2015 09:02:27 +0000 (10:02 +0100)]
all: fixes resulting from building with clang

Used clang 3.7.0-1 on Fedora 23

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
3 years agomake: support building with clang (on Linux)
Ferry Huberts [Wed, 9 Dec 2015 09:32:03 +0000 (10:32 +0100)]
make: support building with clang (on Linux)

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