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
 
21
 
22
 #include <string.h>
22
 #include <string.h>
23
 #include <ctype.h>
23
 #include <ctype.h>
24
-#include <stdlib.h>
25
 #include <stdio.h>
24
 #include <stdio.h>
25
+#include <stdlib.h>
26
 #include <syslog.h>
26
 #include <syslog.h>
27
 #include <stdarg.h>
27
 #include <stdarg.h>
28
 #include <errno.h>
28
 #include <errno.h>

+ 0
- 2
src/inet.c View File

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

+ 5
- 14
src/netsukuku.c View File

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

Loading…
Cancel
Save