From 8353443ea431b4fb36b2370052b6f3f1ffc7e875 Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Sun, 12 Jun 2022 14:26:07 +0200 Subject: [PATCH] Ports need more storage in eeprom --- ESPFirewall/lib/Firewall/src/Storage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ESPFirewall/lib/Firewall/src/Storage.cpp b/ESPFirewall/lib/Firewall/src/Storage.cpp index b2f366f..4504ae4 100644 --- a/ESPFirewall/lib/Firewall/src/Storage.cpp +++ b/ESPFirewall/lib/Firewall/src/Storage.cpp @@ -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(this->memory.getUChar(firewall_fields[PROTOCOL], PROTOCOL_ALL)); rule_ptr->target = static_cast(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);