Fixed code passing tags to helper to work when there are no context tags.

Fixed call to sendto() in dhcp6.c. How did it every work before?
This commit is contained in:
Simon Kelley authored and Simon Kelley committed 2012-02-18 21:23:16 +00:00
1 parent e44ddcac63
commit 87b8ecb13a
2 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -222,7 +222,7 @@ void dhcp6_packet(time_t now)
lease_update_dns();
if (sz != 0)
while (sendto(daemon->dhcp6fd, daemon->outpacket.iov_base, sz, 0, (struct sockaddr *)&from, sizeof(from)) &&
while (sendto(daemon->dhcp6fd, daemon->outpacket.iov_base, sz, 0, (struct sockaddr *)&from, sizeof(from)) == -1 &&
retry_send());
}
+6 -3
View File
@@ -682,14 +682,17 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
lease_add_extradata(lease, NULL, 0, 0);
else
{
struct dhcp_netid *n, *l;
struct dhcp_netid *n, *l, *tmp = tags;
/* link temporarily */
for (n = context_tags; n && n->next; n = n->next);
if ((l = n))
l->next = tags;
{
l->next = tags;
tmp = context_tags;
}
for (n = run_tag_if(context_tags); n; n = n->next)
for (n = run_tag_if(tmp); n; n = n->next)
{
struct dhcp_netid *n1;
/* kill dupes */