Fixing IPv6 allocation with explicit IP

RM9413, RM9414, RM9419. Includes 2 new unit tests and some
cleaner boolean logic.
Merge pull request #228 from insequent/fix_port_ipv6

Fixing IPv6 allocation with explicit IP