Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 679124 | Differences between
and this patch

Collapse All | Expand All

(-)a/support/export/client.c (-3 / +3 lines)
Lines 210-216 init_subnetwork(nfs_client *clp) Link Here
210
	set_addrlist(clp, 0, ai->ai_addr);
210
	set_addrlist(clp, 0, ai->ai_addr);
211
	family = ai->ai_addr->sa_family;
211
	family = ai->ai_addr->sa_family;
212
212
213
	freeaddrinfo(ai);
213
	nfs_freeaddrinfo(ai);
214
214
215
	switch (family) {
215
	switch (family) {
216
	case AF_INET:
216
	case AF_INET:
Lines 309-315 client_lookup(char *hname, int canonical) Link Here
309
		init_addrlist(clp, ai);
309
		init_addrlist(clp, ai);
310
310
311
out:
311
out:
312
	freeaddrinfo(ai);
312
	nfs_freeaddrinfo(ai);
313
	return clp;
313
	return clp;
314
}
314
}
315
315
Lines 674-680 check_netgroup(const nfs_client *clp, const struct addrinfo *ai) Link Here
674
	tmp = host_pton(hname);
674
	tmp = host_pton(hname);
675
	if (tmp != NULL) {
675
	if (tmp != NULL) {
676
		char *cname = host_canonname(tmp->ai_addr);
676
		char *cname = host_canonname(tmp->ai_addr);
677
		freeaddrinfo(tmp);
677
		nfs_freeaddrinfo(tmp);
678
678
679
		/* The resulting FQDN may be in our netgroup. */
679
		/* The resulting FQDN may be in our netgroup. */
680
		if (cname != NULL) {
680
		if (cname != NULL) {
(-)a/support/export/hostname.c (-2 / +2 lines)
Lines 130-136 host_pton(const char *paddr) Link Here
130
		if (!inet4 && ai->ai_addr->sa_family == AF_INET) {
130
		if (!inet4 && ai->ai_addr->sa_family == AF_INET) {
131
			xlog(D_GENERAL, "%s: failed to convert %s",
131
			xlog(D_GENERAL, "%s: failed to convert %s",
132
					__func__, paddr);
132
					__func__, paddr);
133
			freeaddrinfo(ai);
133
			nfs_freeaddrinfo(ai);
134
			break;
134
			break;
135
		}
135
		}
136
		return ai;
136
		return ai;
Lines 292-298 host_reliable_addrinfo(const struct sockaddr *sap) Link Here
292
		if (nfs_compare_sockaddr(a->ai_addr, sap))
292
		if (nfs_compare_sockaddr(a->ai_addr, sap))
293
			break;
293
			break;
294
294
295
	freeaddrinfo(ai);
295
	nfs_freeaddrinfo(ai);
296
	ai = NULL;
296
	ai = NULL;
297
	if (!a)
297
	if (!a)
298
		goto out;
298
		goto out;
(-)a/support/include/nfslib.h (+11 lines)
Lines 16-21 Link Here
16
#include <sys/types.h>
16
#include <sys/types.h>
17
#include <sys/socket.h>
17
#include <sys/socket.h>
18
#include <netinet/in.h>
18
#include <netinet/in.h>
19
#include <netdb.h>
19
#include <stdio.h>
20
#include <stdio.h>
20
#include <stdbool.h>
21
#include <stdbool.h>
21
#include <paths.h>
22
#include <paths.h>
Lines 156-159 void libtirpc_set_debug(char *name, int level, int use_stderr); Link Here
156
157
157
#define UNUSED(x) UNUSED_ ## x __attribute__((unused))
158
#define UNUSED(x) UNUSED_ ## x __attribute__((unused))
158
159
160
/*
161
 * Some versions of freeaddrinfo(3) do not tolerate being
162
 * passed a NULL pointer.
163
 */
164
static inline void nfs_freeaddrinfo(struct addrinfo *ai)
165
{
166
	if (ai) {
167
		freeaddrinfo(ai);
168
	}
169
}
159
#endif /* NFSLIB_H */
170
#endif /* NFSLIB_H */
(-)a/support/nfs/getport.c (-3 / +4 lines)
Lines 47-52 Link Here
47
47
48
#include "sockaddr.h"
48
#include "sockaddr.h"
49
#include "nfsrpc.h"
49
#include "nfsrpc.h"
50
#include "nfslib.h"
50
51
51
/*
52
/*
52
 * Try a local socket first to access the local rpcbind daemon
53
 * Try a local socket first to access the local rpcbind daemon
Lines 109-115 static int nfs_gp_loopback_address(struct sockaddr *sap, socklen_t *salen) Link Here
109
		ret = 1;
110
		ret = 1;
110
	}
111
	}
111
112
112
	freeaddrinfo(gai_results);
113
	nfs_freeaddrinfo(gai_results);
113
	return ret;
114
	return ret;
114
}
115
}
115
116
Lines 134-141 static in_port_t nfs_gp_getservbyname(const char *service, Link Here
134
135
135
	sin = (const struct sockaddr_in *)gai_results->ai_addr;
136
	sin = (const struct sockaddr_in *)gai_results->ai_addr;
136
	port = sin->sin_port;
137
	port = sin->sin_port;
137
	
138
138
	freeaddrinfo(gai_results);
139
	nfs_freeaddrinfo(gai_results);
139
	return port;
140
	return port;
140
}
141
}
141
142
(-)a/support/nfs/svc_create.c (-3 / +3 lines)
Lines 273-279 svc_create_nconf_rand_port(const char *name, const rpcprog_t program, Link Here
273
	bindaddr.qlen = SOMAXCONN;
273
	bindaddr.qlen = SOMAXCONN;
274
274
275
	xprt = svc_tli_create(RPC_ANYFD, nconf, &bindaddr, 0, 0);
275
	xprt = svc_tli_create(RPC_ANYFD, nconf, &bindaddr, 0, 0);
276
	freeaddrinfo(ai);
276
	nfs_freeaddrinfo(ai);
277
	if (xprt == NULL) {
277
	if (xprt == NULL) {
278
		xlog(L_ERROR, "Failed to create listener xprt "
278
		xlog(L_ERROR, "Failed to create listener xprt "
279
			"(%s, %u, %s)", name, version, nconf->nc_netid);
279
			"(%s, %u, %s)", name, version, nconf->nc_netid);
Lines 364-374 svc_create_nconf_fixed_port(const char *name, const rpcprog_t program, Link Here
364
364
365
	svc_create_cache_xprt(xprt);
365
	svc_create_cache_xprt(xprt);
366
366
367
	freeaddrinfo(ai);
367
	nfs_freeaddrinfo(ai);
368
	return 1;
368
	return 1;
369
369
370
out_free:
370
out_free:
371
	freeaddrinfo(ai);
371
	nfs_freeaddrinfo(ai);
372
	return 0;
372
	return 0;
373
}
373
}
374
374
(-)a/support/nfsidmap/umich_ldap.c (-1 / +2 lines)
Lines 46-51 Link Here
46
/* We are using deprecated functions, get the prototypes... */
46
/* We are using deprecated functions, get the prototypes... */
47
#define LDAP_DEPRECATED 1
47
#define LDAP_DEPRECATED 1
48
#include <ldap.h>
48
#include <ldap.h>
49
#include "nfslib.h"
49
#include "nfsidmap.h"
50
#include "nfsidmap.h"
50
#include "nfsidmap_plugin.h"
51
#include "nfsidmap_plugin.h"
51
#include "nfsidmap_private.h"
52
#include "nfsidmap_private.h"
Lines 1089-1095 get_canonical_hostname(const char *inname) Link Here
1089
	return_name = strdup (tmphost);
1090
	return_name = strdup (tmphost);
1090
1091
1091
out_free:
1092
out_free:
1092
	freeaddrinfo(ap);
1093
	nfs_freeaddrinfo(ap);
1093
out_err:
1094
out_err:
1094
	return return_name;
1095
	return return_name;
1095
}
1096
}
(-)a/tests/nsm_client/nsm_client.c (-1 / +1 lines)
Lines 243-249 nsm_client_get_rpcclient(const char *node) Link Here
243
		printf("RPC client creation failed\n");
243
		printf("RPC client creation failed\n");
244
	}
244
	}
245
out:
245
out:
246
	freeaddrinfo(ai);
246
	nfs_freeaddrinfo(ai);
247
	return client;
247
	return client;
248
}
248
}
249
249
(-)a/utils/exportfs/exportfs.c (-5 / +5 lines)
Lines 282-288 exportfs_parsed(char *hname, char *path, char *options, int verbose) Link Here
282
	validate_export(exp);
282
	validate_export(exp);
283
283
284
out:
284
out:
285
	freeaddrinfo(ai);
285
	nfs_freeaddrinfo(ai);
286
}
286
}
287
287
288
static int exportfs_generic(char *arg, char *options, int verbose)
288
static int exportfs_generic(char *arg, char *options, int verbose)
Lines 395-401 unexportfs_parsed(char *hname, char *path, int verbose) Link Here
395
	if (!success)
395
	if (!success)
396
		xlog(L_ERROR, "Could not find '%s:%s' to unexport.", hname, path);
396
		xlog(L_ERROR, "Could not find '%s:%s' to unexport.", hname, path);
397
397
398
	freeaddrinfo(ai);
398
	nfs_freeaddrinfo(ai);
399
}
399
}
400
400
401
static int unexportfs_generic(char *arg, int verbose)
401
static int unexportfs_generic(char *arg, int verbose)
Lines 588-594 address_list(const char *hostname) Link Here
588
	if (ai != NULL) {
588
	if (ai != NULL) {
589
		/* @hostname was a presentation address */
589
		/* @hostname was a presentation address */
590
		cname = host_canonname(ai->ai_addr);
590
		cname = host_canonname(ai->ai_addr);
591
		freeaddrinfo(ai);
591
		nfs_freeaddrinfo(ai);
592
		if (cname != NULL)
592
		if (cname != NULL)
593
			goto out;
593
			goto out;
594
	}
594
	}
Lines 639-646 matchhostname(const char *hostname1, const char *hostname2) Link Here
639
			}
639
			}
640
640
641
out:
641
out:
642
	freeaddrinfo(results1);
642
	nfs_freeaddrinfo(results1);
643
	freeaddrinfo(results2);
643
	nfs_freeaddrinfo(results2);
644
	return result;
644
	return result;
645
}
645
}
646
646
(-)a/utils/gssd/gssd.c (-2 / +2 lines)
Lines 172-185 gssd_addrstr_to_sockaddr(struct sockaddr *sa, const char *node, const char *port Link Here
172
		if (sin6->sin6_scope_id) {
172
		if (sin6->sin6_scope_id) {
173
			printerr(0, "ERROR: address %s has non-zero "
173
			printerr(0, "ERROR: address %s has non-zero "
174
				    "sin6_scope_id!\n", node);
174
				    "sin6_scope_id!\n", node);
175
			freeaddrinfo(res);
175
			nfs_freeaddrinfo(res);
176
			return false;
176
			return false;
177
		}
177
		}
178
	}
178
	}
179
#endif /* IPV6_SUPPORTED */
179
#endif /* IPV6_SUPPORTED */
180
180
181
	memcpy(sa, res->ai_addr, res->ai_addrlen);
181
	memcpy(sa, res->ai_addr, res->ai_addrlen);
182
	freeaddrinfo(res);
182
	nfs_freeaddrinfo(res);
183
	return true;
183
	return true;
184
}
184
}
185
185
(-)a/utils/gssd/krb5_util.c (-1 / +2 lines)
Lines 121-126 Link Here
121
#include <krb5.h>
121
#include <krb5.h>
122
#include <rpc/auth_gss.h>
122
#include <rpc/auth_gss.h>
123
123
124
#include "nfslib.h"
124
#include "gssd.h"
125
#include "gssd.h"
125
#include "err_util.h"
126
#include "err_util.h"
126
#include "gss_util.h"
127
#include "gss_util.h"
Lines 587-593 get_full_hostname(const char *inhost, char *outhost, int outhostlen) Link Here
587
		goto out;
588
		goto out;
588
	}
589
	}
589
	strncpy(outhost, addrs->ai_canonname, outhostlen);
590
	strncpy(outhost, addrs->ai_canonname, outhostlen);
590
	freeaddrinfo(addrs);
591
	nfs_freeaddrinfo(addrs);
591
	for (c = outhost; *c != '\0'; c++)
592
	for (c = outhost; *c != '\0'; c++)
592
	    *c = tolower(*c);
593
	    *c = tolower(*c);
593
594
(-)a/utils/mount/network.c (-3 / +3 lines)
Lines 250-256 int nfs_lookup(const char *hostname, const sa_family_t family, Link Here
250
		break;
250
		break;
251
	}
251
	}
252
252
253
	freeaddrinfo(gai_results);
253
	nfs_freeaddrinfo(gai_results);
254
	return ret;
254
	return ret;
255
}
255
}
256
256
Lines 307-313 int nfs_string_to_sockaddr(const char *address, struct sockaddr *sap, Link Here
307
			}
307
			}
308
			break;
308
			break;
309
		}
309
		}
310
		freeaddrinfo(gai_results);
310
		nfs_freeaddrinfo(gai_results);
311
	}
311
	}
312
312
313
	return ret;
313
	return ret;
Lines 1180-1186 static int nfs_ca_gai(const struct sockaddr *sap, Link Here
1180
	*buflen = gai_results->ai_addrlen;
1180
	*buflen = gai_results->ai_addrlen;
1181
	memcpy(buf, gai_results->ai_addr, *buflen);
1181
	memcpy(buf, gai_results->ai_addr, *buflen);
1182
1182
1183
	freeaddrinfo(gai_results);
1183
	nfs_freeaddrinfo(gai_results);
1184
1184
1185
	return 1;
1185
	return 1;
1186
}
1186
}
(-)a/utils/mount/stropts.c (-1 / +2 lines)
Lines 35-40 Link Here
35
#include <netinet/in.h>
35
#include <netinet/in.h>
36
#include <arpa/inet.h>
36
#include <arpa/inet.h>
37
37
38
#include "nfslib.h"
38
#include "sockaddr.h"
39
#include "sockaddr.h"
39
#include "xcommon.h"
40
#include "xcommon.h"
40
#include "mount.h"
41
#include "mount.h"
Lines 1268-1274 int nfsmount_string(const char *spec, const char *node, char *type, Link Here
1268
	} else
1269
	} else
1269
		nfs_error(_("%s: internal option parsing error"), progname);
1270
		nfs_error(_("%s: internal option parsing error"), progname);
1270
1271
1271
	freeaddrinfo(mi.address);
1272
	nfs_freeaddrinfo(mi.address);
1272
	free(mi.hostname);
1273
	free(mi.hostname);
1273
	return retval;
1274
	return retval;
1274
}
1275
}
(-)a/utils/mountd/auth.c (-1 / +1 lines)
Lines 297-303 auth_authenticate(const char *what, const struct sockaddr *caller, Link Here
297
		     what, buf, nfs_get_port(caller), path, epath, error);
297
		     what, buf, nfs_get_port(caller), path, epath, error);
298
	}
298
	}
299
299
300
	freeaddrinfo(ai);
300
	nfs_freeaddrinfo(ai);
301
	return exp;
301
	return exp;
302
}
302
}
303
303
(-)a/utils/mountd/cache.c (-5 / +5 lines)
Lines 113-119 static void auth_unix_ip(int f) Link Here
113
		ai = client_resolve(tmp->ai_addr);
113
		ai = client_resolve(tmp->ai_addr);
114
		if (ai) {
114
		if (ai) {
115
			client = client_compose(ai);
115
			client = client_compose(ai);
116
			freeaddrinfo(ai);
116
			nfs_freeaddrinfo(ai);
117
		}
117
		}
118
	}
118
	}
119
	bp = buf; blen = sizeof(buf);
119
	bp = buf; blen = sizeof(buf);
Lines 133-139 static void auth_unix_ip(int f) Link Here
133
	xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT");
133
	xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT");
134
134
135
	free(client);
135
	free(client);
136
	freeaddrinfo(tmp);
136
	nfs_freeaddrinfo(tmp);
137
137
138
}
138
}
139
139
Lines 667-673 static struct addrinfo *lookup_client_addr(char *dom) Link Here
667
	if (tmp == NULL)
667
	if (tmp == NULL)
668
		return NULL;
668
		return NULL;
669
	ret = client_resolve(tmp->ai_addr);
669
	ret = client_resolve(tmp->ai_addr);
670
	freeaddrinfo(tmp);
670
	nfs_freeaddrinfo(tmp);
671
	return ret;
671
	return ret;
672
}
672
}
673
673
Lines 834-840 static void nfsd_fh(int f) Link Here
834
out:
834
out:
835
	if (found_path)
835
	if (found_path)
836
		free(found_path);
836
		free(found_path);
837
	freeaddrinfo(ai);
837
	nfs_freeaddrinfo(ai);
838
	free(dom);
838
	free(dom);
839
	xlog(D_CALL, "nfsd_fh: found %p path %s", found, found ? found->e_path : NULL);
839
	xlog(D_CALL, "nfsd_fh: found %p path %s", found, found ? found->e_path : NULL);
840
}
840
}
Lines 1355-1361 static void nfsd_export(int f) Link Here
1355
	xlog(D_CALL, "nfsd_export: found %p path %s", found, path ? path : NULL);
1355
	xlog(D_CALL, "nfsd_export: found %p path %s", found, path ? path : NULL);
1356
	if (dom) free(dom);
1356
	if (dom) free(dom);
1357
	if (path) free(path);
1357
	if (path) free(path);
1358
	freeaddrinfo(ai);
1358
	nfs_freeaddrinfo(ai);
1359
}
1359
}
1360
1360
1361
1361
(-)a/utils/mountd/mountd.c (-2 / +2 lines)
Lines 578-587 static void prune_clients(nfs_export *exp, struct exportnode *e) Link Here
578
				*cp = c->gr_next;
578
				*cp = c->gr_next;
579
				xfree(c->gr_name);
579
				xfree(c->gr_name);
580
				xfree(c);
580
				xfree(c);
581
				freeaddrinfo(ai);
581
				nfs_freeaddrinfo(ai);
582
				continue;
582
				continue;
583
			}
583
			}
584
			freeaddrinfo(ai);
584
			nfs_freeaddrinfo(ai);
585
		}
585
		}
586
		cp = &(c->gr_next);
586
		cp = &(c->gr_next);
587
	}
587
	}
(-)a/utils/mountd/rmtab.c (-1 / +1 lines)
Lines 226-232 mountlist_list(void) Link Here
226
				ai = host_pton(rep->r_client);
226
				ai = host_pton(rep->r_client);
227
				if (ai != NULL) {
227
				if (ai != NULL) {
228
					m->ml_hostname = host_canonname(ai->ai_addr);
228
					m->ml_hostname = host_canonname(ai->ai_addr);
229
					freeaddrinfo(ai);
229
					nfs_freeaddrinfo(ai);
230
				}
230
				}
231
			}
231
			}
232
			if (m->ml_hostname == NULL)
232
			if (m->ml_hostname == NULL)
(-)a/utils/nfsd/nfssvc.c (-2 / +1 lines)
Lines 246-253 error: Link Here
246
		close(fd);
246
		close(fd);
247
	if (sockfd >= 0)
247
	if (sockfd >= 0)
248
		close(sockfd);
248
		close(sockfd);
249
	if (addrhead)
249
	nfs_freeaddrinfo(addrhead);
250
		freeaddrinfo(addrhead);
251
	return (bounded ? 0 : rc);
250
	return (bounded ? 0 : rc);
252
}
251
}
253
252
(-)a/utils/statd/hostname.c (-5 / +6 lines)
Lines 35-40 Link Here
35
#include <netdb.h>
35
#include <netdb.h>
36
#include <arpa/inet.h>
36
#include <arpa/inet.h>
37
37
38
#include "nfslib.h"
38
#include "sockaddr.h"
39
#include "sockaddr.h"
39
#include "statd.h"
40
#include "statd.h"
40
#include "xlog.h"
41
#include "xlog.h"
Lines 203-209 statd_canonical_name(const char *hostname) Link Here
203
		_Bool result;
204
		_Bool result;
204
		result = get_nameinfo(ai->ai_addr, ai->ai_addrlen,
205
		result = get_nameinfo(ai->ai_addr, ai->ai_addrlen,
205
					buf, (socklen_t)sizeof(buf));
206
					buf, (socklen_t)sizeof(buf));
206
		freeaddrinfo(ai);
207
		nfs_freeaddrinfo(ai);
207
		if (!result || buf[0] == '\0')
208
		if (!result || buf[0] == '\0')
208
			/* OK to use presentation address,
209
			/* OK to use presentation address,
209
			 * if no reverse map exists */
210
			 * if no reverse map exists */
Lines 217-223 statd_canonical_name(const char *hostname) Link Here
217
	if (ai == NULL)
218
	if (ai == NULL)
218
		return NULL;
219
		return NULL;
219
	strcpy(buf, ai->ai_canonname);
220
	strcpy(buf, ai->ai_canonname);
220
	freeaddrinfo(ai);
221
	nfs_freeaddrinfo(ai);
221
222
222
	return strdup(buf);
223
	return strdup(buf);
223
}
224
}
Lines 253-259 statd_canonical_list(const char *hostname) Link Here
253
		_Bool result;
254
		_Bool result;
254
		result = get_nameinfo(ai->ai_addr, ai->ai_addrlen,
255
		result = get_nameinfo(ai->ai_addr, ai->ai_addrlen,
255
					buf, (socklen_t)sizeof(buf));
256
					buf, (socklen_t)sizeof(buf));
256
		freeaddrinfo(ai);
257
		nfs_freeaddrinfo(ai);
257
		if (result)
258
		if (result)
258
			goto out;
259
			goto out;
259
	}
260
	}
Lines 308-315 statd_matchhostname(const char *hostname1, const char *hostname2) Link Here
308
			}
309
			}
309
310
310
out:
311
out:
311
	freeaddrinfo(results2);
312
	nfs_freeaddrinfo(results2);
312
	freeaddrinfo(results1);
313
	nfs_freeaddrinfo(results1);
313
314
314
	xlog(D_CALL, "%s: hostnames %s and %s %s", __func__,
315
	xlog(D_CALL, "%s: hostnames %s and %s %s", __func__,
315
			hostname1, hostname2,
316
			hostname1, hostname2,
(-)a/utils/statd/sm-notify.c (-8 / +7 lines)
Lines 36-41 Link Here
36
#include "sockaddr.h"
36
#include "sockaddr.h"
37
#include "xlog.h"
37
#include "xlog.h"
38
#include "nsm.h"
38
#include "nsm.h"
39
#include "nfslib.h"
39
#include "nfsrpc.h"
40
#include "nfsrpc.h"
40
41
41
/* glibc before 2.3.4 */
42
/* glibc before 2.3.4 */
Lines 179-185 smn_verify_my_name(const char *name) Link Here
179
	case 0:
180
	case 0:
180
		/* @name was a presentation address */
181
		/* @name was a presentation address */
181
		retval = smn_get_hostname(ai->ai_addr, ai->ai_addrlen, name);
182
		retval = smn_get_hostname(ai->ai_addr, ai->ai_addrlen, name);
182
		freeaddrinfo(ai);
183
		nfs_freeaddrinfo(ai);
183
		if (retval == NULL)
184
		if (retval == NULL)
184
			return NULL;
185
			return NULL;
185
		break;
186
		break;
Lines 253-260 static void smn_forget_host(struct nsm_host *host) Link Here
253
	free((void *)host->my_name);
254
	free((void *)host->my_name);
254
	free((void *)host->mon_name);
255
	free((void *)host->mon_name);
255
	free(host->name);
256
	free(host->name);
256
	if (host->ai)
257
	nfs_freeaddrinfo(host->ai);
257
		freeaddrinfo(host->ai);
258
258
259
	free(host);
259
	free(host);
260
}
260
}
Lines 430-436 retry: Link Here
430
	if (srcport) {
430
	if (srcport) {
431
		if (bind(sock, ai->ai_addr, ai->ai_addrlen) == -1) {
431
		if (bind(sock, ai->ai_addr, ai->ai_addrlen) == -1) {
432
			xlog(L_ERROR, "Failed to bind RPC socket: %m");
432
			xlog(L_ERROR, "Failed to bind RPC socket: %m");
433
			freeaddrinfo(ai);
433
			nfs_freeaddrinfo(ai);
434
			(void)close(sock);
434
			(void)close(sock);
435
			return -1;
435
			return -1;
436
		}
436
		}
Lines 440-446 retry: Link Here
440
		if (smn_bindresvport(sock, ai->ai_addr) == -1) {
440
		if (smn_bindresvport(sock, ai->ai_addr) == -1) {
441
			xlog(L_ERROR,
441
			xlog(L_ERROR,
442
				"bindresvport on RPC socket failed: %m");
442
				"bindresvport on RPC socket failed: %m");
443
			freeaddrinfo(ai);
443
			nfs_freeaddrinfo(ai);
444
			(void)close(sock);
444
			(void)close(sock);
445
			return -1;
445
			return -1;
446
		}
446
		}
Lines 449-461 retry: Link Here
449
		se = getservbyport((int)nfs_get_port(ai->ai_addr), "udp");
449
		se = getservbyport((int)nfs_get_port(ai->ai_addr), "udp");
450
		if (se != NULL && retry_cnt < 100) {
450
		if (se != NULL && retry_cnt < 100) {
451
			retry_cnt++;
451
			retry_cnt++;
452
			freeaddrinfo(ai);
452
			nfs_freeaddrinfo(ai);
453
			(void)close(sock);
453
			(void)close(sock);
454
			goto retry;
454
			goto retry;
455
		}
455
		}
456
	}
456
	}
457
457
458
	freeaddrinfo(ai);
458
	nfs_freeaddrinfo(ai);
459
	return sock;
459
	return sock;
460
}
460
}
461
461
462
- 

Return to bug 679124