View | Details | Raw Unified | Return to bug 401 | Differences between
and this patch

Collapse All | Expand All

(-)canohost.c (+13 lines)
Lines 59-69 Link Here
59
			memset(&from, 0, sizeof(from));
59
			memset(&from, 0, sizeof(from));
60
60
61
			from4->sin_family = AF_INET;
61
			from4->sin_family = AF_INET;
62
			fromlen = sizeof(*from4);
62
			memcpy(&from4->sin_addr, &addr, sizeof(addr));
63
			memcpy(&from4->sin_addr, &addr, sizeof(addr));
63
			from4->sin_port = port;
64
			from4->sin_port = port;
64
		}
65
		}
65
	}
66
	}
66
#endif
67
#endif
68
	if (from.ss_family == AF_INET6)
69
		fromlen = sizeof(struct sockaddr_in6);
67
70
68
	if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop),
71
	if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop),
69
	    NULL, 0, NI_NUMERICHOST) != 0)
72
	    NULL, 0, NI_NUMERICHOST) != 0)
Lines 225-230 Link Here
225
		    < 0)
228
		    < 0)
226
			return NULL;
229
			return NULL;
227
	}
230
	}
231
232
	/* Work around Linux IPv6 weirdness */
233
	if (addr.ss_family == AF_INET6)
234
		addrlen = sizeof(struct sockaddr_in6);
235
228
	/* Get the address in ascii. */
236
	/* Get the address in ascii. */
229
	if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
237
	if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
230
	    NULL, 0, flags) != 0) {
238
	    NULL, 0, flags) != 0) {
Lines 319-324 Link Here
319
			fatal_cleanup();
327
			fatal_cleanup();
320
		}
328
		}
321
	}
329
	}
330
331
	/* Work around Linux IPv6 weirdness */
332
	if (from.ss_family == AF_INET6)
333
		fromlen = sizeof(struct sockaddr_in6);
334
322
	/* Return port number. */
335
	/* Return port number. */
323
	if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0,
336
	if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0,
324
	    strport, sizeof(strport), NI_NUMERICSERV) != 0)
337
	    strport, sizeof(strport), NI_NUMERICSERV) != 0)

Return to bug 401