All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: ell@lists.01.org
Subject: [PATCH 2/8] dhcp-server: Handle DHCPDECLINE for active leases
Date: Fri, 23 Jul 2021 20:23:25 +0200	[thread overview]
Message-ID: <20210723182331.135123-2-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <20210723182331.135123-1-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

RFC2131 Section 3.1 mentions a scenario where the client is supposed to
drop its lease using DHCPDECLINE after sending the DHCPREQUEST and
receiving the DHCPACK meaning that lease is no longer in the offering
state:

"5. The client receives the DHCPACK message with configuration
    parameters.  The client SHOULD perform a final check on the
    parameters [...].  If the client detects that the address is already
    in use (e.g., through the use of ARP), the client MUST send a
    DHCPDECLINE message..."
---
 ell/dhcp-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ell/dhcp-server.c b/ell/dhcp-server.c
index 6415872..9f4703c 100644
--- a/ell/dhcp-server.c
+++ b/ell/dhcp-server.c
@@ -734,7 +734,7 @@ static void listener_event(const void *data, size_t len, void *user_data)
 		SERVER_DEBUG("Received DECLINE");
 
 		if (server_id_opt != server->address || !requested_ip_opt ||
-				!lease || !lease->offering)
+				!lease)
 			break;
 
 		if (requested_ip_opt == lease->address)
-- 
2.30.2

  reply	other threads:[~2021-07-23 18:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 18:23 [PATCH 1/8] dhcp-server: Add "authoritative" mode Andrew Zaborowski
2021-07-23 18:23 ` Andrew Zaborowski [this message]
2021-07-23 18:23 ` [PATCH 3/8] dhcp-server: Respect client's broadcast flag Andrew Zaborowski
2021-07-28 15:47   ` Denis Kenzior
2021-07-28 17:57     ` Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 4/8] dhcp-lease: Check duplicate options in _dhcp_lease_parse_options Andrew Zaborowski
2021-07-28 15:50   ` Denis Kenzior
2021-07-23 18:23 ` [PATCH 5/8] dhcp-server: Look up leases by client identifier option Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 6/8] dhcp-server: Copy client identifier from the client message Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 7/8] dhcp-server: Support RFC4039 Rapid Commit Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 8/8] dhcp: " Andrew Zaborowski
2021-07-28 15:42 ` [PATCH 1/8] dhcp-server: Add "authoritative" mode Denis Kenzior
2021-07-28 17:51   ` Andrew Zaborowski
2021-07-28 18:39     ` Denis Kenzior
2021-07-28 19:29       ` Andrew Zaborowski

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=20210723182331.135123-2-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.com \
    --cc=ell@lists.01.org \
    /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.