aboutgitcodebugslistschat
path: root/dhcpv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6.c')
-rw-r--r--dhcpv6.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dhcpv6.c b/dhcpv6.c
index e4df0db..97c04e2 100644
--- a/dhcpv6.c
+++ b/dhcpv6.c
@@ -320,7 +320,7 @@ static bool dhcpv6_opt(struct iov_tail *data, uint16_t type)
static bool dhcpv6_ia_notonlink(struct iov_tail *data,
struct in6_addr *la)
{
- int ia_types[2] = { OPT_IA_NA, OPT_IA_TA }, *ia_type;
+ int ia_types[2] = { OPT_IA_NA, OPT_IA_TA };
struct opt_ia_addr opt_addr_storage;
const struct opt_ia_addr *opt_addr;
struct iov_tail current, ia_base;
@@ -330,6 +330,7 @@ static bool dhcpv6_ia_notonlink(struct iov_tail *data,
struct in6_addr req_addr;
struct opt_hdr h_storage;
const struct opt_hdr *h;
+ const int *ia_type;
foreach(ia_type, ia_types) {
current = *data;
@@ -425,7 +426,9 @@ static size_t dhcpv6_dns_fill(const struct ctx *c, char *buf, int offset)
if (c->no_dhcp_dns)
goto search;
- for (i = 0; !IN6_IS_ADDR_UNSPECIFIED(&c->ip6.dns[i]); i++) {
+ for (i = 0; i < ARRAY_SIZE(c->ip6.dns); i++) {
+ if (IN6_IS_ADDR_UNSPECIFIED(&c->ip6.dns[i]))
+ break;
if (!i) {
srv = (struct opt_dns_servers *)(buf + offset);
offset += sizeof(struct opt_hdr);