From: Roy Marples Date: Fri, 3 May 2013 13:38:54 +0000 (+0000) Subject: Add RFC4833 support for TimeZone options. X-Git-Tag: v5.99.6~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5dff2872ab81dfb05926ba205a4e75cf04191ebd;p=thirdparty%2Fdhcpcd.git Add RFC4833 support for TimeZone options. --- diff --git a/dhcp.c b/dhcp.c index 3b24bda7..67bb7663 100644 --- a/dhcp.c +++ b/dhcp.c @@ -190,6 +190,8 @@ const struct dhcp_opt const dhcp_opts[] = { { 91, UINT32, "client_last_transaction_time" }, { 92, IPV4A, "associated_ip" }, { 98, STRING, "uap_servers" }, + { 100, STRING, "posix_timezone" }, + { 101, STRING, "tzdb_timezone" }, { 112, IPV4A, "netinfo_server_address" }, { 113, STRING, "netinfo_server_tag" }, { 114, STRING, "default_url" }, diff --git a/dhcp6.c b/dhcp6.c index 1adeb456..13216bc5 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -120,6 +120,8 @@ const struct dhcp_opt const dhcp6_opts[] = { { D6_OPTION_INFO_REFRESH_TIME, UINT32, "info_refresh_time" }, { D6_OPTION_BCMS_SERVER_D, RFC3397, "bcms_server_d" }, { D6_OPTION_BCMS_SERVER_A, IPV6A, "bcms_server_a" }, + { D6_OPTION_POSIX_TIMEZONE, STRING, "posix_timezone" }, + { D6_OPTION_TZDB_TIMEZONE, STRING, "tzdb_timezone" }, { 0, 0, NULL } }; @@ -379,10 +381,9 @@ dhcp6_makemessage(struct interface *ifp) si = NULL; if (state->state != DH6S_RELEASE) { for (opt = dhcp6_opts; opt->option; opt++) { - if (!(opt->type & REQUEST || - has_option_mask(ifo->requestmask6, opt->option))) - continue; - len += sizeof(*u16); + if (opt->type & REQUEST || + has_option_mask(ifo->requestmask6, opt->option)) + len += sizeof(*u16); } if (len == 0) len = sizeof(*u16) * 2; @@ -567,11 +568,12 @@ dhcp6_makemessage(struct interface *ifp) o->len = 0; u16 = (uint16_t *)(void *)D6_OPTION_DATA(o); for (opt = dhcp6_opts; opt->option; opt++) { - if (!(opt->type & REQUEST || - has_option_mask(ifo->requestmask6, opt->option))) - continue; - *u16++ = htons(opt->option); - o->len += sizeof(*u16); + if (opt->type & REQUEST || + has_option_mask(ifo->requestmask6, opt->option)) + { + *u16++ = htons(opt->option); + o->len += sizeof(*u16); + } } if (o->len == 0) { *u16++ = htons(D6_OPTION_DNS_SERVERS); diff --git a/dhcp6.h b/dhcp6.h index 861ca1cf..282b8375 100644 --- a/dhcp6.h +++ b/dhcp6.h @@ -77,6 +77,8 @@ #define D6_OPTION_INFO_REFRESH_TIME 32 #define D6_OPTION_BCMS_SERVER_D 33 #define D6_OPTION_BCMS_SERVER_A 34 +#define D6_OPTION_POSIX_TIMEZONE 41 +#define D6_OPTION_TZDB_TIMEZONE 42 #include "dhcp.h" #include "ipv6.h" diff --git a/dhcpcd-hooks/Makefile b/dhcpcd-hooks/Makefile index 7563d2d8..acd1c182 100644 --- a/dhcpcd-hooks/Makefile +++ b/dhcpcd-hooks/Makefile @@ -4,7 +4,8 @@ include ${TOP}/config.mk SCRIPTSDIR= ${LIBEXECDIR}/dhcpcd-hooks SCRIPTS= 01-test 02-dump -SCRIPTS+= 10-mtu 20-resolv.conf 29-lookup-hostname 30-hostname +SCRIPTS+= 10-mtu 15-timezone 20-resolv.conf +SCRIPTS+= 29-lookup-hostname 30-hostname SCRIPTS+= ${HOOKSCRIPTS} all: diff --git a/dhcpcd.8.in b/dhcpcd.8.in index 83fd715f..3e943b06 100644 --- a/dhcpcd.8.in +++ b/dhcpcd.8.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 5, 2013 +.Dd May 3, 2013 .Dt DHCPCD 8 .Os .Sh NAME @@ -605,7 +605,7 @@ running on the .Sh STANDARDS RFC 951, RFC 1534, RFC 2131, RFC 2132, RFC 2855, RFC 3004, RFC 3315,RFC 3361, RFC 3633, RFC 3396, RFC 3397, RFC 3442, RFC 3927, RFC 4361, RFC 4390, RFC 4702, -RFC 4861, RFC 5227, RFC 5969, RFC 6106. +RFC 4861, RFC 4833, RFC 5227, RFC 5969, RFC 6106. .Sh AUTHORS .An Roy Marples Aq roy@marples.name .Sh BUGS