summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2021-12-26 16:35:54 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2021-12-26 16:35:54 +0000
commit1c8855ed10d3923a9a4fd8a89f1c95439d4c8827 (patch)
tree6e5c89e2a28894ea6f8f138739e116cdf199cff7
parentea33a0130366d316f01be4c891e4f5b247f97171 (diff)
downloaddnsmasq-1c8855ed10d3923a9a4fd8a89f1c95439d4c8827.tar.gz
Fix wrong client address for dhcp-script when DHCPv4 relay in use.
-rw-r--r--src/helper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helper.c b/src/helper.c
index 02340a0..455a68c 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -432,8 +432,8 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
buf = grab_extradata_lua(buf, end, "relay_address");
else if (data.giaddr.s_addr != 0)
{
- inet_ntop(AF_INET, &data.giaddr, daemon->addrbuff, ADDRSTRLEN);
- lua_pushstring(lua, daemon->addrbuff);
+ inet_ntop(AF_INET, &data.giaddr, daemon->dhcp_buff2, ADDRSTRLEN);
+ lua_pushstring(lua, daemon->dhcp_buff2);
lua_setfield(lua, -2, "relay_address");
}
@@ -615,7 +615,7 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
{
const char *giaddr = NULL;
if (data.giaddr.s_addr != 0)
- giaddr = inet_ntop(AF_INET, &data.giaddr, daemon->addrbuff, ADDRSTRLEN);
+ giaddr = inet_ntop(AF_INET, &data.giaddr, daemon->dhcp_buff2, ADDRSTRLEN);
my_setenv("DNSMASQ_RELAY_ADDRESS", giaddr, &err);
}