On 18/08/10 13:17, Brad Campbell wrote:
> Is there a way to force gtkg to always make connections *from* a specified 
> port in addition to
> listening on the configured port? (or 2 ports, or whatever).
>
> I'm playing with some funky traffic shaping rules, and I'd like to be able to 
> guarantee gtkg a
> minimum download bandwidth. Problem is I can only mark packets from remote 
> initiated connections as
> all the locally initiated ones come from random source ports.
>

Just to reply to myself, in src/core/socket.c -> socket_connect_finalize() I 
forced the socket with

socket_addr_set(&local, ipv4_unspecified, 2003);
bind(s->file_desc, socket_addr_get_const_sockaddr(&local),len)

prior to the connect()

And this has achieved the required outcome.
I could not have gtkg listen on 2002 and bind outgoing on 2002 simultaneously 
with this nasty hack, 
but I got 2002+2003 which serves my purpose immediately.

It might be an interesting option for a future wishlist I guess, but for now 
I'm sorted.

Cheers :)
Brad
-- 
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to