]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/dhcp/dhcp-stateless-DUID-LLT.patch
Merge remote-tracking branch 'origin/master' into next
[people/pmueller/ipfire-2.x.git] / src / patches / dhcp / dhcp-stateless-DUID-LLT.patch
1 From 61fa3dd9e789997f66e848c7e3fb2f554ee374e2 Mon Sep 17 00:00:00 2001
2 From: Jiri Popelka <jpopelka@redhat.com>
3 Date: Thu, 18 Dec 2014 11:53:26 +0100
4 Subject: [PATCH] Write DUID_LLT even in stateless mode.
5
6 By default, DHCPv6 dhclient creates DUID-LL
7 if it is running in stateless mode (-6 -S) and
8 doesn't write it into leases file, most likely
9 because the DUID-LL is always generated the same.
10
11 It's however possible to specify DUID to be of type LLT instead of LL
12 with '-D LLT'. Rfc 3315 says that:
13 'Clients and servers using this type of DUID MUST
14 store the DUID-LLT in stable storage.'
15 That's not fulfiled in this case (-6 -S -D LLT),
16 because it's generated each time again.
17
18 It's not a big deal because the server doesn't store any
19 info about 'stateless' clients, so it doesn't matter
20 that the DUID-LLT is different each time.
21 But there's a TAHI test which tests this, i.e. that
22 DUID-LLT is still the same even in stateless mode.
23 It's a test DHCP_CONF.7.1.9, part B.
24 https://www.ipv6ready.org/docs/Phase2_DHCPv6_Conformance_Latest.pdf
25
26 Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
27 ---
28 client/dhclient.c | 4 +++-
29 1 file changed, 3 insertions(+), 1 deletion(-)
30
31 diff --git a/client/dhclient.c b/client/dhclient.c
32 index 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 --
47 2.1.0
48