[source] dnsmasq: Fix splitting hostid for DHCPv6 static leases

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 6 11:34:54 PST 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/4fbd3aa278903bfc74341aafaeef86ff98e82e09

commit 4fbd3aa278903bfc74341aafaeef86ff98e82e09
Author: Arjen de Korte <build+lede at de-korte.org>
AuthorDate: Mon Dec 5 12:53:16 2016 +0100

    dnsmasq: Fix splitting hostid for DHCPv6 static leases
    
    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 at de-korte.org>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 845cf1b..eebf5c7 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -35,7 +35,7 @@ hex_to_hostid() {
         export "$var=$(
                 printf "%0x:%0x"  \
                         $(((0x$hex >> 16) % 65536)) \
-                        $(( 0x$hex        % 256))
+                        $(( 0x$hex        % 65536))
         )"
 
         return 0



More information about the lede-commits mailing list