ruleset: ensure that family-agnostic ICMP rules cover ICMPv6 as well
[project/firewall4.git] / root / usr / share / ucode / fw4.uc
index b725459c77d22d0a4f8ba924661a07c2239ca124..28865cd926fbad36fbec14e161dbd51ae87b01a8 100644 (file)
@@ -1616,6 +1616,22 @@ return {
                }
        },
 
+       l4proto: function(family, proto) {
+               switch (proto.name) {
+               case 'icmp':
+                       switch (family ?? 0) {
+                       case 0:
+                               return this.set(['icmp', 'ipv6-icmp']);
+
+                       case 6:
+                               return 'ipv6-icmp';
+                       }
+
+               default:
+                       return proto.name;
+               }
+       },
+
        datetime: function(stamp) {
                return sprintf('"%04d-%02d-%02d %02d:%02d:%02d"',
                               stamp.year, stamp.month, stamp.day,