Skip to content

Commit

Permalink
fixup! gnrc_ndp_host: initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Sep 2, 2015
1 parent 8878f4d commit 14df47e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions sys/include/net/gnrc/ipv6/netif.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ extern "C" {
*/
#define GNRC_IPV6_NETIF_FLAGS_IS_WIRED (0x2000)

/**
* @brief Offset of the router advertisement flags compared to the position in router
* advertisements.
*/
#define GNRC_IPV6_NETIF_FLAGS_RTR_ADV_POS (8U)

/**
* @brief Mask for flags intended for router advertisements.
* @note Please expand if more router advertisement flags are introduced.
*/
#define GNRC_IPV6_NETIF_FLAGS_RTR_ADV_MASK (0xc000)

/**
* @brief Flag to indicate that the interface has other address
* configuration.
Expand Down
5 changes: 3 additions & 2 deletions sys/net/gnrc/network_layer/ndp/gnrc_ndp.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ void gnrc_ndp_rtr_adv_handle(kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t
if_entry->cur_hl = rtr_adv->cur_hl;
}
/* set flags from message */
if_entry->flags &= 0x3f;
if_entry->flags |= (rtr_adv->flags & (0xc0));
if_entry->flags &= ~GNRC_IPV6_NETIF_FLAGS_RTR_ADV_MASK;
if_entry->flags |= ((rtr_adv->flags << GNRC_IPV6_NETIF_FLAGS_RTR_ADV_POS) &
(GNRC_IPV6_NETIF_FLAGS_RTR_ADV_MASK));
/* set reachable time from message if it is not the same as the random base
* value */
if ((rtr_adv->reach_time.u32 != 0) &&
Expand Down

0 comments on commit 14df47e

Please sign in to comment.