From: Jo-Philipp Wich Date: Wed, 31 Mar 2021 19:55:08 +0000 (+0200) Subject: fw4.uc: fix family test functions X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=6bf82a8aa53bc59b6bf1efbe1babf6a9b5022cc2;p=project%2Ffirewall4.git fw4.uc: fix family test functions Rewrite the family test functions as arrow functions since ucode HEAD does implicitly return the last function value expression as result anymore for ordinary functions. Signed-off-by: Jo-Philipp Wich --- diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index c8396fa..b120ed4 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -253,9 +253,9 @@ function ensure_tcpudp(x) { return false; } -function is_family(x, v) { x.family == 0 || x.family == v } -function family_is_ipv4(x) { x.family == 0 || x.family == 4 } -function family_is_ipv6(x) { x.family == 0 || x.family == 6 } +let is_family = (x, v) => (x.family == 0 || x.family == v); +let family_is_ipv4 = (x) => (x.family == 0 || x.family == 4); +let family_is_ipv6 = (x) => (x.family == 0 || x.family == 6); function infer_family(f, objects) { let res = f;