dnsmasq: Fix splitting hostid for DHCPv6 static leases
authorArjen de Korte <build+lede@de-korte.org>
Mon, 5 Dec 2016 11:53:16 +0000 (12:53 +0100)
committerJohn Crispin <john@phrozen.org>
Tue, 6 Dec 2016 06:55:07 +0000 (07:55 +0100)
Correct splitting the 32-bit 'hostid' value to two 16-bit hexadecimal
values. Previously, the lower 16-bit value was truncated to an 8-bit
value, which would result in hostid values 100 and 200 both to be set
to [::0:0] instead of [::0:100] and [::0:200] respectively.

Signed-off-by: Arjen de Korte <build+lede@de-korte.org>
package/network/services/dnsmasq/files/dnsmasq.init

index 845cf1b5e338e059b8944677a4441ac24fd149a1..eebf5c76c89479f4a9653059110432a4faa748d4 100644 (file)
@@ -35,7 +35,7 @@ hex_to_hostid() {
         export "$var=$(
                 printf "%0x:%0x"  \
                         $(((0x$hex >> 16) % 65536)) \
-                        $(( 0x$hex        % 256))
+                        $(( 0x$hex        % 65536))
         )"
 
         return 0