RMerl/asuswrt-merlin — pull request #686 by NickZ (2014-07-29 06:29:14+00:00)
Title: Fixing non /64 ipv6 prefixes being miscalculated

in getifaddr (which is used to set the nvram ipv6 variables in uhcpd), bitwise operations are used to calculate the last byte of the netmask on prefix lengths that are not multiples of 8 (see line 712). Unfortunately, these are being performed on a 32-bit integer, not an 8-bit char. So /60 ends up becoming /84, for example.

I have changed the counter variable to an unsigned char, and this works now.