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

Collapse All | Expand All

(-)openssh/canohost.c (+23 lines)
Lines 19-24 Link Here
19
#include "log.h"
19
#include "log.h"
20
#include "canohost.h"
20
#include "canohost.h"
21
21
22
#ifdef __linux__
23
#ifndef SIN6_LEN_RFC2133
24
#define SIN6_LEN_RFC2133	24
25
#endif
26
#endif
27
22
static void check_ip_options(int, char *);
28
static void check_ip_options(int, char *);
23
29
24
/*
30
/*
Lines 61-67 Link Here
61
			from4->sin_family = AF_INET;
67
			from4->sin_family = AF_INET;
62
			memcpy(&from4->sin_addr, &addr, sizeof(addr));
68
			memcpy(&from4->sin_addr, &addr, sizeof(addr));
63
			from4->sin_port = port;
69
			from4->sin_port = port;
70
			fromlen = sizeof(*from4);
64
		}
71
		}
72
#ifdef __linux__
73
		/* quick hack to allow new library on old kernel */
74
		if (fromlen == SIN6_LEN_RFC2133)
75
			fromlen = sizeof(struct sockaddr_in6);
76
#endif
65
	}
77
	}
66
#endif
78
#endif
67
79
Lines 231-236 Link Here
231
			return NULL;
243
			return NULL;
232
		}
244
		}
233
	}
245
	}
246
#ifdef __linux__
247
	/* quick hack to allow new library on old kernel */
248
	if (addr.ss_family == AF_INET6 && addrlen == SIN6_LEN_RFC2133)
249
		addrlen = sizeof(struct sockaddr_in6);
250
#endif
234
	/* Get the address in ascii. */
251
	/* Get the address in ascii. */
235
	if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
252
	if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
236
	    NULL, 0, flags) != 0) {
253
	    NULL, 0, flags) != 0) {
Lines 317-322 Link Here
317
			fatal_cleanup();
334
			fatal_cleanup();
318
		}
335
		}
319
	}
336
	}
337
#ifdef __linux__
338
	/* quick hack to allow new library on old kernel */
339
	if (from.ss_family == AF_INET6 &&
340
	    fromlen == SIN6_LEN_RFC2133)
341
		fromlen = sizeof(struct sockaddr_in6);
342
#endif
320
	/* Return port number. */
343
	/* Return port number. */
321
	if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0,
344
	if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0,
322
	    strport, sizeof(strport), NI_NUMERICSERV) != 0)
345
	    strport, sizeof(strport), NI_NUMERICSERV) != 0)

Return to bug 401