From f5728e40ff797f692fa80f8dcef257681a978cc7 Mon Sep 17 00:00:00 2001 From: Alin Nastac Date: Thu, 15 Oct 2020 17:12:15 +0200 Subject: [PATCH] odhcp6c_find_entry: exclude priority from the list of fields that must match Priority of an entry can vary from one RA to another, but the entry identity should be the same regardless of the priority declared in the RA message handled in ra_process() at a time. CDRouter for instance tests compliance of the device to requirement G-5 of RFC 7084 by provisioning initially the CPE with a valid default route that has a medium preference after which it sends a low preference RA with lifetime 0 to check that CPE will start sending RAs with lifetime 0 on the LAN side. Because odhcp6c didn't matched the low precedence default router entry with the odhcp6c_entry that was previously stored with medium precedence, it will fail to remove the existing STATE_RA_ROUTE default route, hence preventing odhcpd from advertising RAs with lifetime 0 to LAN. Signed-off-by: Alin Nastac --- src/dhcpv6.c | 4 ++-- src/odhcp6c.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index bd8a2dc..858cd5e 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -1229,8 +1229,8 @@ static unsigned int dhcpv6_parse_ia(void *opt, void *end) // Update address IA dhcpv6_for_each_option(&ia_hdr[1], end, otype, olen, odata) { - struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, 0, - IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0}; + struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, + IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0, 0}; entry.iaid = ia_hdr->iaid; diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 40ce098..14d0017 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -348,8 +348,8 @@ struct odhcp6c_entry { struct in6_addr router; uint8_t auxlen; uint8_t length; - int16_t priority; struct in6_addr target; + int16_t priority; uint32_t valid; uint32_t preferred; uint32_t t1; -- 2.30.2