summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlin Nastac2020-10-15 15:12:15 +0000
committerHans Dedecker2020-10-17 19:17:17 +0000
commitf5728e40ff797f692fa80f8dcef257681a978cc7 (patch)
tree2a24815a7bdf3b13c9d64c11fcc5a8cdef84b8f0
parentf575351cbb3defc0bf52680c9082912a6c264374 (diff)
downloadodhcp6c-f5728e40ff797f692fa80f8dcef257681a978cc7.tar.gz
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 <alin.nastac@gmail.com>
-rw-r--r--src/dhcpv6.c4
-rw-r--r--src/odhcp6c.h2
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;