[PATCH] Added support for timezones on dhcp6-client (RFC 4833)
tiggersWelt.net (Support)
support at tiggerswelt.net
Mon Jun 26 21:20:58 UTC 2017
Good evening Denys,
thank you for your effort!
Am 26.06.2017 um 20:08 schrieb Denys Vlasenko:
> On Wed, Jun 21, 2017 at 4:29 PM, tiggersWelt.net (Support)
> <support at tiggerswelt.net> wrote:
>> static const char opt_req[] = {
>> (D6_OPT_ORO >> 8), (D6_OPT_ORO & 0xff),
>> - 0, 6,
>> + 0, 10,
>> (D6_OPT_DNS_SERVERS >> 8), (D6_OPT_DNS_SERVERS & 0xff),
>> (D6_OPT_DOMAIN_LIST >> 8), (D6_OPT_DOMAIN_LIST & 0xff),
>> - (D6_OPT_CLIENT_FQDN >> 8), (D6_OPT_CLIENT_FQDN & 0xff)
>> + (D6_OPT_CLIENT_FQDN >> 8), (D6_OPT_CLIENT_FQDN & 0xff),
>> + (D6_OPT_TZ_POSIX >> 8), (D6_OPT_TZ_POSIX & 0xff),
>> + (D6_OPT_TZ_NAME >> 8), (D6_OPT_TZ_NAME & 0xff)
>> };
>
> Please explain what does this do, and why.
It's the content of the DHCP6 Option Request Option (ORO) as of RFC 3315, 22.7. It actually tells the
server what options are supported and wanted on client-side.
I introduced this option in my last patch (see commit ed898ed2ddc1e3627555488671155420a32d0167) as some
servers required this to deliver the listed options. Now it was only enhanced by the new options -
haven't tested without it, but I'll give it a try tomorrow.
If curious: <https://tools.ietf.org/html/rfc3315#section-22.7>
>> + /* RFC 4833 Timezones */
>> + case D6_OPT_TZ_POSIX:
>> + dlist = xmalloc(option[3] + 3);
>> + memcpy(dlist, "tz=", 3);
>> + memcpy(dlist + 3, option + 4, option[3]);
>> + *new_env() = dlist;
>
> What makes sure there is a terminating NUL byte?
In my version: nothing.
> How about this instead:
>
> *new_env() = xasprintf("tz=%.*s", (int)option[3], (char*)option + 4);
Much better! I'm not that used to *printf-functions and haven't found these modifiers.
--
\\\||///
\\ - - //
( @ @ )
-oOo--( )--oOo-------------------------------------------------------
tiggersWelt.net www.tiggersWelt.net
Inhaber Bernd Holzmüller info at tiggerswelt.net
Büro: 07 11 / 550 425-90
Marktstraße 57 Fax: 07 11 / 550 425-99
70372 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3310 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20170626/8df3382d/attachment-0001.p7s>
More information about the busybox
mailing list