miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Allow Specify Network Interface to Work ON

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Feature Request
View previous topic :: View next topic  
Author Message
test0x01



Joined: 29 Dec 2011
Posts: 3

PostPosted: Thu Dec 29, 2011 6:44 am    Post subject: Allow Specify Network Interface to Work ON Reply with quote

upnpc has a -m option to allow sending SSDP multicast packets.
But, the situation I met is that I have more than two WAN interfaces having same IP address. So, when I run unpnc, the interface it works on is determined by iptables.

I would suggest adding another option to allow specify network interface.
E.g.

upnpc -l -i wlan0
upnpc -i wlan0 -a 192.168.0.2 22 22 TCP


Thank you!
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1431

PostPosted: Mon Jan 02, 2012 10:56 am    Post subject: Reply with quote

That would be nice indeed, but the problem is the code is using setsockopt(..., IPPROTO_IP, IP_MULTICAST_IF, ...) which is taking an IP address as argument.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
test0x01



Joined: 29 Dec 2011
Posts: 3

PostPosted: Thu Jan 05, 2012 9:34 am    Post subject: Could you please see if this solution works Reply with quote

There are some documents saying that multicast interface can be specified by interface index. setsockopt can accpet an instance of ip_mreqn instead of ip address.

Please see the following links for more information about ip_mreqn and setsockopt(..., IPPROTO_IP, IP_MULTICAST_IF, ...) .

http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?ip+4
http://www.kernel.org/doc/man-pages/online/pages/man7/ip.7.html

Hopefully this information helps.
Thank you.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1431

PostPosted: Sat Jan 07, 2012 10:19 am    Post subject: Re: Could you please see if this solution works Reply with quote

test0x01 wrote:
There are some documents saying that multicast interface can be specified by interface index. setsockopt can accpet an instance of ip_mreqn instead of ip address.

Please see the following links for more information about ip_mreqn and setsockopt(..., IPPROTO_IP, IP_MULTICAST_IF, ...) .

http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?ip+4
http://www.kernel.org/doc/man-pages/online/pages/man7/ip.7.html

Hopefully this information helps.
Thank you.

Thanks, I tested and it works on Linux but "struct ip_mreqn" is not defined on all systems.
For example it is not available on OpenBSD.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1431

PostPosted: Sat Jan 07, 2012 10:42 am    Post subject: Reply with quote

updated code is available on github :
https://github.com/miniupnp/miniupnp
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
test0x01



Joined: 29 Dec 2011
Posts: 3

PostPosted: Mon Jan 09, 2012 4:43 am    Post subject: Reply with quote

thank you. I am so glad that it works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Feature Request All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.