libexport.a: Prepare init_subnetwork() for IPv6 support
authorChuck Lever <chuck.lever@oracle.com>
Tue, 31 Aug 2010 19:29:02 +0000 (15:29 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 31 Aug 2010 19:34:24 +0000 (15:34 -0400)
commit2824097496f6b154befbf3b3d15dacf237b07f83
tree98f78f2740610c7f98465f8f296bce05a61d235d
parent03fc34b23c2bff48f54c2d889d7851a31fb64a3d
libexport.a: Prepare init_subnetwork() for IPv6 support

Retire the slash32 logic in inet_netmask() in favor of a more generic
netmask parser that can support IPv6 addresses.

If an invalid IP address string is given to inet_addr(3), it returns
INADDR_NONE, which is actually a "valid" address (255.255.255.255).
We're none the wiser to the substitution until something breaks later.

This patch provides better sanity checking of the parsed address, now
that such an error can be reported to client_init()'s callers.
We can also check the prefixlen value a little more carefully as well.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/export/client.c