attributes: Additional IP address validation
Introduce an additional IP address validation instead of assuming
that netaddr provides it. Namely, it ensures that an address
either has ':' (IPv6) or 3 periods like 'xx.xx.xx.xx'. (IPv4)
The "'1' * 59" test case recently introduced by
commit
1681f62ec91b6c3705a14393815542dc1746de71 fails on
some platforms because it's considered a valid address by
their inet_aton. Examples of such platforms: NetBSD, OS X
While one might argue it's a fault of the platforms, this is
a historical behavior which is probably too late to change there.
(The breakage has been hidden by later UT changes in
commit
35662d07628452d14306f5197871ad64f6396ff3 .
This commit includes a UT change to uncover the problem again.)
Closes-Bug: #
1394867
Related-Bug: #
1378450
Change-Id: Ibe02f8b7c4d437bf7abbe7304ca138bdcf4bfdb9