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

This commit is contained in:
MissValeska 2014-05-13 19:04:42 -07:00
parent e06db959e8
commit e5eaf16cab
3 changed files with 6 additions and 17 deletions

View File

@ -21,8 +21,8 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h> #include <errno.h>

View File

@ -552,8 +552,6 @@ int new_socket(int sock_type)
return -1; return -1;
} }
printf("Socket FD: %i ", sockfd);
return sockfd; return sockfd;
} }

View File

@ -325,35 +325,27 @@ void free_server_opt(void)
} }
void exclude_interface(void) { void exclude_interface(void) {
char *a_ifs; char *a_ifs = NULL;
char *old_tmp; char *old_tmp = NULL;
struct ifaddrs *addrs,*tmp; struct ifaddrs *addrs,*tmp;
getifaddrs(&addrs); getifaddrs(&addrs);
tmp = addrs; tmp = addrs;
int run_c = 1; int run_c = 1;
printf("omg\n");
while(tmp) { while(tmp) {
old_tmp = a_ifs; old_tmp = a_ifs;
if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET) if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
a_ifs = tmp->ifa_name; a_ifs = tmp->ifa_name;
printf("wtf\n");
if(strncmp(a_ifs, "lo", 2) == 0 || strncmp(a_ifs, "tunl0", 5) == 0 || strncmp(a_ifs, "tunl1", 5) == 0 || strcmp(a_ifs, optarg) == 0) { if(strncmp(a_ifs, "lo", 2) == 0 || strncmp(a_ifs, "tunl0", 5) == 0 || strncmp(a_ifs, "tunl1", 5) == 0 || strcmp(a_ifs, optarg) == 0) {
tmp = tmp->ifa_next; tmp = tmp->ifa_next;
if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET) if(tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
a_ifs = tmp->ifa_name; a_ifs = tmp->ifa_name;
printf("dun be meanie\n");
} }
printf("weirdness\n");
tmp = tmp->ifa_next; tmp = tmp->ifa_next;
run_c++; run_c++;
if(strcmp(old_tmp, a_ifs) == 0) { if(strcmp(old_tmp, a_ifs) == 0)
printf("True\n");
break; break;
}
printf("why so mean? D:\n");
server_opt.ifs[server_opt.ifs_n++]=xstrndup(a_ifs, IFNAMSIZ-1); server_opt.ifs[server_opt.ifs_n++]=xstrndup(a_ifs, IFNAMSIZ-1);
} }
@ -385,8 +377,8 @@ void parse_options(int argc, char **argv)
{"debug", 0, 0, 'd'}, {"debug", 0, 0, 'd'},
{"version", 0, 0, 'v'}, {"version", 0, 0, 'v'},
{"kill", 0, 0, 'k'}, {"kill", 0, 0, 'k'},
{"exclude", 1, 0, 'e'}, {"exclude", 1, 0, 'e'},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
@ -402,7 +394,6 @@ void parse_options(int argc, char **argv)
exit(0); exit(0);
break; break;
case 'e': case 'e':
printf("hey\n");
exclude_interface(); exclude_interface();
break; break;
case 'k': case 'k':