[SMF/UPF] fix the bug for decoding IPFilter (977)

This commit is contained in:
Sukchan Lee 2021-05-06 21:15:32 +09:00
parent 9a814ceac9
commit dc870cc839
1 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ int ogs_ipfw_compile_rule(ogs_ipfw_rule_t *ipfw_rule, char *flow_description)
int rbufsize;
struct ip_fw_rule *rule = (struct ip_fw_rule *)rulebuf;
int l;
int x, l;
ipfw_insn *cmd;
char *description = NULL;
@ -92,9 +92,9 @@ int ogs_ipfw_compile_rule(ogs_ipfw_rule_t *ipfw_rule, char *flow_description)
av[i] = NULL;
/* "to assigned" --> "to any" */
for (i = 2; av[i] != NULL; i++) {
if (strcmp(av[i], "assigned") == 0 && strcmp(av[i-1], "to") == 0) {
av[i] = "any";
for (x = 2; av[x] != NULL; x++) {
if (strcmp(av[x], "assigned") == 0 && strcmp(av[x-1], "to") == 0) {
av[x] = "any";
break;
}
}