tncattach

- Cleaned up
This commit is contained in:
Tristan Brice Velloza Kildaire 2024-12-21 15:39:11 +02:00
parent 8f32dc809e
commit f6ff9a9618

View File

@ -504,15 +504,15 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
long prefixLen_l = strtol(prefixPart_s, NULL, 10); // TODO: Add handling here for errors (using errno) long prefixLen_l = strtol(prefixPart_s, NULL, 10); // TODO: Add handling here for errors (using errno)
if(prefixLen_l == 0) { if(prefixLen_l == 0) {
printf("Prefix length '%s' is not numeric\n", prefixPart_s); printf("Prefix length '%s' is not numeric\n", prefixPart_s);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
else if(!(prefixLen_l >= 0 && prefixLen_l <= 128)) else if(!(prefixLen_l >= 0 && prefixLen_l <= 128))
{ {
printf("Prefix length '%s' is not within valid range of 0-128\n", prefixPart_s); printf("Prefix length '%s' is not within valid range of 0-128\n", prefixPart_s);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
arguments->ipv6 = ipPart_s; arguments->ipv6 = ipPart_s;
@ -540,7 +540,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
printf("MTU was %d, setting to minimum of %d as is required for IPv6\n", arguments->mtu, 1280); printf("MTU was %d, setting to minimum of %d as is required for IPv6\n", arguments->mtu, 1280);
arguments->mtu = 1280; arguments->mtu = 1280;
break; break;
case 'n': case 'n':
arguments->noipv6 = true; arguments->noipv6 = true;
if(arguments->set_ipv6) if(arguments->set_ipv6)