]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/dhcp/dhcp-stateless-DUID-LLT.patch
aarch64: Fix rootfile for Python
[people/pmueller/ipfire-2.x.git] / src / patches / dhcp / dhcp-stateless-DUID-LLT.patch
CommitLineData
c1e9ba67
MF
1From 61fa3dd9e789997f66e848c7e3fb2f554ee374e2 Mon Sep 17 00:00:00 2001
2From: Jiri Popelka <jpopelka@redhat.com>
3Date: Thu, 18 Dec 2014 11:53:26 +0100
4Subject: [PATCH] Write DUID_LLT even in stateless mode.
5
6By default, DHCPv6 dhclient creates DUID-LL
7if it is running in stateless mode (-6 -S) and
8doesn't write it into leases file, most likely
9because the DUID-LL is always generated the same.
10
11It's however possible to specify DUID to be of type LLT instead of LL
12with '-D LLT'. Rfc 3315 says that:
13'Clients and servers using this type of DUID MUST
14store the DUID-LLT in stable storage.'
15That's not fulfiled in this case (-6 -S -D LLT),
16because it's generated each time again.
17
18It's not a big deal because the server doesn't store any
19info about 'stateless' clients, so it doesn't matter
20that the DUID-LLT is different each time.
21But there's a TAHI test which tests this, i.e. that
22DUID-LLT is still the same even in stateless mode.
23It's a test DHCP_CONF.7.1.9, part B.
24https://www.ipv6ready.org/docs/Phase2_DHCPv6_Conformance_Latest.pdf
25
26Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
27---
28 client/dhclient.c | 4 +++-
29 1 file changed, 3 insertions(+), 1 deletion(-)
30
31diff --git a/client/dhclient.c b/client/dhclient.c
32index 5ef59cd..026e3fe 100644
33--- a/client/dhclient.c
34+++ b/client/dhclient.c
35@@ -788,7 +788,9 @@ void run_stateless(int exit_mode)
36 if (default_duid.buffer != NULL)
37 data_string_forget(&default_duid, MDL);
38
39- form_duid(&default_duid, MDL);
40+ if (form_duid(&default_duid, MDL) == ISC_R_SUCCESS &&
41+ duid_type == DUID_LLT)
42+ write_duid(&default_duid);
43 }
44
45 /* Start a configuration state machine. */
46--
472.1.0
48