We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90ee52d commit e41ab00Copy full SHA for e41ab00
src/main.cpp
@@ -488,14 +488,19 @@ static void copy_sv_to_c_buf(char (&dest)[N], std::string_view sv){
488
}
489
490
static int
491
-parse_mtu(const char *optarg)
+parse_mtu(char *optarg)
492
{
493
enum { IPV4_REQ_MIN_MTU = 576, };
494
+ bool enforce = false;
495
+ if (optarg[0] != '\0' && optarg[strlen(optarg) - 1] == '!') {
496
+ enforce = true;
497
+ optarg[strlen(optarg) - 1] = '\0';
498
+ }
499
const int ret = parse_number(optarg, 1, 10);
500
if (ret == INT_MIN) {
501
return -1;
502
- if (ret < IPV4_REQ_MIN_MTU && optarg[strlen(optarg) - 1] != '!') {
503
+ if (ret < IPV4_REQ_MIN_MTU && !enforce) {
504
MSG(WARNING,
505
"MTU %s seems to be too low, use \"%d!\" to force.\n",
506
optarg, ret);
0 commit comments