gnrc_ipv6_nib: 6ln: use interface-specific DR for address registration

With multiple 6LoWPAN interfaces the router for the given interface
—the one the triggering RA came over—should be used to register the
address with.

Co-Authored-By: Benjamin Valentin <benpicco@googlemail.com>
This commit is contained in:
Martine S. Lenders 2020-04-24 17:53:20 +02:00
parent 245c04f368
commit cb8a6c36b0
No known key found for this signature in database
GPG Key ID: CCD317364F63286F
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ static inline bool _is_valid(const gnrc_netif_t *netif, int idx)
void _handle_rereg_address(const ipv6_addr_t *addr) void _handle_rereg_address(const ipv6_addr_t *addr)
{ {
gnrc_netif_t *netif = gnrc_netif_get_by_ipv6_addr(addr); gnrc_netif_t *netif = gnrc_netif_get_by_ipv6_addr(addr);
_nib_dr_entry_t *router = _nib_drl_get_dr(); _nib_dr_entry_t *router = _nib_drl_get(NULL, netif->pid);
const bool router_reachable = (router != NULL) && const bool router_reachable = (router != NULL) &&
_is_reachable(router->next_hop); _is_reachable(router->next_hop);

View File

@ -37,9 +37,9 @@ void _snd_ns(const ipv6_addr_t *tgt, gnrc_netif_t *netif,
gnrc_pktsnip_t *ext_opt = NULL; gnrc_pktsnip_t *ext_opt = NULL;
#ifdef MODULE_GNRC_SIXLOWPAN_ND #ifdef MODULE_GNRC_SIXLOWPAN_ND
_nib_dr_entry_t *dr = _nib_drl_get_dr();
assert(netif != NULL); assert(netif != NULL);
_nib_dr_entry_t *dr = _nib_drl_get(NULL, netif->pid);
/* add ARO based on interface */ /* add ARO based on interface */
if ((src != NULL) && gnrc_netif_is_6ln(netif) && if ((src != NULL) && gnrc_netif_is_6ln(netif) &&
(_nib_onl_get_if(dr->next_hop) == (unsigned)netif->pid) && (_nib_onl_get_if(dr->next_hop) == (unsigned)netif->pid) &&