diff options
-rw-r--r-- | doc/man/gnunet-vpn.1 | 4 | ||||
-rw-r--r-- | src/vpn/gnunet-vpn.c | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/doc/man/gnunet-vpn.1 b/doc/man/gnunet-vpn.1 index ad5b9db10..80b78ce14 100644 --- a/doc/man/gnunet-vpn.1 +++ b/doc/man/gnunet-vpn.1 | |||
@@ -27,8 +27,8 @@ Display IP address only after the tunnel is fully connected. | |||
27 | .IP "\-c FILENAME, \-\-config=FILENAME" | 27 | .IP "\-c FILENAME, \-\-config=FILENAME" |
28 | Use the configuration file FILENAME. | 28 | Use the configuration file FILENAME. |
29 | .B | 29 | .B |
30 | .IP "\-d SEC, \-\-duration SEC" | 30 | .IP "\-d TIME, \-\-duration TIME" |
31 | The mapping should be established for SEC seconds. Default is 5 minutes. | 31 | The mapping should be established for TIME. The value given must be a number followed by a space and a time unit, for example "500 ms". Note that the quotes are required on the shell. Default is 5 minutes. |
32 | .B | 32 | .B |
33 | .IP "\-h, \-\-help" | 33 | .IP "\-h, \-\-help" |
34 | Print short help on options. | 34 | Print short help on options. |
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index 61d145c6e..6402e1063 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c | |||
@@ -92,7 +92,7 @@ static int ret; | |||
92 | /** | 92 | /** |
93 | * Option '-d': duration of the mapping | 93 | * Option '-d': duration of the mapping |
94 | */ | 94 | */ |
95 | static unsigned long long duration = 5 * 60; | 95 | static struct GNUNET_TIME_Relative duration = { 5 * 60 * 1000} ; |
96 | 96 | ||
97 | 97 | ||
98 | /** | 98 | /** |
@@ -180,8 +180,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
180 | uint8_t protocol; | 180 | uint8_t protocol; |
181 | struct GNUNET_TIME_Absolute etime; | 181 | struct GNUNET_TIME_Absolute etime; |
182 | 182 | ||
183 | etime = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 183 | etime = GNUNET_TIME_relative_to_absolute (duration); |
184 | (unsigned int) duration)); | ||
185 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 184 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
186 | &do_disconnect, NULL); | 185 | &do_disconnect, NULL); |
187 | handle = GNUNET_VPN_connect (cfg); | 186 | handle = GNUNET_VPN_connect (cfg); |
@@ -301,9 +300,9 @@ main (int argc, char *const *argv) | |||
301 | {'a', "after-connect", NULL, | 300 | {'a', "after-connect", NULL, |
302 | gettext_noop ("print IP address only after mesh tunnel has been created"), | 301 | gettext_noop ("print IP address only after mesh tunnel has been created"), |
303 | 0, &GNUNET_GETOPT_set_one, &ipv6}, | 302 | 0, &GNUNET_GETOPT_set_one, &ipv6}, |
304 | {'d', "duration", "SECONDS", | 303 | {'d', "duration", "TIME", |
305 | gettext_noop ("how long should the mapping be valid for new tunnels?"), | 304 | gettext_noop ("how long should the mapping be valid for new tunnels?"), |
306 | 1, &GNUNET_GETOPT_set_ulong, &duration}, | 305 | 1, &GNUNET_GETOPT_set_relative_time, &duration}, |
307 | {'i', "ip", "IP", | 306 | {'i', "ip", "IP", |
308 | gettext_noop ("destination IP for the tunnel"), | 307 | gettext_noop ("destination IP for the tunnel"), |
309 | 1, &GNUNET_GETOPT_set_string, &target_ip}, | 308 | 1, &GNUNET_GETOPT_set_string, &target_ip}, |