View previous topic :: View next topic |
Author |
Message |
poy
Joined: 12 Dec 2010 Posts: 5
|
Posted: Fri Apr 08, 2011 5:00 pm Post subject: Binding to a specific network interface |
|
|
hi,
in DC++, we have been using MiniUPnP for several months, and it has been working very well so far! (there is a praiseful post at the bottom of https://bugs.launchpad.net/dcplusplus/+bug/230973 which would certainly be deserved for MiniUPnP as well.)
there is a setting in DC++ called "bind address", which can be filled with the IP of one of the network cards connected to the computer. the setting is then used instead of INADDR_ANY in socket bind calls.
i would like to know whether this setting could be useful to apply to UPnP (and to NAT-PMP too since we have just added libnatpmp as well).
here is a case where such a network selection setting could solve a user problem: https://bugs.launchpad.net/dcplusplus/+bug/748623
i have tried to use the "multicastif" param of the "upnpDiscover" function to specify the bind address setting, but that doesn't seem to take.
is it useful for UPnP / NAT-PMP to select the network device to bind to? if so, is there a way to force such a setting with MiniUPnP / libnatpmp?
thanks for any pointers. |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1544
|
Posted: Mon Apr 11, 2011 1:59 pm Post subject: |
|
|
yep, the multicastif parameter of upnpDiscover() should make it...
The multicast packets will be sent using this interface, and that should allow you to discover the UPnP device.
Once the discovery process is done, all communication with the UPnP device is done via HTTP so no need to specify which interface to use, the TCP/IP stack will route the packet correctly
Have you more details on the setup where this is not working ? _________________ Main miniUPnP author.
http://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
poy
Joined: 12 Dec 2010 Posts: 5
|
Posted: Mon Apr 11, 2011 7:49 pm Post subject: |
|
|
my bad, i was using the wrong IP when calling UPNP_AddPortMapping!
thanks for a great lib!  |
|
Back to top |
|
 |
|