Giter Site home page Giter Site logo

teainside / teavpn2 Goto Github PK

View Code? Open in Web Editor NEW
52.0 10.0 11.0 11.54 MB

TeaVPN2 - An open source VPN Software (currently supported platform is only Linux).

License: GNU General Public License v2.0

Makefile 3.36% C 96.64%
network tunnel vpn vpn-server vpn-client linux netfilter tor-network hacktoberfest

teavpn2's Introduction

TeaVPN2

TeaVPN2 is an open source VPN Software. Current supported platform is only Linux. We plan to expand to other platforms (contributors are welcomed).

Build Requirements

  • GNU Make 4.3
  • gcc 9.3+ or clang 11+

Build

sudo apt-get install gcc clang make build-essential -y;
git clone https://github.com/TeaInside/teavpn2;
cd teavpn2;
make -j$(nproc);

For build with GUI support:

./configure --gui;
make -j$(nproc);

Issues

We welcome bug reports, feature requests and questions through GitHub repository https://github.com/TeaInside/teavpn2 (kindly to open an issue).

Project Maintainer

Community

We are online on Telegram, see https://t.me/TeaInside

Contributing

We accept pull request on the GitHub repository.

License

This software is licensed under the GNU GPL-v2 license.

teavpn2's People

Contributors

alviroiskandar avatar ammarfaizi2 avatar artagnon avatar gitster avatar gregkh avatar ii64 avatar khaerulilham avatar louvian avatar meyering avatar mignolo avatar rlapz avatar wking avatar wtarreau avatar zxce3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teavpn2's Issues

An improper locking bug(e.g., deadlock) on the lock state->mutex

Hi, developers, thank you for your checking. It seems the lock state->mutex is not released correctly when unlikely(err != 0) in the function init_thread?

pthread_mutex_lock(&state->mutex);
/* Give the lock to the thread */
state->mutex_own = true;
memset(&attr, 0, sizeof(attr));
err = pthread_attr_init(&attr);
if (unlikely(err != 0)) {
err = (err < 0) ? -err : err;
pr_err("pthread_attr_init: " PRERF, PREAR(err));
return -1;
}

[UDP] Having multiple clients at once makes the client sometimes freeze

I found that when the server is handling multiple connections at once, the VPN client sometimes freezes until it reaches timeout and closes everything.

I don't have more info about what is going on now. It seems we have a nasty session logic bug in the server side.

Stay tuned. I should figure out soon what is happening...

I am going to use this issue as a placeholder to add more info as I better understand what has broken with the current session handling.

[TCP server] Multithreading support

I am going to develop multithreading support for TCP server, it will yield massive breaking changes, so we will skip 0.0.1 and jump to 0.1.0.

Need guide to contribute

Please guide the contributors how to contribute to this repository, start by explaining technical line about the program maybe?

I found the data corruption culprit!

We have been testing TeaVPN2 and still can't achieve a stable connection state when the traffic is crowded. I suspected there is data corruption in the event loop. Today I found the problem, and it is indeed data corruption.

This data corruption will not be detected by Valgrind, because the read/write to memory is all done legally to the correct memory address. However, the read/write mechanism is not legal for the event loop.

Below is the explanation (image attached):

teavpn_invalid_pakcet

An improper locking bug(e.g., deadlock) on the lock client->mutex

Hi, developers, thank you for your checking. It seems the lock client->mutex is not released correctly when unlikely(!client->is_used) in the function destroy_state?

pthread_mutex_lock(&client->mutex);
}
if (unlikely(!client->is_used))
goto clear;
prl_notice(0, "Closing clients[%d].cli_fd (%d)",
max_conn, client->cli_fd);
close(client->cli_fd);
if (likely(client->mt_act)) {
pthread_mutex_unlock(&client->mutex);
pthread_mutex_destroy(&client->mutex);
}
clear:
memset(client, 0, sizeof(struct tcp_client));
}

Fix help output

ii64 <[email protected]> has got bad experience due to lack of help output
https://t.me/TeaInside/43726

Note for myself (Ammar):
Don't forget to fix the basic help. Next time when you ask someone to test your code, make sure everything is well prepared, so they don't get bad experience.

`ret` maybe uninitialized in `put_udp_session`

@ammarfaizi2, in commit 667576c ("udp_session.c: implement put_udp_session") you forgot to initialize the int ret. If state->sess_map is NULL, you will return an uninitialized value.

int put_udp_session(struct srv_udp_state *state, struct udp_sess *cur_sess)
__acquires(&state->sess_stk_lock)
__releases(&state->sess_stk_lock)
{
int ret;
mutex_lock(&state->sess_stk_lock);
BUG_ON(bt_stack_push(&state->sess_stk, cur_sess->idx) == -1);
if (state->sess_map)
ret = remove_sess_from_bkt(state, cur_sess);
reset_udp_session(cur_sess, cur_sess->idx);
mutex_unlock(&state->sess_stk_lock);
atomic_fetch_sub(&state->active_sess, 1);
return ret;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.