Skip to content

Commit

Permalink
gnrc: adapt for gnrc_ndp_host
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Aug 31, 2015
1 parent 52f8f96 commit 67c7ca4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion sys/net/gnrc/network_layer/icmpv6/gnrc_icmpv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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");
Expand Down
8 changes: 7 additions & 1 deletion sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,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;
Expand All @@ -194,7 +195,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);
Expand All @@ -205,6 +205,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;
Expand Down
4 changes: 4 additions & 0 deletions sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,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
}
}

Expand Down

0 comments on commit 67c7ca4

Please sign in to comment.