Menu

#75 UDPAssociateServing() use wrong port under the circumstances

v1.0 (example)
open
nobody
None
5
2014-04-14
2014-04-14
iceboy
No

(in SS5Mod_socks5.c line 1652)
When (addr!=ri->DstAddr) && (addr!=ci->SrcAddr), UDPAssociateServing() will use the address of the main socket, which is obtained by

/* Bind ANY (if option set) */
len = sizeof (struct sockaddr_in);
getsockname(ci->Socket,(struct sockaddr *)&serverbind_ssin,&len);

This will incorrectly set the sin_port field to the TCP listening port, resulting in that only one UDP association is allowed, and further connection will have error "address already in use".
The fix can be append the following line

serverbind_ssin.sin_port = htons(0);

Related

Bugs: #75

Discussion

  • Matteo Ricchetti

    Thank you. I'll update the sources.

    ----Messaggio originale----

    Da: iceboy-sjtu@users.sf.net

    Data: 14/04/2014 11.26

    A: "Ticket 75"75@bugs.ss5.p.re.sf.net

    Ogg: [ss5:bugs] #75 UDPAssociateServing() use wrong port under the circumstances

    [bugs:#75] UDPAssociateServing() use wrong port under the circumstances

    Status: open

    Group: v1.0 (example)

    Created: Mon Apr 14, 2014 09:26 AM UTC by iceboy

    Last Updated: Mon Apr 14, 2014 09:26 AM UTC

    Owner: nobody

    (in SS5Mod_socks5.c line 1652)

    When (addr!=ri->DstAddr) && (addr!=ci->SrcAddr), UDPAssociateServing() will use the address of the main socket, which is obtained by

    / Bind ANY (if option set) /
    
    len = sizeof (struct sockaddr_in);
    
    getsockname(ci->Socket,(struct sockaddr *)&serverbind_ssin,&len);
    

    This will incorrectly set the sin_port field to the TCP listening port, resulting in that only one UDP association is allowed, and further connection will have error "address already in use".

    The fix can be append the following line

    serverbind_ssin.sin_port = htons(0);
    

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ss5/bugs/75/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #75


Log in to post a comment.

MongoDB Logo MongoDB