mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 22:01:23 -06:00
[GH-ISSUE #32] IPv6 Connections refused to Linux server #24
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ramesh45345 on GitHub (Apr 27, 2018).
Original GitHub issue: https://github.com/debauchee/barrier/issues/32
Referencing issue #18, when connecting to an Ubuntu 18.04 server running barriers (git master
0b5ca57b), a Fedora 27 client (same barrier version) connecting via IPv6 (resolved from the avahi hostname resolution as well as router hostname resolution) receives a connection refused message. Both the server and client are using SSL, and both work fine when an IPv4 address is hard-coded. The following log is generated on the client (Fedora 27):The following log is generated on the server running Ubuntu 18.04 (basically nothing, since the server doesn't hear anything from the client):
Note: The openssl version on the server is as follows:
Operating Systems
Server: Ubuntu 18.04
Client: Fedora 27
Both updated to latest software from repositories.
Barrier Version
git master
0b5ca57b, compiled on their respective machines. After upgrading to Ubuntu 18.04, barrier was recompiled as a precaution.Steps to reproduce bug
Other info
Bug doesn't prevent me from using barrier, however it is inconvenient since hostname resolution is IPv6 first on all my networks, and then IPv4. As a workaround, I'm not sure if barrier can ask for an IPv6 address first from avahi, and then an IPv4 address?
@walker0643 commented on GitHub (Apr 28, 2018):
HI @ramesh45345 -
This is a very well-written bug report. Thank you! We're currently short on IPv6 developers but I've asked a couple people to have a look at this. Hopefully we can get you up and running shortly. Stay tuned!
@AdrianKoshka commented on GitHub (Apr 28, 2018):
If it helps any, I know IPv6 works on barrier, I have my server bound to
::1. (client remote port-forwards connection over SSH and connects). I could also test to see if synergy connects of a/127prefix IPv6 address. I would test over a normal/64but my ISP has broken DHCPv6-PD and I haven't called them to fix it, and too lazy to setup an internal/64@ramesh45345 commented on GitHub (Apr 29, 2018):
Thanks a bunch @walker0643 . I think this should be easily reproducible, I have another set of machines using barrier (Ubuntu 18.04 on the client, and Fedora 27 on the server, the reverse of my bug report above), and seem to have the same problem. Connection refused when I use the avahi IPv6 autoconfigured address. @AdrianKoshka , what git revision of barrier are you using (or released version, if applicable)? Perhaps I should test an older version and see if I have the same problem.
@AdrianKoshka commented on GitHub (Apr 29, 2018):
Release
2.0.0@ramesh45345@AdrianKoshka commented on GitHub (Apr 29, 2018):
So I tested with this setup and it worked (used SSL):
::40/127Fedora 27::41/127Debian 9 stretchOf course, I sepcified the IPv6 address(es) for both client and server in my systemd template user unit.
barriers@::40.servicebarrierc@::40.serviceReplication
If you want a quick and dirty way to replicate what I did.
Server:
sudo ip addr add dev enp1s0 ::40/127(replaceenp1s0with your interfaces' name)barriers --address ::40 --enable-crypto --no-restart --no-daemon --config /path/to/your/configClient:
sudo ip addr add dev enp2s0 ::41/127(replaceenp2s0with your intefaces' name)barrierc --enable-crypto --no-restart --no-daemon ::40Cleanup:
barriersandbarriercsudo ip addr del dev enp1s0 ::40/127(replace::40with::41on the client, andenp1s0with your intefaces' name)@ramesh45345 commented on GitHub (May 8, 2018):
@AdrianKoshka Thanks for the insight, I should have tested the CLI apps before. I have tested IPv6 and it seems to work when I call it from the command line for git version
5e19820(which is the closest to 2.0.0), as well as master (b43581c). I am using the below command for the server (Fedora 28):And the below command for the client (Fedora 28 as well):
I believe there are two things going on here:
barrierson the server.b43581c(when both the server and client are running via Barrier GUI), the client's barrierc log from the GUI gives an "unknown error" when trying to connect:Notice the repeated 24800 port above. I would bet that has something to do with the problem. In my entry for the client in the GUI, I have omitted the port altogether (I only filled an IPv6 address). I think the GUI is doing the duplication.
@walker0643 I guess I have two questions:
barriercdoes not duplicate the port like in the GUI output above.@wltjr commented on GitHub (May 8, 2018):
Just to chime in here, I did not author, but I did update the IPv6 patches for Synergy. Which I believe is the basis for this in Barrier. Looking back over that patch in symless/synergy-core/pull/6178. Even in the original symless/synergy-core/pull/4499. It was just patching lib, client and server, not gui. Based on that, it seems there may have been further IPv6 changes done as part of the work in Barrier.
@walker0643 that may be a partial answer to your question 2. Seems they furthered the code into the GUI and something maybe off there. Which is why one works and the other does not.
I can see about taking a look there, but not sure if I can help at all. I was contacted regarding the patches and this issue. Thus chiming in, and I am happy to help if I can.
@walker0643 commented on GitHub (May 10, 2018):
It's entirely possible that the GUI is to blame. The GUI does not open any sockets nor do any real networking itself, it simply starts barriers/barrierc (and barrierd on windows) and passes configuration params as arguments.
@ramesh45345 Can you enable debugging info in the GUI settings window (any level INFO and above iirc) and compare the arguments that it passes to barriers/barrierc to those that you were using above?
@wltjr commented on GitHub (May 10, 2018):
I would assume something is being passed incorrectly from UI to CLI, however that is done. It seemed above a port was duplicated. I do not use any UI with synergy, just text config and starting via cli. That part should be good to go with any IPv6 address.
@ramesh45345 commented on GitHub (May 10, 2018):
@walker0643 Here is the output from the server:
I think in modern versions of barriers the ":24000" is unnecessary? In my command line post earlier, I fed an IPv6 address into barriers, however ideally I would have wanted to accept connections from alll IPv6 and IPv4 addresses.
@walker0643 commented on GitHub (May 10, 2018):
That's very helpful. Can you test the dualstacked branch to see if it fixes this?
https://github.com/debauchee/barrier/tree/dualstacked
@ramesh45345 commented on GitHub (May 11, 2018):
Hmm, using the dualstacked branch (4806a66a), I am still getting the same result.
Server command:
Client log (same version, 4806a66a):
Looks like the GUI is still not listening on IPv6 by default. IPv4 still works normally. The above client log was taken with avahi resolution of the IPv6 address. It seems that if you fill in the IPv6 address into the client GUI manually, it still duplicates the port:
@walker0643 commented on GitHub (May 12, 2018):
Take 2 ... this time barriers will tell you explicitly which socket family it's using. There will be a NOTE-level line in the debug output stating either
or
Also you can confirm via netstat or another similar tool (netstat -46l for example) whether or not barrier has opened the correct socket type.
@ramesh45345 commented on GitHub (May 12, 2018):
Excellent! It works! It did start in IPv6/IPv4 mode, and the client was able to connect using the avahi name resolution.
Server:
There is only one small issue remaining, and that is manually inputting an IPv6 address into the client GUI's "Server IP" field. It still yields the following results in 5bc3fef8:
I admit that I probably won't rely on this much, but I can see this bug needing to be fixed at some point. I believe the way it is working right now, for an IPv6 address, I can't specify the port using the command line in order for it to connect properly. For example, using the following command (without the GUI) on the client works:
However, this results in the port error seen above:
I suspect the issue is specifc to parsing the semi-colons in IPv6 addresses (a wild guess on my part). Might explain why hostnames or IPv4 addresses work just fine with ports.
@yupi2 commented on GitHub (May 12, 2018):
Wrapping the IPv6 address in brackets seems to be the notation used to separate port and address (since IPv6 uses colons). https://serverfault.com/questions/205793/how-can-one-distinguish-the-host-and-the-port-in-an-ipv6-url
Would need to change parsing in
24987e0694/src/lib/net/NetworkAddress.cpp (L60)and then make the GUI put brackets around IPv6 addresses (with the port outside the brackets) I imagine.
@walker0643 commented on GitHub (May 12, 2018):
Among other cleanup and bookkeeping items I also added today (what I hope is) a fix for the host:port argument issue you mentioned. Take a look and please let me know if you see anything else related that needs to be addressed before merging. Thanks!
@ramesh45345 commented on GitHub (May 12, 2018):
No further complaints from me, 92e8e1e seems to be working regarding everything reported above. Thanks a bunch for your work on this, its a really appreciated fork of the synergy codebase.