Skip to content
Snippets Groups Projects
Commit 3de5e312 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files
parents 5b7bd59f 5d2b96f5
No related branches found
No related tags found
No related merge requests found
...@@ -843,7 +843,7 @@ void s_ch_packet_in(dap_stream_ch_t* a_ch, void* arg) ...@@ -843,7 +843,7 @@ void s_ch_packet_in(dap_stream_ch_t* a_ch, void* arg)
dap_chain_net_srv_vpn_item_ipv4_t * l_item_ipv4 = l_srv_vpn->ipv4_unleased; dap_chain_net_srv_vpn_item_ipv4_t * l_item_ipv4 = l_srv_vpn->ipv4_unleased;
if ( l_item_ipv4){ if ( l_item_ipv4){
log_it(L_WARNING,"We have unleased ip address"); log_it(L_WARNING,"We have unleased ip address");
l_ch_vpn->addr_ipv4.s_addr = htonl(l_item_ipv4->addr.s_addr); l_ch_vpn->addr_ipv4.s_addr = l_item_ipv4->addr.s_addr;
pthread_rwlock_wrlock( &s_clients_rwlock ); pthread_rwlock_wrlock( &s_clients_rwlock );
HASH_ADD(hh, s_ch_vpn_addrs, addr_ipv4, sizeof (l_ch_vpn->addr_ipv4), l_ch_vpn); HASH_ADD(hh, s_ch_vpn_addrs, addr_ipv4, sizeof (l_ch_vpn->addr_ipv4), l_ch_vpn);
...@@ -940,6 +940,9 @@ void s_ch_packet_in(dap_stream_ch_t* a_ch, void* arg) ...@@ -940,6 +940,9 @@ void s_ch_packet_in(dap_stream_ch_t* a_ch, void* arg)
char str_daddr[43], str_saddr[43]; char str_daddr[43], str_saddr[43];
strncpy(str_saddr, inet_ntoa(in_saddr), sizeof(str_saddr)-1); strncpy(str_saddr, inet_ntoa(in_saddr), sizeof(str_saddr)-1);
strncpy(str_daddr, inet_ntoa(in_daddr), sizeof(str_daddr)-1); strncpy(str_daddr, inet_ntoa(in_daddr), sizeof(str_daddr)-1);
// The packet can't be written, errno == EINVAL !!!
log_it(L_DEBUG, "VPN packet, source: %s; dest: %s", inet_ntoa(in_saddr), inet_ntoa(in_daddr));
int ret; int ret;
//if( ch_sf_raw_write(STREAM_SF_PACKET_OP_CODE_RAW_SEND, sf_pkt->data, sf_pkt->op_data.data_size)<0){ //if( ch_sf_raw_write(STREAM_SF_PACKET_OP_CODE_RAW_SEND, sf_pkt->data, sf_pkt->op_data.data_size)<0){
/*struct sockaddr_in sin = { 0 }; /*struct sockaddr_in sin = { 0 };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment