Expand the comment explaining the workaround for the Snow Leopard

timeout bug.

Make the code for the workaround assume any 10.6.x release other than
10.6.2 requires it; that way we don't have to update the code until
either

	1) Apple fixes the bug in a later 10.6.x update

or

	2) Apple comes out with a major release that still has, or
	   reintroduces, the bug.

svn path=/trunk/; revision=32349
This commit is contained in:
Guy Harris 2010-04-01 00:27:25 +00:00
parent d87005b114
commit 7b41a72801
1 changed files with 18 additions and 8 deletions

View File

@ -266,7 +266,7 @@ static loop_data global_ld;
* fixed in 10.6.2.
*/
#if defined(__APPLE__) && defined(__LP64__)
static int need_timeout_workaround;
static gboolean need_timeout_workaround;
#define CAP_READ_TIMEOUT (need_timeout_workaround ? 1000 : 250)
#else
@ -2721,18 +2721,28 @@ main(int argc, char *argv[])
#if defined(__APPLE__) && defined(__LP64__)
/*
* Is this Mac OS X 10.6 or 10.6.1? If so, we need a bug workaround.
* Is this Mac OS X 10.6.x, other than 10.6.2? If so, we need a bug
* workaround - timeouts less than 1 second don't work with libpcap
* in 64-bit code. (The bug was introduced in 10.6, fixed in 10.6.2,
* and re-introduced in 10.6.3. We don't know whether it'll be fixed
* again in a later 10.6.x release; we'll assume that it'll be fixed
* in any future major releases.)
*/
if (uname(&osinfo) == 0) {
/*
* Mac OS X 10.x uses Darwin x.0.0. Mac OS X 10.x.y uses Darwin
* x.y.0 (except that 10.6.1 appears to have a uname version
* Mac OS X 10.x uses Darwin {x+4}.0.0. Mac OS X 10.x.y uses Darwin
* {x+4}.y.0 (except that 10.6.1 appears to have a uname version
* number of 10.0.0, not 10.1.0 - go figure).
*/
if (strcmp(osinfo.release, "10.0.0") == 0 ||
strcmp(osinfo.release, "10.1.0") == 0 ||
strcmp(osinfo.release, "10.3.0") == 0)
need_timeout_workaround = 1;
if (strncmp(osinfo.release, "10.", 3) == 0) {
/*
* OK, it's Snow Leopard - which version?
*/
if (strcmp(osinfo.release, "10.2.0") != 0) {
/* Not 10.6.2. */
need_timeout_workaround = TRUE;
}
}
}
#endif