[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: DHCPv6 renew message
From: Uwe Glaeser <uwe.glaeser () dormakaba ! com>
Date: 2020-07-31 6:48:28
Message-ID: DB6PR0301MB22151079D32F1CC429899E71EB4E0 () DB6PR0301MB2215 ! eurprd03 ! prod ! outlook ! com
[Download RAW message or body]
Hi,
Subject: DHCPv6 renew in /networking/udhcp/d6_dhcpc.c
as stated in the RFC3315-comment of the function send_d6_renew() the message type \
should be set to D6_MSG_RENEW and not DHCPREQUEST (which is an IPv4 value). Or is \
there a reason for the DHCPREQUEST ?
/* Unicast or broadcast a DHCP renew message
*
* RFC 3315 18.1.3. Creation and Transmission of Renew Messages
*
* To extend the valid and preferred lifetimes for the addresses
* associated with an IA, the client sends a Renew message to the server
* from which the client obtained the addresses in the IA containing an
* IA option for the IA. The client includes IA Address options in the
* IA option for the addresses associated with the IA. The server
* determines new lifetimes for the addresses in the IA according to the
* administrative configuration of the server. The server may also add
* new addresses to the IA. The server may remove addresses from the IA
* by setting the preferred and valid lifetimes of those addresses to
* zero.
*
* The server controls the time at which the client contacts the server
* to extend the lifetimes on assigned addresses through the T1 and T2
* parameters assigned to an IA.
*
* At time T1 for an IA, the client initiates a Renew/Reply message
* exchange to extend the lifetimes on any addresses in the IA. The
* client includes an IA option with all addresses currently assigned to
* the IA in its Renew message.
*
* If T1 or T2 is set to 0 by the server (for an IA_NA) or there are no
* T1 or T2 times (for an IA_TA), the client may send a Renew or Rebind
* message, respectively, at the client's discretion.
*
* The client sets the "msg-type" field to RENEW. The client generates
* a transaction ID and inserts this value in the "transaction-id"
* field.
*
* The client places the identifier of the destination server in a
* Server Identifier option.
*
* The client MUST include a Client Identifier option to identify itself
* to the server. The client adds any appropriate options, including
* one or more IA options. The client MUST include the list of
* addresses the client currently has associated with the IAs in the
* Renew message.
*
* The client MUST include an Option Request option (see section 22.7)
* to indicate the options the client is interested in receiving. The
* client MAY include options with data values as hints to the server
* about parameter values the client would like to have returned.
*/
/* NOINLINE: limit stack usage in caller */
static NOINLINE int send_d6_renew(uint32_t xid, struct in6_addr *server_ipv6, struct \
in6_addr *our_cur_ipv6) {
struct d6_packet packet;
uint8_t *opt_ptr;
/* Fill in: msg type, client id */
opt_ptr = init_d6_packet(&packet, DHCPREQUEST, xid);
/* server id */
opt_ptr = mempcpy(opt_ptr, client6_data.server_id, \
client6_data.server_id->len + 2+2); /* IA NA (contains requested IP) */
if (client6_data.ia_na)
opt_ptr = mempcpy(opt_ptr, client6_data.ia_na, \
client6_data.ia_na->len + 2+2); /* IA PD */
if (client6_data.ia_pd)
opt_ptr = mempcpy(opt_ptr, client6_data.ia_pd, \
client6_data.ia_pd->len + 2+2);
/* Add options:
* "param req" option according to -O, options specified with -x
*/
opt_ptr = add_d6_client_options(opt_ptr);
bb_info_msg("sending %s", "renew");
if (server_ipv6)
return d6_send_kernel_packet(
&packet, (opt_ptr - (uint8_t*) \
&packet), our_cur_ipv6, CLIENT_PORT6,
server_ipv6, SERVER_PORT6,
client_data.ifindex
);
return d6_mcast_from_client_data_ifindex(&packet, opt_ptr);
}
Best regards
Uwe Glaeser
dormakaba EAD GmbH
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Subject: DHCPv6 renew in \
/networking/udhcp/d6_dhcpc.c<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span lang="EN-US">as \
stated in the RFC3315-comment of the function send_d6_renew() the message type \
should be set to D6_MSG_RENEW and not DHCPREQUEST (which is an IPv4 \
value).<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">Or is there a \
reason for the DHCPREQUEST ?<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span lang="EN-US">/* \
Unicast or broadcast a DHCP renew message<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">*<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* RFC 3315 18.1.3. Creation and Transmission of \
Renew Messages<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* To \
extend the valid and preferred lifetimes for the addresses<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* associated with an IA, the client sends a \
Renew message to the server<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* from which the client obtained the addresses in the IA containing \
an<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* IA option for the \
IA. The client includes IA Address options in the<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* IA option for the addresses associated with \
the IA. The server<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* determines new lifetimes for the addresses in the IA according to \
the<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* administrative \
configuration of the server. The server may also add<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* new addresses to the IA. The server may \
remove addresses from the IA<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* by setting the preferred and valid lifetimes of those addresses \
to<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* \
zero.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* The \
server controls the time at which the client contacts the \
server<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* to extend the \
lifetimes on assigned addresses through the T1 and T2<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* parameters assigned to an \
IA.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* At \
time T1 for an IA, the client initiates a Renew/Reply message<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">* exchange to extend the lifetimes on any \
addresses in the IA. The<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* client includes an IA option with all addresses currently assigned \
to<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* the IA in its \
Renew message.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* If T1 \
or T2 is set to 0 by the server (for an IA_NA) or there are no<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">* T1 or T2 times (for an IA_TA), the client \
may send a Renew or Rebind<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* message, respectively, at the client's \
discretion.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* The \
client sets the "msg-type" field to RENEW. The client \
generates<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* a \
transaction ID and inserts this value in the \
"transaction-id"<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* field.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* The \
client places the identifier of the destination server in a<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* Server Identifier \
option.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* The \
client MUST include a Client Identifier option to identify \
itself<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* to the \
server. The client adds any appropriate options, \
including<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* one or more \
IA options. The client MUST include the list of<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">* addresses the client currently has associated \
with the IAs in the<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* \
Renew message.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">*<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* The \
client MUST include an Option Request option (see section 22.7)<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">* to indicate the options the client is \
interested in receiving. The<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">* client MAY include options with data values as hints to the \
server<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">* about \
parameter values the client would like to have returned.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">*/<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">/* NOINLINE: limit stack usage in caller \
*/<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">static NOINLINE int \
send_d6_renew(uint32_t xid, struct in6_addr *server_ipv6, struct in6_addr \
*our_cur_ipv6)<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">{<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
struct d6_packet packet;<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
uint8_t *opt_ptr;<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
/* Fill in: msg type, client id */<o:p></o:p></span></p> <p \
class="MsoNormal"><b><span \
lang="EN-US"> \
opt_ptr = init_d6_packet(&packet, DHCPREQUEST, xid);<o:p></o:p></span></b></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span \
lang="EN-US"> \
/* server id */<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
opt_ptr = mempcpy(opt_ptr, client6_data.server_id, client6_data.server_id->len + \
2+2);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
/* IA NA (contains requested IP) */<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
if (client6_data.ia_na)<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; \
opt_ptr = mempcpy(opt_ptr, client6_data.ia_na, client6_data.ia_na->len + \
2+2);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
/* IA PD */<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
if (client6_data.ia_pd)<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; \
opt_ptr = mempcpy(opt_ptr, client6_data.ia_pd, client6_data.ia_pd->len + \
2+2);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
/* Add options:<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
* "param req" option according to -O, options specified with \
-x<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
*/<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
opt_ptr = add_d6_client_options(opt_ptr);<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span \
lang="EN-US"> \
bb_info_msg("sending %s", "renew");<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
lang="EN-US"> \
if (server_ipv6)<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; \
return d6_send_kernel_packet(<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; &nb \
sp; \
&packet, (opt_ptr - (uint8_t*) &packet),<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; &nb \
sp; \
our_cur_ipv6, CLIENT_PORT6,<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; &nb \
sp; \
server_ipv6, SERVER_PORT6,<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; &nb \
sp; \
client_data.ifindex<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> & \
nbsp; \
);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"> \
return d6_mcast_from_client_data_ifindex(&packet, opt_ptr);<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal" style="text-autospace:none"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black;mso-fareast-language:DE">Best \
regards<br> <br>
</span><b><span lang="EN-US" \
style="font-family:"Arial",sans-serif;color:#002F80;mso-fareast-language:DE">Uwe \
Glaeser</span></b><b><span lang="EN-US" \
style="font-size:13.5pt;font-family:"Arial",sans-serif;color:#002F80;mso-fareast-language:DE"><br>
</span></b><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black;mso-fareast-language:DE">dormakaba \
EAD GmbH<o:p></o:p></span></p> </div>
</body>
</html>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
--===============3315681362203441808==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic