File: 2870767a79537b5d6918e7de80358b406fea0898.patch

package info (click to toggle)
dhcpcd 1%3A10.1.0-11
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,384 kB
  • sloc: ansic: 39,221; sh: 2,353; makefile: 376
file content (47 lines) | stat: -rw-r--r-- 1,504 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 2870767a79537b5d6918e7de80358b406fea0898 Mon Sep 17 00:00:00 2001
From: Scott Shambarger <github@shambarger.net>
Date: Tue, 8 Oct 2024 06:26:04 -0700
Subject: [PATCH] dhcp6: start request when advertise received after IRT (#376)
Forwarded: not-needed

After the initial solicit timeout, any received advertisements trigger
a request.  However, after the timeout, any advertisements will
never result in a request, and the client sends solicits forever.

This patch adds sends a request in response to an advertise if the
initial timeout has expired.

Cleanup: removes a check for an impossible state.
---
 src/dhcp6.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/dhcp6.c b/src/dhcp6.c
index ee24b233..9c875a1a 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -3585,8 +3585,6 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
 	if (r->type == DHCP6_ADVERTISE) {
 		struct ipv6_addr *ia;
 
-		if (state->state == DH6S_REQUEST) /* rapid commit */
-			goto bind;
 		TAILQ_FOREACH(ia, &state->addrs, next) {
 			if (!(ia->flags & (IPV6_AF_STALE | IPV6_AF_REQUEST)))
 				break;
@@ -3599,11 +3597,14 @@ dhcp6_recvif(struct interface *ifp, const char *sfrom,
 		else
 			loginfox("%s: ADV %s from %s",
 			    ifp->name, ia->saddr, sfrom);
+		if (state->RTC > 1) {
+                        // IRT already elapsed, initiate request
+			dhcp6_startrequest(ifp);
+		}
 		// We will request when the IRT elapses
 		return;
 	}
 
-bind:
 	dhcp6_bind(ifp, op, sfrom);
 }