]> Sergey Matveev's repositories - dht-bootstrap.git/blobdiff - dht-bootstrap.c
Remove unused global variable: ones.
[dht-bootstrap.git] / dht-bootstrap.c
index a282b782abdcbd63e691e7bfe16f237d83959d11..9a436705dfb85535ebc97fc5eba08197b374dd7a 100644 (file)
@@ -114,11 +114,6 @@ static int parse_message(const unsigned char *buf, int buflen,
                          int *want_return);
 
 static const unsigned char zeroes[20] = {0};
-static const unsigned char ones[20] = {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF
-};
 static const unsigned char v4prefix[16] = {
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0
 };
@@ -470,8 +465,8 @@ main(int argc, char **argv)
         }
 
         /* BEP-32 mandates that we should bind this socket to one of our
-           global IPv6 addresses.  In this simple example, this only
-           happens if the user used the -b flag. */
+           global IPv6 addresses.  In this program, this only happens if
+           the user used the -b flag. */
 
         memset(&sin6, 0, sizeof(sin6));
         sin6.sin6_family = AF_INET6;
@@ -599,7 +594,7 @@ main(int argc, char **argv)
             unsigned short port;
             unsigned char values[2048], values6[2048];
             int values_len = 2048, values6_len = 2048;
-            int want, want4, want6;
+            int want;
             struct sockaddr_storage source_storage;
             struct sockaddr *source = (struct sockaddr*)&source_storage;
             socklen_t sourcelen = sizeof(source_storage);
@@ -645,14 +640,6 @@ main(int argc, char **argv)
                 }
             }
 
-            if(want > 0) {
-                want4 = (want & WANT4);
-                want6 = (want & WANT6);
-            } else {
-                want4 = source->sa_family == AF_INET;
-                want6 = source->sa_family == AF_INET6;
-            }
-
             switch(message) {
             case REPLY:
                 if(tid_len != 4) {