[Dnsmasq-discuss] [PATCH] DHCPv6 IAID should be of unsigned type

Geert Stappers stappers at stappers.nl
Sun Oct 20 19:24:26 BST 2019

On Sun, Oct 20, 2019 at 07:19:13PM +0200, Dominik DL6ER wrote:
> Dear mailing list,
> The proposed patch ensures that the DHCPv6 IAID is of unsigned type.
> This is entirely uncritical, however, as the variable is already now
> interpreted and handled as being of unsigned type in
> * lease.c:read_leases(),
> * helper.c:create_helper(),
> * dbus.c:dbus_add_lease(), and
> * outpacket.c:put_opt6_long(),
> its definition should reflect this to avoid inconsistencies.
> RFC3315 (section 22.4) confirms that the IAID is a 4 bytes long
> unsigned integer.
> Best,
> Dominik

> From 93490e98789bf91d86d46e96c643feea4a08e387 Mon Sep 17 00:00:00 2001
> From: Dominik DL6ER <dl6er at dl6er.de>
> Date: Sun, 20 Oct 2019 18:51:52 +0200
> Subject: [PATCH] DHCPv6 IAID should be of unsigned type.
>  It is derived from strtoul() in lease.c:read_leases() and already
>  now interpreted as unsigned in helper.c:276 and outpacket.c:put_opt6_long().
>  RFC3315 (section 22.4) shows that the IAID is 4
>  bytes long so we do not need to go up to unsigned long.
> To: dnsmasq-discuss <dnsmasq-discuss at lists.thekelleys.org.uk>
> Signed-off-by: Dominik DL6ER <dl6er at dl6er.de>
> ---

But how long is a int?  And that is for which compiler?

So where the patch is now someting like `s/int iaid/unsigned int iaid/`,
would I like to see something like `s/int iaid/uint32 iaid/`.
Because uint32 is always 4 bytes long.

Geert Stappers

More information about the Dnsmasq-discuss mailing list