|
@@ -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':
|