mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
opm: properly connect to destination port on scan
This commit is contained in:
parent
d86692fa44
commit
8aacefa338
1 changed files with 8 additions and 1 deletions
|
@ -333,6 +333,13 @@ establish_connection(struct auth_client *auth, struct opm_proxy *proxy)
|
|||
switch(proxy->proto)
|
||||
{
|
||||
case PROTO_SOCKS4:
|
||||
#ifdef RB_IPV6
|
||||
if(GET_SS_FAMILY(&auth->c_addr) == AF_INET6)
|
||||
{
|
||||
rb_free(scan);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
callback = socks4_connected;
|
||||
break;
|
||||
case PROTO_SOCKS5:
|
||||
|
@ -365,7 +372,7 @@ establish_connection(struct auth_client *auth, struct opm_proxy *proxy)
|
|||
(void)setsockopt(rb_get_fd(scan->F), IPPROTO_TCP, TCP_NODELAY, (char *)&opt, sizeof(opt));
|
||||
|
||||
SET_SS_PORT(&l_a, 0);
|
||||
SET_SS_PORT(&c_a, GET_SS_PORT(&listener->addr));
|
||||
SET_SS_PORT(&c_a, htons(proxy->port));
|
||||
|
||||
rb_dlinkAdd(scan, &scan->node, &lookup->scans);
|
||||
rb_connect_tcp(scan->F,
|
||||
|
|
Loading…
Reference in a new issue