/* stolen from NFS - maybe should be made a generic function?  */
static int valid_ipaddr4(const char *buf)
/* stolen from NFS - maybe should be made a generic function?  */
static int valid_ipaddr4(const char *buf)
{
	int rc, count, in[4];
	rc = sscanf(buf, "%d.%d.%d.%d", &in[0], &in[1], &in[2], &in[3]);
	if (rc != 4)
		return -EINVAL;
	for (count = 0; count < 4; count++) {
		if (in[count] > 255)
			return -EINVAL;
	}
	return 0;
}