mohithvardhan002 commented on code in PR #14360:
URL: https://github.com/apache/cloudstack/pull/14360#discussion_r4218698801
##########
systemvm/debian/opt/cloud/bin/configure.py:
##########
@@ -81,6 +81,17 @@ def appendStringIfNotEmpty(s1, s2):
return s1
+# nft names of the IPv6 extension headers, which can also be given as an ACL
protocol number
+IP6_EXTHDR_NAMES = {0: "hbh", 43: "rt", 44: "frag", 60: "dst", 135: "mh"}
+
+
+def ip6ProtocolMatch(number):
+ """ An extension header number is matched as that extension header, any
other as the protocol """
+ if number in IP6_EXTHDR_NAMES:
+ return "exthdr %s exists" % IP6_EXTHDR_NAMES[number]
+ return "meta l4proto %d" % number
Review Comment:
Could we add a test for a protocol number that is not an IPv6 extension
header (for example, protocol 6/TCP) to explicitly verify that it generates
`meta l4proto 6`? This would make the fallback behavior of `ip6ProtocolMatch()`
clearer and protect it from regressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]