[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6_nib: consider all local interfaces when looking for address (#16569)

Martine Lenders notifications at github.com
Fri Jun 18 19:03:18 CEST 2021

@miri64 requested changes on this pull request.

> +        if ((tgt_netif == NULL) ||
+            (tgt_idx = gnrc_netif_ipv6_addr_idx(tgt_netif, tgt)) < 0) {

This seems redundant first you get the interface by the address, then you check if the interface is assigned to that interface. Trying to cover race conditions should not be necessary due to the `gnrc_netif_acquire(netif)` above, so I propose to make the checking of `tgt_idx` an assert after the if failed:

if (tgt_netif == NULL) {
    DEBUG("ndp: tgt not assigned to interface. Abort sending\n");
tgt_idx = gnrc_netif_ipv6_addr_idx(tgt_netif, tgt);
assert(tgt_idx >= 0);

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210618/acafe9a9/attachment.htm>

More information about the notifications mailing list