summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2013-10-01 09:54:41 +0100
committerSimon Kelley <simon@thekelleys.org.uk>2013-10-01 09:54:41 +0100
commit2f9fd1dcc52422af41c9b983a82f63ab39ebe59d (patch)
tree1eae2791e779a735fcf11d0b70a43995587c063d
parent8f3194f7ac4590deeaf427fa40aa0f8d53588c05 (diff)
downloaddnsmasq-2f9fd1dcc52422af41c9b983a82f63ab39ebe59d.tar.gz
Fix FTBFS when NO_IPV6 defined.v2.67rc1
-rw-r--r--src/helper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/helper.c b/src/helper.c
index d6bcd63..e979b0d 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -61,6 +61,9 @@ struct script_data
#else
time_t expires;
#endif
+#ifdef HAVE_TFTP
+ off_t file_len;
+#endif
#ifdef HAVE_DHCP6
struct in6_addr addr6;
int iaid, vendorclass_count;
@@ -289,10 +292,12 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
inet_ntop(AF_INET6, &data.addr6, daemon->addrbuff, ADDRSTRLEN);
#endif
+#ifdef HAVE_TFTP
/* file length */
if (data.action == ACTION_TFTP)
- sprintf(is6 ? daemon->packet : daemon->dhcp_buff, "%u", data.iaid);
-
+ sprintf(is6 ? daemon->packet : daemon->dhcp_buff, "%lu", (unsigned long)data.file_len);
+#endif
+
#ifdef HAVE_LUASCRIPT
if (daemon->luascript)
{
@@ -739,7 +744,7 @@ void queue_tftp(off_t file_len, char *filename, union mysockaddr *peer)
buf->action = ACTION_TFTP;
buf->hostname_len = filename_len;
- buf->iaid = file_len;
+ buf->file_len = file_len;
if ((buf->flags = peer->sa.sa_family) == AF_INET)
buf->addr = peer->in.sin_addr;