[riot-notifications] [RIOT-OS/RIOT] sys/net/dhcpv6: Add IA_NA support to the DHCPv6 client (#16228)

Martine Lenders notifications at github.com
Wed Aug 11 08:37:30 CEST 2021


@miri64 commented on this pull request.



> +
+def check_ia_pd_addr(ia_pd_addr, global_pfx):
+    """Check if the expected IA_PD address has been assigned"""
+    return ia_pd_addr.startswith(global_pfx)
+
+
+def check_global_addrs(ia_na_addr, ia_pd_addr, global_pfx):
+    """Perform IA_NA check for the first and IA_PD for the second address"""
+    return check_ia_na_addr(ia_na_addr) and check_ia_pd_addr(ia_pd_addr, global_pfx)
+
+
+def test_global_addrs(global_addr_1, global_addr_2, global_pfx):
+    """Assert that one global address is the IA_NA and the other one is the IA_PD address"""
+    result_1 = check_global_addrs(global_addr_1, global_addr_2, global_pfx)
+    result_2 = check_global_addrs(global_addr_2, global_addr_1, global_pfx)
+    assert result_1 != result_2

> Oh, I see, we might have two different approaches to this. Currently, I am checking if either
> 
>     * the first address has been assigned by IA_NA and the second one by IA_PD or
> 
>     * the first address has been assigned by IA_PD and the second one by IA_NA.

Then I don't understand this:



> In the case with the dictionary (and I guess similarly in the case of the list) this would result in
> 
> ```python
> assert {"ia_na_check": True, "ia_pd_check": False} != {"ia_na_check": False, "ia_pd_check": False}
> ```

Shouldn't the second dictionary be `{"ia_na_check": False, "ia_pd_check": True}` in that case?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16228#discussion_r686539372
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210810/5cf94a04/attachment.htm>


More information about the notifications mailing list