Browse Source

The Exclude argument should now work, And some unneccesary debugging stuff has been removed.

MissValeska 10 years ago
parent
commit
e5eaf16cab
3 changed files with 6 additions and 17 deletions
  1. 1
    1
      src/includes.h
  2. 0
    2
      src/inet.c
  3. 5
    14
      src/netsukuku.c

+ 1
- 1
src/includes.h View File

@@ -21,8 +21,8 @@
21 21
 
22 22
 #include <string.h>
23 23
 #include <ctype.h>
24
-#include <stdlib.h>
25 24
 #include <stdio.h>
25
+#include <stdlib.h>
26 26
 #include <syslog.h>
27 27
 #include <stdarg.h>
28 28
 #include <errno.h>

+ 0
- 2
src/inet.c View File

@@ -551,8 +551,6 @@ int new_socket(int sock_type)
551 551
 		error("Socket SOCK_STREAM creation failed: %s", strerror(errno));
552 552
 		return -1;
553 553
 	}
554
-
555
-        printf("Socket FD: %i ", sockfd);
556 554
         
557 555
 	return sockfd;
558 556
 }

+ 5
- 14
src/netsukuku.c View File

@@ -325,35 +325,27 @@ void free_server_opt(void)
325 325
 }
326 326
 
327 327
 void exclude_interface(void) {
328
-                      char *a_ifs;
329
-		      char *old_tmp;
328
+                      char *a_ifs = NULL;
329
+		      char *old_tmp = NULL;
330 330
                       struct ifaddrs *addrs,*tmp;
331 331
                       getifaddrs(&addrs);
332 332
                       tmp = addrs;
333 333
 		      int run_c = 1;
334
-                      printf("omg\n");
335 334
                       while(tmp) {
336 335
 			    old_tmp = a_ifs;
337 336
 
338 337
                             if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
339 338
                                     a_ifs = tmp->ifa_name;
340
-
341
-                            printf("wtf\n");
342 339
                             
343 340
                                 if(strncmp(a_ifs, "lo", 2) == 0 || strncmp(a_ifs, "tunl0", 5) == 0 || strncmp(a_ifs, "tunl1", 5) == 0 || strcmp(a_ifs, optarg) == 0) {
344 341
                                         tmp = tmp->ifa_next;
345 342
                                         if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
346 343
                                             a_ifs = tmp->ifa_name;
347
-                                        printf("dun be meanie\n");
348 344
                                     }
349
-                            printf("weirdness\n");
350 345
                             tmp = tmp->ifa_next;
351 346
 			    run_c++;
352
-			    if(strcmp(old_tmp, a_ifs) == 0) {
353
-                                        printf("True\n");
347
+			    if(strcmp(old_tmp, a_ifs) == 0)
354 348
 					break;
355
-				}
356
-                            printf("why so mean? D:\n");
357 349
 			    server_opt.ifs[server_opt.ifs_n++]=xstrndup(a_ifs, IFNAMSIZ-1);
358 350
                           }
359 351
 
@@ -385,8 +377,8 @@ void parse_options(int argc, char **argv)
385 377
 
386 378
 			{"debug", 	0, 0, 'd'},
387 379
 			{"version",	0, 0, 'v'},
388
-			{"kill", 0, 0, 'k'},
389
-                        {"exclude", 1, 0, 'e'},
380
+			{"kill",        0, 0, 'k'},
381
+                        {"exclude",     1, 0, 'e'},
390 382
 			{0, 0, 0, 0}
391 383
 		};
392 384
 
@@ -402,7 +394,6 @@ void parse_options(int argc, char **argv)
402 394
 				exit(0);
403 395
 				break;
404 396
                         case 'e':
405
-                                printf("hey\n");
406 397
                                 exclude_interface();
407 398
                                 break;
408 399
                         case 'k':

Loading…
Cancel
Save