Despite what's being documented in the nftables wiki, nftables does not
actually accept lowercased or abbreviated weekday names, currently failing
with a "Error: Could not parse Day of week of packet reception" error for
expressions such as `meta day { "sunday", "wed" }`.
Work around the problem by explicitly emitting capitalized weekday names
while a more thorough nftables-side solution is being sent upstream.
Ref: https://forum.openwrt.org/t/firewall-time-restrictions-parental-controls-problems/123964
Ref: https://wiki.nftables.org/wiki-nftables/index.php/Matching_packet_metainformation#Matching_by_time
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
val = lc(val);
for (let i = 0; i < length(choices); i++)
- if (substr(choices[i], 0, length(val)) == val)
+ if (lc(substr(choices[i], 0, length(val))) == val)
return choices[i];
}
for (let day in to_array(rv.val)) {
day = this.parse_enum(day, [
- "monday",
- "tuesday",
- "wednesday",
- "thursday",
- "friday",
- "saturday",
- "sunday"
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday"
]);
if (!day)