Avoid redundant deduplication
authorSteven Barth <steven@midlink.org>
Fri, 1 Feb 2013 11:38:16 +0000 (12:38 +0100)
committerSteven Barth <steven@midlink.org>
Fri, 1 Feb 2013 11:38:16 +0000 (12:38 +0100)
src/ra.c

index e32670ecbba0124b8629d6205df36fb07149ea93..b249288279955446ecf59e061a4015b0314b3302 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -125,7 +125,7 @@ static bool ra_deduplicate(const struct in6_addr *any, uint8_t length)
 {
        struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, length, 0, *any, 0, 0};
        struct odhcp6c_entry *x = odhcp6c_find_entry(STATE_RA_PREFIX, &entry);
-       if (x) {
+       if (x && IN6_ARE_ADDR_EQUAL(&x->target, any)) {
                odhcp6c_random(&x->target.s6_addr32[2], 2 * sizeof(uint32_t));
        } else if (odhcp6c_find_entry(STATE_IA_NA, &entry)) {
                dhcpv6_request(DHCPV6_MSG_DECLINE);