From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH dnsmasq 1/1] purge old ip-mac lease on dhcpreply
Date: Wed, 15 Nov 2023 22:58:43 +0100 [thread overview]
Message-ID: <20231115215843.856752-2-aderumier@odiso.com> (raw)
In-Reply-To: <20231115215843.856752-1-aderumier@odiso.com>
---
src/rfc2131.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/rfc2131.c b/src/rfc2131.c
index 17e97b5..2a4ce76 100644
--- a/src/rfc2131.c
+++ b/src/rfc2131.c
@@ -1095,7 +1095,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
if ((opt = option_find(mess, sz, OPTION_REQUESTED_IP, INADDRSZ)))
addr = option_addr(opt);
-
+
if (have_config(config, CONFIG_ADDR))
{
inet_ntop(AF_INET, &config->addr, daemon->addrbuff, ADDRSTRLEN);
@@ -1104,11 +1104,14 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
ltmp != lease &&
!config_has_mac(config, ltmp->hwaddr, ltmp->hwaddr_len, ltmp->hwaddr_type))
{
- int len;
- unsigned char *mac = extended_hwaddr(ltmp->hwaddr_type, ltmp->hwaddr_len,
- ltmp->hwaddr, ltmp->clid_len, ltmp->clid, &len);
- my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is leased to %s"),
- daemon->addrbuff, print_mac(daemon->namebuff, mac, len));
+ lease_prune(ltmp, now);
+ my_syslog(MS_DHCP | LOG_WARNING, _("workaround - pruning old lease"));
+
+ //int len;
+ //unsigned char *mac = extended_hwaddr(ltmp->hwaddr_type, ltmp->hwaddr_len,
+ // ltmp->hwaddr, ltmp->clid_len, ltmp->clid, &len);
+ //my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is leased to %s"),
+ // daemon->addrbuff, print_mac(daemon->namebuff, mac, len));
}
else
{
--
2.39.2
next prev parent reply other threads:[~2023-11-15 21:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 21:58 [pve-devel] [PATCH dnsmasq 0/1] purge previous ip/mac lease of dhcp reply Alexandre Derumier
2023-11-15 21:58 ` Alexandre Derumier [this message]
2023-11-16 9:43 ` Stefan Hanreich
2023-11-16 13:47 ` DERUMIER, Alexandre
2023-11-17 6:49 ` DERUMIER, Alexandre
2023-11-17 8:55 ` Wolfgang Bumiller
2023-11-17 9:19 ` DERUMIER, Alexandre
2023-11-17 9:42 ` DERUMIER, Alexandre
2023-11-17 10:46 ` DERUMIER, Alexandre
2023-11-17 10:49 ` Stefan Hanreich
2023-11-17 10:52 ` DERUMIER, Alexandre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231115215843.856752-2-aderumier@odiso.com \
--to=aderumier@odiso.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.