summaryrefslogtreecommitdiff
path: root/common/tree.c
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2008-08-29 17:48:57 +0000
committerDavid Hankins <dhankins@isc.org>2008-08-29 17:48:57 +0000
commitecddae64a2e3b052c678427f708c949775dfc094 (patch)
treedf3295cbc3e27b3bf9a885df3273b9e665234a9d /common/tree.c
parentdd484ced0d8dc703a864008c3daafaeca6587d72 (diff)
downloadisc-dhcp-ecddae64a2e3b052c678427f708c949775dfc094.tar.gz
- The v6 BSD socket method was updated to use a single UDP BSD socket
no matter how many interfaces are involved, differentiating the interfaces the packets were received on by the interface index supplied by the OS. - The relay agent no longer listens to the All DHCP Servers Multicast address. - A bug was fixed in data_string_sprintfa() where va_start was only called once for two invocations of vsprintf() variants. [ISC-Bugs #17610b]
Diffstat (limited to 'common/tree.c')
-rw-r--r--common/tree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/tree.c b/common/tree.c
index aa5903af..5244a196 100644
--- a/common/tree.c
+++ b/common/tree.c
@@ -99,6 +99,7 @@ data_string_sprintfa(struct data_string *ds, const char *fmt, ...) {
*/
va_start(args, fmt);
vsnprintf_ret = vsnprintf((char *)ds->data+cur_strlen, max, fmt, args);
+ va_end(args);
/* INSIST(vsnprintf_ret >= 0); */
/*
@@ -127,7 +128,11 @@ data_string_sprintfa(struct data_string *ds, const char *fmt, ...) {
return 0;
}
memcpy(tmp_buffer->data, ds->data, cur_strlen);
+
+ /* Rerun the vsprintf. */
+ va_start(args, fmt);
vsprintf((char *)tmp_buffer->data + cur_strlen, fmt, args);
+ va_end(args);
/*
* Replace our old buffer with the new buffer.
@@ -138,7 +143,6 @@ data_string_sprintfa(struct data_string *ds, const char *fmt, ...) {
ds->data = ds->buffer->data;
ds->len = new_len;
}
- va_end(args);
return 1;
}