changeset 2225:5e0603406161 draft

Fix an off-by-1 error decoding RFC3361. We can use RFC3361 to decode the RFC3495 TSP sub option 3. This means that RFC3495 is now fully supported.
author Roy Marples <roy@marples.name>
date Thu, 16 Jan 2014 09:29:42 +0000
parents a7db36d1ebf3
children d890d1db44ae
files dhcp-common.c dhcpcd-definitions.conf
diffstat 2 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp-common.c	Wed Jan 15 20:24:38 2014 +0000
+++ b/dhcp-common.c	Thu Jan 16 09:29:42 2014 +0000
@@ -390,7 +390,7 @@
 		if ((tmp = decode_rfc3361(dl, data)) == NULL)
 			return -1;
 		l = strlen(tmp);
-		l = print_string(s, len, l - 1, (uint8_t *)tmp);
+		l = print_string(s, len, l, (uint8_t *)tmp);
 		free(tmp);
 		return l;
 	}
--- a/dhcpcd-definitions.conf	Wed Jan 15 20:24:38 2014 +0000
+++ b/dhcpcd-definitions.conf	Thu Jan 16 09:29:42 2014 +0000
@@ -135,15 +135,7 @@
 define 122	encap			tsp
 encap 1		ipaddress		dhcp_server
 encap 2		ipaddress		dhcp_secondary_server
-encap 3		embed			provisioning_server
-embed		byte			type
-embed		domain			fqdn
-#embed		ipaddress		address
-# We only support FQDN in option 3 out of the box which is type 0.
-# Type 1 is an ipaddress, but we currently have no logic to change embedded
-# type based on the content of an option.
-# To swap it out, just comment / uncomment the above two lines to your liking.
-# However, ensure that only one is uncommented.
+encap 3		rfc3361			provisioning_server
 encap 4		embed			as_req_as_rep_backoff
 embed		uint32			nominal
 embed		uint32			maximum