allow_trusted() function of permissions module doesn't work right with ipv6 addresses - it treats IP addresses as strings and doesn't take into account variations aaa:bbb::0 vs aaa:bbb:0:0:0:0:0:0.