From 3f983db20afe2c27eea10459aedcad2f6baf6526 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 13 Dec 2013 18:49:19 +0100 Subject: [PATCH 1/5] make compilation of sc_heap module dependent --- sys/shell/commands/Makefile | 5 ++++- sys/shell/commands/sc_heap.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index 259a61aa2d..83b0a54213 100644 --- a/sys/shell/commands/Makefile +++ b/sys/shell/commands/Makefile @@ -1,4 +1,4 @@ -SRC = shell_commands.c sc_id.c sc_heap.c +SRC = shell_commands.c sc_id.c INCLUDES = -I../../../core/include -I../../include -I../../../drivers/include/ ifneq (,$(findstring cc110x_ng,$(USEMODULE))) @@ -32,6 +32,9 @@ endif ifneq (,$(findstring sht11,$(USEMODULE))) SRC += sc_sht11.c endif +ifneq (,$(findstring lpc_common,$(USEMODULE))) + SRC += sc_heap.c +endif OBJ = $(SRC:%.c=$(BINDIR)%.o) DEP = $(SRC:%.c=$(BINDIR)%.d) diff --git a/sys/shell/commands/sc_heap.c b/sys/shell/commands/sc_heap.c index a7f4fa8531..7cc9f7a9c3 100644 --- a/sys/shell/commands/sc_heap.c +++ b/sys/shell/commands/sc_heap.c @@ -18,8 +18,6 @@ * @note $Id: sc_heap.c 3855 2013-09-05 12:40:11 kasmi $ */ -#ifdef MODULE_LPC_COMMON - extern void heap_stats(void); void _heap_handler(char *unused) @@ -28,5 +26,3 @@ void _heap_handler(char *unused) heap_stats(); } -#endif - From 72586f7a6d82cea66ad14a4213b13f434033a463 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 13 Dec 2013 18:53:48 +0100 Subject: [PATCH 2/5] limit maximum payload size to 255 for nativenet if 6lowpan is used --- cpu/native/include/nativenet.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/native/include/nativenet.h b/cpu/native/include/nativenet.h index 184604002f..e5968f25d2 100644 --- a/cpu/native/include/nativenet.h +++ b/cpu/native/include/nativenet.h @@ -31,7 +31,11 @@ #ifndef NATIVE_MAX_DATA_LENGTH #include "tap.h" +#ifdef MODULE_SIXLOWPAN +#define NATIVE_MAX_DATA_LENGTH (255) +#else #define NATIVE_MAX_DATA_LENGTH (TAP_MAX_DATA) +#endif #else #warning be careful not to exceed (TAP_MAX_DATA) with NATIVE_MAX_DATA_LENGTH #endif /* NATIVE_MAX_DATA_LENGTH */ From 1cadf58ec809d948e6fbeb248e081fe0e5272faf Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 13 Dec 2013 18:56:42 +0100 Subject: [PATCH 3/5] pass border router flag to initialization function --- sys/net/sixlowpan/lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/sixlowpan/lowpan.c b/sys/net/sixlowpan/lowpan.c index 970af94397..1a3b88339e 100644 --- a/sys/net/sixlowpan/lowpan.c +++ b/sys/net/sixlowpan/lowpan.c @@ -1637,7 +1637,7 @@ void init_reas_bufs(lowpan_reas_buf_t *buf) void sixlowpan_lowpan_init(transceiver_type_t trans, uint8_t r_addr, int as_border) { - lowpan_init(trans, r_addr, NULL, 0); + lowpan_init(trans, r_addr, NULL, as_border); } void sixlowpan_lowpan_adhoc_init(transceiver_type_t trans, From 6b7c88ce1b72dc460fe323bdd4590ec4c2a51415 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 13 Dec 2013 19:17:30 +0100 Subject: [PATCH 4/5] fixed signedness and size of some data types in sixlowpan --- sys/net/sixlowpan/bordermultiplex.c | 6 +++--- sys/net/sixlowpan/icmp.c | 6 +++--- sys/net/sixlowpan/icmp.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/net/sixlowpan/bordermultiplex.c b/sys/net/sixlowpan/bordermultiplex.c index 4998530e08..34e76c1b57 100644 --- a/sys/net/sixlowpan/bordermultiplex.c +++ b/sys/net/sixlowpan/bordermultiplex.c @@ -141,7 +141,7 @@ int readpacket(uint8_t *packet_buf, size_t size) break; } - if ((line_buf_ptr - packet_buf) >= size - 1) { + if ((size_t) (line_buf_ptr - packet_buf) >= size - 1) { return -SIXLOWERROR_ARRAYFULL; } @@ -179,8 +179,8 @@ int writepacket(uint8_t *packet_buf, size_t size) { uint8_t *byte_ptr = packet_buf; - while ((byte_ptr - packet_buf) < size) { - if ((byte_ptr - packet_buf) > BORDER_BUFFER_SIZE) { + while ((size_t) (byte_ptr - packet_buf) < size) { + if ((size_t) (byte_ptr - packet_buf) > BORDER_BUFFER_SIZE) { return -1; } diff --git a/sys/net/sixlowpan/icmp.c b/sys/net/sixlowpan/icmp.c index 4062de8719..faaac7fb64 100644 --- a/sys/net/sixlowpan/icmp.c +++ b/sys/net/sixlowpan/icmp.c @@ -381,7 +381,7 @@ void recv_echo_req(void) printf("\n"); printf("id = 0x%04x, seq = %d\n", echo_buf->id, echo_buf->seq); - for (int i = 0; i < data_len; i++) { + for (size_t i = 0; i < data_len; i++) { printf("%02x ", echo_data_buf[i]); if ((i + 1) % 16 || i == data_len - 1) { @@ -408,7 +408,7 @@ void recv_echo_repl(void) printf("\n"); printf("id = 0x%04x, seq = %d\n", echo_buf->id, echo_buf->seq); - for (int i = 0; i < data_len; i++) { + for (size_t i = 0; i < data_len; i++) { printf("%02x ", echo_data_buf[i]); if ((i + 1) % 16 || i == data_len - 1) { @@ -1566,7 +1566,7 @@ void def_rtr_lst_rem(ndp_default_router_list_t *entry) //------------------------------------------------------------------------------ /* prefix list functions */ -int8_t plist_add(ipv6_addr_t *addr, uint8_t size, uint32_t val_ltime, +int plist_add(ipv6_addr_t *addr, uint8_t size, uint32_t val_ltime, uint32_t pref_ltime, uint8_t adv_opt, uint8_t l_a_reserved1) { if (prefix_count == OPT_PI_LIST_LEN) { diff --git a/sys/net/sixlowpan/icmp.h b/sys/net/sixlowpan/icmp.h index 7840704cc0..297b18e060 100644 --- a/sys/net/sixlowpan/icmp.h +++ b/sys/net/sixlowpan/icmp.h @@ -53,7 +53,7 @@ void recv_nbr_adv(void); void recv_nbr_sol(void); void nbr_cache_auto_rem(void); -int8_t plist_add(ipv6_addr_t *addr, uint8_t size, uint32_t val_ltime, +int plist_add(ipv6_addr_t *addr, uint8_t size, uint32_t val_ltime, uint32_t pref_ltime, uint8_t adv_opt, uint8_t l_a_reserved1); ndp_a6br_cache_t *abr_add_context(uint16_t version, ipv6_addr_t *abr_addr, From 02e553a53491842d8543ca1c56ee462991faaa70 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 13 Dec 2013 19:31:47 +0100 Subject: [PATCH 5/5] fixed some warnings --- sys/net/rpl/of_mrhof.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/rpl/of_mrhof.c b/sys/net/rpl/of_mrhof.c index 8c6fec2b74..56771ea288 100644 --- a/sys/net/rpl/of_mrhof.c +++ b/sys/net/rpl/of_mrhof.c @@ -20,6 +20,8 @@ rpl_of_t rpl_of_mrhof = { which_parent, which_dodag, reset, + NULL, + NULL, NULL }; @@ -30,6 +32,7 @@ rpl_of_t *rpl_get_of_mrhof(void) void reset(rpl_dodag_t *dodag) { + (void) dodag; } static uint16_t calc_path_cost(rpl_parent_t *parent) @@ -171,5 +174,6 @@ static rpl_parent_t *which_parent(rpl_parent_t *p1, rpl_parent_t *p2) //Not used yet, as the implementation only makes use of one dodag for now. static rpl_dodag_t *which_dodag(rpl_dodag_t *d1, rpl_dodag_t *d2) { + (void) d2; return d1; }