From: Steven Barth Date: Fri, 1 Feb 2013 08:25:32 +0000 (+0100) Subject: Fix segfault X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f0a2d256fc56bf87cfc7588d018fc7dbcf2503ae;p=project%2Fodhcp6c.git Fix segfault --- diff --git a/src/ra.c b/src/ra.c index 2149a66..47a2a8d 100644 --- a/src/ra.c +++ b/src/ra.c @@ -275,7 +275,7 @@ bool ra_process(void) size_t ra_dns_len; struct odhcp6c_entry *entry = odhcp6c_get_state(STATE_RA_DNS, &ra_dns_len); - for (size_t i = 0; i < len / sizeof(*entry); ++i) + for (size_t i = 0; i < ra_dns_len / sizeof(*entry); ++i) if (IN6_ARE_ADDR_EQUAL(&entry[i].router, &from.sin6_addr) && entry[i].valid > router_valid) entry[i].valid = router_valid;