Use a TUN device and embedded PPP code, instead of using pppd#1048
Use a TUN device and embedded PPP code, instead of using pppd#1048DimitriPapadopoulos wants to merge 12 commits into
Conversation
6336f54 to
996fe3d
Compare
996fe3d to
78c6741
Compare
|
I get these warnings while setting routes after connection: I get this error when cleaning up because openfortivpn still attempts to terminate `pppd``: |
becea66 to
ffa926a
Compare
249fb94 to
9b5b6f5
Compare
|
thank you for applying the TUN patch from @rain2fog. I have just ran a couple of short tests and this appears to work like a charm. Because I use openfortivpn daily I will use this tun branch build from now on to see how it performs. Because I can create a tun device as a normal user I will be running openfortivpn without sudo. Cheers! |
9b5b6f5 to
2dec255
Compare
|
thank you for the update, will test further with this rev. g2dec255 version. First glance TUN tunnel still working and Route to gateway exists already warnings are also still there. Cheers! |
|
Yes, I probably won't have time to look into the warnings any time soon. You are welcome to suggest a pull request to fix them. |
6cad092 to
45ca4ae
Compare
|
Fixed compiler warnings, just took a couple |
6f64a4e to
77a8990
Compare
f14da63 to
40923a4
Compare
|
Thanks for the merge. @DimitriPapadopoulos : argh, sorry for the spell issues. I miss this test (I only ran run.sh under test/lint/run.sh) The third restart of the VPN show a small leak, but at least this part is working. I will try to see if I can build something with valgrind to identify the leak. If you have some chance to get this branch running coverity it could be probably good to check for easy to find errors :). Best regards, |
b763753 to
ae037fa
Compare
|
During the WE, the mem leak seems to be very minor (after 9 restarts). However I saw a strange log order in my output and I will try to dig this in the coming days: INFO: Establishing the tunnel We should only have the one after the Setting new routes, not after the Adding VPN nameservers ... ... |
|
Something is broken on the last code version. it drops the default route even if set-routes = 0 and failed to restore it on tunnel restoration ... maybe something broken with unitialized memory ... Edit: Ok I found the issue. Please take care when doing push -f to not drop some commits :/ I don't know where the commit was lost (could be on my side too), but clearly, things get broken at some point :/. Will update my tun branch again in a few minutes. |
93b89ca to
516bb44
Compare
Sorry I missed your comment (I was focused on memory leaks). Adding this ASAP. |
Ok done on the PR #1302 I might create a new PR if you want to split some of them. I still need to work on remaining leaks, but they looks weird, I don't see in the code how it can happen ... |
638ca0b to
a19752b
Compare
b77e92e to
32739d5
Compare
pppd → tun interface + embedded PPP code
Switch from pppd/ppp to a tun device and internal PPP code.
This commit modifies the `merge_config` function to include the 'tun' value from the source configuration if it is set. Previously, this value was not being merged, leading to inconsistencies in the final configuration. The change checks if 'tun' in the source configuration is different from its default value before merging it into the destination configuration. This ensures that the 'tun' setting is correctly propagated when configurations are merged, allowing for more flexible and accurate VPN setups.
* NOTE: the tun options are not yet integrated in the config file. * adding the --tun-ifname option to allow choosing interface name to ease script integrations.
CID 488054 RESOURCE_LEAK Overwriting handle `tunnel.pppd_pty` in `tunnel.pppd_pty = -1` leaks the handle.
32739d5 to
c967c24
Compare
This patch provided by @rain2fog in #801 (comment) works for me. I get a working VPN tunnel without using
pppd. I wouldn't mind help with reviewing.From #801 (comment):
I get complier warnings on Ubuntu 22.04:
Initially opened as #818.
Fixes #801.