Quellcode durchsuchen

Use only IPv4 by default.

Unfortunately there are some useless IPv6 trackers that will
be used instead of their more usefull IPv4 counterparts when
IPv6 is enabled.

The -4 and -6 options are tweaked once again. If -6 is given
only IPv6 will be used. If both are given both will be used
and otherwise only IPv4 will be used.

The IPvX stuff should probably be set per torrent in the future.
master
Richard Nyberg vor 16 Jahren
Ursprung
Commit
747c80fbb1
2 geänderte Dateien mit 14 neuen und 10 gelöschten Zeilen
  1. +13
    -9
      btpd/main.c
  2. +1
    -1
      btpd/opts.c

+ 13
- 9
btpd/main.c Datei anzeigen

@@ -103,10 +103,11 @@ usage(void)
"\n"
"Options:\n"
"-4\n"
"\tOnly use IPv4. Both IPv4 and IPv6 are enabled by default.\n"
"\tUse IPv4. If given in conjunction with -6, "
"both versions are used.\n"
"\n"
"-6\n"
"\tOnly use IPv6. Both IPv4 and IPv6 are enabled by default.\n"
"\tUse IPv6. By default IPv4 is used.\n"
"\n"
"--bw-in n\n"
"\tLimit incoming BitTorrent traffic to n kB/s.\n"
@@ -184,17 +185,17 @@ int
main(int argc, char **argv)
{
char *dir = NULL, *log = NULL;
int daemonize = 1;
int daemonize = 1, opt4 = 0, opt6 = 0;

for (;;) {
switch (getopt_long(argc, argv, "46d:p:", longopts, NULL)) {
case -1:
goto args_done;
case '6':
net_ipv4 = 0;
break;
case '4':
net_ipv6 = 0;
opt4 = 1;
break;
case '6':
opt6 = 1;
break;
case 'd':
dir = optarg;
@@ -247,8 +248,11 @@ args_done:
argc -= optind;
argv += optind;

if (!net_ipv4 && !net_ipv6)
btpd_err("You need to enable at least one ip version.\n");
if (opt6) {
net_ipv6 = 1;
if (!opt4)
net_ipv4 = 0;
}

if (argc > 0)
usage();


+ 1
- 1
btpd/opts.c Datei anzeigen

@@ -16,4 +16,4 @@ int ipcprot = 0600;
int empty_start = 0;
const char *tr_ip_arg;
int net_ipv4 = 1;
int net_ipv6 = 1;
int net_ipv6 = 0;

Laden…
Abbrechen
Speichern