View | Details | Raw Unified | Return to bug 30235
Collapse All | Expand All

(-)portmap.c (-5 / +19 lines)
Lines 159-170 Link Here
159
	 * If no hosts were specified, just bind to INADDR_ANY.  Otherwise
159
	 * If no hosts were specified, just bind to INADDR_ANY.  Otherwise
160
	 * make sure 127.0.0.1 is added to the list.
160
	 * make sure 127.0.0.1 is added to the list.
161
	 */
161
	 */
162
	++nhosts;
162
	if (nhosts == 0){
163
	hosts = realloc(hosts, nhosts * sizeof(char *));
163
		++nhosts;
164
	if (nhosts == 1)
164
		hosts = realloc(hosts, nhosts * sizeof(char *));
165
		hosts[0] = "0.0.0.0";
165
		hosts[0] = "0.0.0.0";
166
	else
166
		}
167
		hosts[nhosts - 1] = "127.0.0.1";
167
	else {
168
	/* add localhost if not already there */
169
170
		int n, lh_requested = 0;
171
172
		for(n=0;n<nhosts;n++) {
173
		if(!strcmp(hosts[n],"127.0.0.1")) lh_requested = 1;
174
		}
175
176
		if (!lh_requested) {
177
			++nhosts;
178
			hosts = realloc(hosts, nhosts * sizeof(char *));
179
			hosts[nhosts - 1] = "127.0.0.1";
180
		}
181
	}
168
182
169
	/*
183
	/*
170
	 * Add UDP socket(s) - bind to specific IPs if asked to
184
	 * Add UDP socket(s) - bind to specific IPs if asked to

Return to bug 30235