Changeset 4028


Ignore:
Timestamp:
Dec 1, 2007, 5:01:02 AM (15 years ago)
Author:
charles
Message:

get nat-pmp working again in Leopard. Thanks to Chinstrap for tracking down the problem & submitting a patch. See the comment in this changeset for more details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r3552 r4028  
    211211    memset( &sock, 0, sizeof( sock ) );
    212212    sock.sin_family      = AF_INET;
    213     sock.sin_addr.s_addr = INADDR_ANY;
     213
     214    /* Leopard closes a SO_REUSEADDR + INADDR_ANY hole, so we can't
     215     * use INADDR_ANY when binding for nat-pmp. For details, refer to
     216     * http://www.uwsg.indiana.edu/hypermail/linux/kernel/9902.1/0828.html .
     217     * This can probably be done cleaner, but since we're only using SOCK_DGRAM
     218     * for nat-pmp, this quick fix should work. */
     219    if ( SOCK_DGRAM == type )
     220        sock.sin_addr.s_addr = inet_addr("224.0.0.1");
     221    else
     222        sock.sin_addr.s_addr = INADDR_ANY;
     223
    214224    sock.sin_port        = htons( port );
    215225
Note: See TracChangeset for help on using the changeset viewer.