mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
use PMP_MCAST_ADDR, instead of a hardcoded address, in net.c
This commit is contained in:
parent
78f3c40484
commit
f534d0929c
3 changed files with 4 additions and 2 deletions
|
@ -41,7 +41,6 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#define PMP_PORT 5351
|
#define PMP_PORT 5351
|
||||||
#define PMP_MCAST_ADDR "224.0.0.1"
|
|
||||||
#define PMP_INITIAL_DELAY 250 /* ms, 1/4 second */
|
#define PMP_INITIAL_DELAY 250 /* ms, 1/4 second */
|
||||||
#define PMP_TOTAL_DELAY 120000 /* ms, 2 minutes */
|
#define PMP_TOTAL_DELAY 120000 /* ms, 2 minutes */
|
||||||
#define PMP_VERSION 0
|
#define PMP_VERSION 0
|
||||||
|
|
|
@ -36,4 +36,6 @@ void tr_natpmpRemoveForwarding( tr_natpmp * );
|
||||||
void tr_natpmpPulse( tr_natpmp *, int * );
|
void tr_natpmpPulse( tr_natpmp *, int * );
|
||||||
void tr_natpmpClose( tr_natpmp * );
|
void tr_natpmpClose( tr_natpmp * );
|
||||||
|
|
||||||
|
#define PMP_MCAST_ADDR "224.0.0.1"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
#include "transmission.h"
|
#include "transmission.h"
|
||||||
#include "fdlimit.h"
|
#include "fdlimit.h"
|
||||||
|
#include "natpmp.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
@ -217,7 +218,7 @@ tr_netBind( int port, int type )
|
||||||
* This can probably be done cleaner, but since we're only using SOCK_DGRAM
|
* This can probably be done cleaner, but since we're only using SOCK_DGRAM
|
||||||
* for nat-pmp, this quick fix should work. */
|
* for nat-pmp, this quick fix should work. */
|
||||||
if ( SOCK_DGRAM == type )
|
if ( SOCK_DGRAM == type )
|
||||||
sock.sin_addr.s_addr = inet_addr("224.0.0.1");
|
sock.sin_addr.s_addr = inet_addr( PMP_MCAST_ADDR );
|
||||||
else
|
else
|
||||||
sock.sin_addr.s_addr = INADDR_ANY;
|
sock.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue