Skip to content

Commit 2fe5c29

Browse files
hlefnwf
authored andcommitted
firewall: Don't instantiate the IPv6 table in the IPv4-only case.
Due to an oversight we call `instance()` on the IPv6 endpoints table in the IPv4-only case. This creates a table that we do not use. This patch saves 288B in the IPv4-only case. Signed-off-by: Hugo Lefeuvre <[email protected]>
1 parent 6a74a8b commit 2fe5c29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/firewall/firewall.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,10 @@ bool ethernet_driver_start(std::atomic<uint8_t> *state)
11651165
// This is a restart, no need to actually reset the driver.
11661166
// Instead, just remove all firewall entries.
11671167
Debug::log("Network stack restart: clearing all entries.");
1168+
#if CHERIOT_RTOS_OPTION_IPv6
11681169
EndpointsTable<IPv6Address>::instance().clear(IPProtocolNumber::UDP);
11691170
EndpointsTable<IPv6Address>::instance().clear(IPProtocolNumber::TCP);
1171+
#endif
11701172
EndpointsTable<uint32_t>::instance().clear(IPProtocolNumber::UDP);
11711173
EndpointsTable<uint32_t>::instance().clear(IPProtocolNumber::TCP);
11721174
return true;

0 commit comments

Comments
 (0)