I believe this to be the fix:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=1c8855ed10d3923a9a4fd8a89f1c95439d4c8827

>From 1c8855ed10d3923a9a4fd8a89f1c95439d4c8827 Mon Sep 17 00:00:00 2001
From: Simon Kelley <si...@thekelleys.org.uk>
Date: Sun, 26 Dec 2021 16:35:54 +0000
Subject: [PATCH] Fix wrong client address for dhcp-script when DHCPv4 relay in
 use.

---
 src/helper.c | 6 +++---
 1 file 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);
            }
          
-- 
2.20.1


Committed a few months later in the same area. Will try to test it.

If that's really the fix, then only jammy is affected, because the patch is in 
v2.87 and later:
 dnsmasq | 2.80-1.1ubuntu1        | focal           | source
 dnsmasq | 2.80-1.1ubuntu1.7      | focal-security  | source
 dnsmasq | 2.80-1.1ubuntu1.7      | focal-updates   | source
 dnsmasq | 2.86-1.1               | jammy           | source
 dnsmasq | 2.86-1.1ubuntu0.3      | jammy-security  | source
 dnsmasq | 2.86-1.1ubuntu0.4      | jammy-proposed  | source
 dnsmasq | 2.86-1.1ubuntu0.4      | jammy-updates   | source
 dnsmasq | 2.89-1                 | lunar           | source
 dnsmasq | 2.89-1                 | mantic          | source
 dnsmasq | 2.89-1                 | noble           | source

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to dnsmasq in Ubuntu.
https://bugs.launchpad.net/bugs/2042587

Title:
  jammy's version breaks existing dhcp scripts with relay

Status in dnsmasq package in Ubuntu:
  New
Status in dnsmasq source package in Jammy:
  Triaged

Bug description:
  When upgrading from focal to jammy, existing dnsmasq dhcp-scripts
  stopped working in an environment where a DHCP relay is in use.
  Instead of the expected client IP address, the script gets the _relay_
  IP address as an argument. From dnsmasq documentation for --dhcp-
  script:

  > The arguments to the process are "add", "old" or "del", the MAC
  address of the host (or DUID for IPv6) , the IP address, and the
  hostname, if known.

  I believe the change has been inadverently made in upstream commit
  527c3c7d0d3bb4bf5fad699f10cf0d1a45a54692
  
(https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blobdiff;f=src/helper.c;h=02340a01c00031db0cc682c8a4a279cfc1db574e;hp=d81de9622e6d484a264496b2cd3638b4e15e9677;hb=527c3c7d0d3bb4bf5fad699f10cf0d1a45a54692;hpb=fcb4dcaf7cc8a86ac2533b933161b6455f75bf8f)
  as the commit message only speaks about inet_ntoa replacement and not
  the behavioral change it also introduces (previously the relay address
  was only set to the environment variable, now it effectively overrides
  the prevoiusly set client's IP address).

  dnsmasq 2.86-1.1ubuntu0.3 / Ubuntu 22.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/2042587/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to