Skip to content

Instantly share code, notes, and snippets.

@levid0s
Last active August 12, 2024 01:42
Show Gist options
  • Save levid0s/b74a24d3fd586741abc46f48ae9e1cd0 to your computer and use it in GitHub Desktop.
Save levid0s/b74a24d3fd586741abc46f48ae9e1cd0 to your computer and use it in GitHub Desktop.
OpenWRT IPSets allow in-line comments Patch
cd /
patch -p1 < /root/parse_ipsetentry.patch
ACTION=reload-sets utpl -S /usr/share/firewall4/main.uc
--- /usr/share/ucode/fw4.uc 02:24:26.459445315 +0100
+++ /usr/share/ucode/fw4.uc 02:10:15.857472398 +0100
@@ -1489,6 +1489,7 @@
},
parse_ipsetentry: function(val, set) {
+ val = trim(split(val, "#")[0]);
let values = split(val, /[ \t]+/);
if (length(values) != length(set.types))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment