bsdperimeter/pfsense — pull request #404 by phil-davis (2013-02-10 21:43:23+00:00)
Title: Do not allow 1:2:3:4:5:6:7:8::9 as an IPv6 address 

It is currently possible to enter one of the below IPv6 address-styles into an IPv6 address field. The Net_IPv6 code has a bug - checkIPv6 returns "true" for addresses like:
1::2:3:4:5:6:7:8:9
1:2::3:4:5:6:7:8:9
...
1:2:3:4:5:6:7::8:9
1:2:3:4:5:6:7:8::9
these also emit the message:
Warning: str_repeat(): Second argument has to be greater than or equal to 0 in /etc/inc/IPv6.inc on line 496

It is fixed by making uncompress() always insert at least one ":0:" for any "::" in the address - a "::" always implies at least ":0:". This removes the str_repeat() warning, and means that the uncompressed IPv6 address has >8 numbers in it, so it fails the validity check (as it should).
Plus I fixed various text typos.
These changes are also being submitted to the Net_IPv6 repository on GitHUb so they will get fixed in newer versions of Net_IPv6 (and come back to us if pfSense ever ports them across)..