- /*
- * We don't need a copy of the pathname, but let's
- * sanity check it anyway.
- */
- if (strlen(pathname) > NFS_MAXPATHNAME) {
- nfs_error(_("%s: export pathname is too long"),
- progname);
- goto out;
- }
-
- /*
- * Ignore all but first hostname in replicated mounts
- * until they can be fully supported. (mack@sgi.com)
- */
- if ((s = strchr(dev, ','))) {
- *s = '\0';
- nfs_error(_("%s: warning: multiple hostnames not supported"),
- progname);
- nfs_error(_("%s: ignoring hostnames that follow the first one"),
- progname);
- }
- mi->hostname = xstrdup(dev);
- if (strlen(mi->hostname) > NFS_MAXHOSTNAME) {
- nfs_error(_("%s: server hostname is too long"),
- progname);
- free(mi->hostname);
- mi->hostname = NULL;
- goto out;
- }
-
- ret = 1;
-
-out:
- free(dev);
- return ret;
-}
-
-static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
-{
- struct hostent *hp;
- addr->sin_family = AF_INET;
-
- if (inet_aton(hostname, &addr->sin_addr))
- return 1;
- if ((hp = gethostbyname(hostname)) == NULL) {
- nfs_error(_("%s: can't get address for %s\n"),
- progname, hostname);
- return 0;
- }
- if (hp->h_length > sizeof(struct in_addr)) {
- nfs_error(_("%s: got bad hp->h_length"), progname);
- hp->h_length = sizeof(struct in_addr);
- }
- memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
- return 1;
-}