]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Accept non-matching subnets also if the computer has an APIPA address
authorc vw <dl1ycf@darc.de>
Wed, 11 Nov 2020 16:23:21 +0000 (17:23 +0100)
committerc vw <dl1ycf@darc.de>
Wed, 11 Nov 2020 16:23:21 +0000 (17:23 +0100)
discovery.c

index 93ac1ec17fc05ca6313faebd71a611066a100396..cdd71f3cd72b775f712efc392ed7cd5917ecfc49 100644 (file)
@@ -479,7 +479,11 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
          // by many radios if they do not get a DHCP address. These addresses are valid even if outside the
          // netmask of the (physical) interface making the connection - so do not complain in this case!
          //
-          if (strncmp(inet_ntoa(d->info.network.address.sin_addr),"169.254.",8)) {
+         // If the radio has a valid IP address but the computer only has an APIPA address, this also
+         // leads to a radio address outside the netmask and can be ignored.
+         //
+          if (strncmp(inet_ntoa(d->info.network.address.sin_addr),"169.254.",8) &&
+              strncmp(inet_ntoa(d->info.network.interface_address.sin_addr),"169.254.",8)) {
             if((d->info.network.interface_address.sin_addr.s_addr&d->info.network.interface_netmask.sin_addr.s_addr) != (d->info.network.address.sin_addr.s_addr&d->info.network.interface_netmask.sin_addr.s_addr)) {
               gtk_button_set_label(GTK_BUTTON(start_button),"Subnet!");
               gtk_widget_set_sensitive(start_button, FALSE);