@@ -531,12 +531,7 @@ _parse_firewall_rule(const char *ruleset, char *leftover)
531
531
}
532
532
533
533
/* Get the optional port or port range */
534
- if (strncmp (leftover , "port" , 4 ) == 0 ) {
535
- if (protocol == NULL ||
536
- !(strncmp (protocol , "tcp" , 3 ) == 0 || strncmp (protocol , "udp" , 3 ) == 0 )) {
537
- debug (LOG_ERR , "ERROR: wifidog config file, section FirewallRuleset %s. Port without tcp or udp protocol." , ruleset );
538
- return -3 ; /*< Fail */
539
- }
534
+ if (strncmp (leftover , "port" , 4 ) == 0 ) {
540
535
TO_NEXT_WORD (leftover , finished );
541
536
/* Get port now */
542
537
port = leftover ;
@@ -545,7 +540,8 @@ _parse_firewall_rule(const char *ruleset, char *leftover)
545
540
if (!isdigit ((unsigned char )* (port + i )) && ((unsigned char )* (port + i ) != ':' ))
546
541
all_nums = 0 ; /*< No longer only digits */
547
542
if (!all_nums ) {
548
- debug (LOG_ERR , "ERROR: wifidog config file, section FirewallRuleset %s. Invalid port %s" , ruleset , port );
543
+ debug (LOG_ERR , "ERROR: wifidog config file, section FirewallRuleset %s. "
544
+ "Invalid port %s" , ruleset , port );
549
545
return -3 ; /*< Fail */
550
546
}
551
547
}
@@ -574,7 +570,7 @@ _parse_firewall_rule(const char *ruleset, char *leftover)
574
570
}
575
571
} else {
576
572
debug (LOG_ERR , "Invalid or unexpected keyword %s, "
577
- "expecting \"to\" or \"to-ipset\"" , other_kw );
573
+ "expecting \"port\", \" to\" or \"to-ipset\"" , other_kw );
578
574
return -4 ; /*< Fail */
579
575
}
580
576
TO_NEXT_WORD (leftover , finished );
0 commit comments