Ports need more storage in eeprom

This commit is contained in:
Florian Hoss 2022-06-12 14:26:07 +02:00
parent 56a74f9121
commit 8353443ea4

View file

@ -65,8 +65,8 @@ namespace fw
this->memory.begin(rulename, true);
strncpy(rule_ptr->ip, this->memory.getString(firewall_fields[IP], "0.0.0.0").c_str(), sizeof(rule_ptr->ip));
rule_ptr->port_from = this->memory.getUChar(firewall_fields[PORT_FROM], 0);
rule_ptr->port_to = this->memory.getUChar(firewall_fields[PORT_TO], 0);
rule_ptr->port_from = this->memory.getULong(firewall_fields[PORT_FROM], 0);
rule_ptr->port_to = this->memory.getULong(firewall_fields[PORT_TO], 0);
rule_ptr->protocol = static_cast<firewall_protocol_t>(this->memory.getUChar(firewall_fields[PROTOCOL], PROTOCOL_ALL));
rule_ptr->target = static_cast<firewall_target_t>(this->memory.getUChar(firewall_fields[TARGET], TARGET_REJECT));
this->memory.end();
@ -103,8 +103,8 @@ namespace fw
this->memory.begin(rulename, false);
this->memory.putString(firewall_fields[IP], rule_ptr->ip);
this->memory.putUChar(firewall_fields[PORT_FROM], rule_ptr->port_from);
this->memory.putUChar(firewall_fields[PORT_TO], rule_ptr->port_to);
this->memory.putULong(firewall_fields[PORT_FROM], rule_ptr->port_from);
this->memory.putULong(firewall_fields[PORT_TO], rule_ptr->port_to);
this->memory.putUChar(firewall_fields[PROTOCOL], rule_ptr->protocol);
this->memory.putUChar(firewall_fields[TARGET], rule_ptr->target);