From c367477d44049ba0343ec52d518f5fd0daba22b2 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 31 Aug 2015 14:31:36 +0200 Subject: [PATCH] gnrc: adapt for gnrc_ndp_host --- sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c | 5 ++++- sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c | 8 +++++++- sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c b/sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c index b09cd9616a..c953baf3ee 100644 --- a/sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c +++ b/sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c @@ -92,9 +92,11 @@ void gnrc_icmpv6_demux(kernel_pid_t iface, gnrc_pktsnip_t *pkt) /* TODO */ break; +#ifdef MODULE_GNRC_NDP case ICMPV6_RTR_ADV: DEBUG("icmpv6: router advertisement received\n"); - /* TODO */ + gnrc_ndp_rtr_adv_handle(iface, pkt, ipv6->data, (ndp_rtr_adv_t *)hdr, + icmpv6->size); break; case ICMPV6_NBR_SOL: @@ -108,6 +110,7 @@ void gnrc_icmpv6_demux(kernel_pid_t iface, gnrc_pktsnip_t *pkt) gnrc_ndp_nbr_adv_handle(iface, pkt, ipv6->data, (ndp_nbr_adv_t *)hdr, icmpv6->size); break; +#endif case ICMPV6_REDIRECT: DEBUG("icmpv6: redirect message received\n"); diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index daa2c66663..02f3368e09 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -190,6 +190,7 @@ static void *_event_loop(void *args) msg_reply(&msg, &reply); break; +#ifdef MODULE_GNRC_NDP case GNRC_NDP_MSG_RTR_TIMEOUT: DEBUG("ipv6: Router timeout received\n"); ((gnrc_ipv6_nc_t *)msg.content.ptr)->flags &= ~GNRC_IPV6_NC_IS_ROUTER; @@ -201,7 +202,6 @@ static void *_event_loop(void *args) (ipv6_addr_t *)msg.content.ptr); break; -#ifdef MODULE_GNRC_NDP case GNRC_NDP_MSG_NBR_SOL_RETRANS: DEBUG("ipv6: Neigbor solicitation retransmission timer event received\n"); gnrc_ndp_retrans_nbr_sol((gnrc_ipv6_nc_t *)msg.content.ptr); @@ -212,6 +212,12 @@ static void *_event_loop(void *args) gnrc_ndp_state_timeout((gnrc_ipv6_nc_t *)msg.content.ptr); break; #endif +#ifdef MODULE_GNRC_NDP_HOST + case GNRC_NDP_MSG_RTR_SOL_RETRANS: + DEBUG("ipv6: Router solicitation retransmission event received\n"); + gnrc_ndp_host_retrans_rtr_sol((gnrc_ipv6_netif_t *)msg.content.ptr); + break; +#endif default: break; diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index 1f21ea1b44..8c8a91084d 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -763,6 +763,10 @@ void gnrc_ipv6_netif_init_by_dev(void) } mutex_unlock(&ipv6_if->mutex); +#ifdef MODULE_GNRC_NDP_HOST + /* start periodic router solicitations */ + gnrc_ndp_host_init(ipv6_if); +#endif } }