mirror of
https://github.com/markqvist/tncattach.git
synced 2025-07-09 20:05:16 -04:00
tncattach
- Added error handling for mtu with IPv6 support
This commit is contained in:
parent
b74256bccc
commit
111621791a
13
tncattach.c
13
tncattach.c
@ -331,6 +331,13 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
|||||||
printf("Error: Invalid MTU specified\r\n\r\n");
|
printf("Error: Invalid MTU specified\r\n\r\n");
|
||||||
argp_usage(state);
|
argp_usage(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(arguments->set_ipv6 || arguments->link_local_v6)
|
||||||
|
{
|
||||||
|
printf("IPv6 and/or link-loal IPv6 was requested, but the MTU provided is lower than 1280\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
@ -489,6 +496,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
|||||||
ipv6_addr = malloc(strlen(arguments->ipv6)+1);
|
ipv6_addr = malloc(strlen(arguments->ipv6)+1);
|
||||||
strcpy(ipv6_addr, arguments->ipv6);
|
strcpy(ipv6_addr, arguments->ipv6);
|
||||||
printf("v6 now: %s\n", ipv6_addr);
|
printf("v6 now: %s\n", ipv6_addr);
|
||||||
|
|
||||||
|
printf("MTU was %d, setting to minimum of %d as is required for IPv6\n", arguments->mtu, 1280);
|
||||||
|
arguments->mtu = 1280;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
@ -498,6 +508,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
arguments->link_local_v6 = true;
|
arguments->link_local_v6 = true;
|
||||||
|
|
||||||
|
printf("MTU was %d, setting to minimum of %d as is required for IPv6\n", arguments->mtu, 1280);
|
||||||
|
arguments->mtu = 1280;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user