Skip to content

Commit

Permalink
port also copied from sock in managed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ianamason committed Aug 11, 2014
1 parent 69e9e1d commit 2d4ac59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/protocol/chop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ void chop_config_t::socks_force_addr(const char* host, int port) {

for (vector<struct evutil_addrinfo *>::iterator i = down_addresses.begin();
i != down_addresses.end(); i++) {
// just change the addresses, keep the ports the same

struct sockaddr_in* daddr = (struct sockaddr_in*) ((*i)->ai_addr);
daddr->sin_addr.s_addr = ((struct sockaddr_in*) addr->ai_addr)->sin_addr.s_addr;
daddr->sin_port = ((struct sockaddr_in*) addr->ai_addr)->sin_port;
}

evutil_freeaddrinfo(addr);
Expand Down

0 comments on commit 2d4ac59

Please sign in to comment.