Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dicovery routine incompatible with wireguard #103

Open
zvpunry opened this issue May 29, 2021 · 1 comment
Open

dicovery routine incompatible with wireguard #103

zvpunry opened this issue May 29, 2021 · 1 comment

Comments

@zvpunry
Copy link

zvpunry commented May 29, 2021

It is easy to replicate, just create a wireguard interface and linhpsdr exits with the message:

discover: looking for HPSDR devices on wg0
discover: bound to wg0
discover: sendto socket failed for discovery_socket
: Required key not available

The solution is to continue after ENOKEY errors, something like this:

diff --git a/protocol1_discovery.c b/protocol1_discovery.c
index 7d833c7..43bf53e 100644
--- a/protocol1_discovery.c
+++ b/protocol1_discovery.c
@@ -117,7 +117,7 @@ static void discover(struct ifaddrs* iface) {
 
     if(sendto(discovery_socket,buffer,63,0,(struct sockaddr*)&to_addr,sizeof(to_addr))<0) {
         perror("discover: sendto socket failed for discovery_socket\n");
-        if(errno!=EHOSTUNREACH && errno!=EADDRNOTAVAIL) {
+        if(errno!=EHOSTUNREACH && errno!=EADDRNOTAVAIL && errno!=ENOKEY) {
             exit(-1);
         }
     }

I think it is the easiest when you test it and edit your own source tree, so I don't need to push it somewhere.

@zvpunry
Copy link
Author

zvpunry commented May 29, 2021

I should have tested to run it with that change... there is copy&paste code in protocol2_discovery.c that also needs to be fixed.

DL1GG added a commit to DL1GG/linhpsdr that referenced this issue May 21, 2023
Added wireguard compability, as of

g0orx#103
DL1GG added a commit to DL1GG/linhpsdr that referenced this issue May 21, 2023
Added wireguard compability, as of

g0orx#103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant