Skip to content
Snippets Groups Projects
Commit 1ce26a23 authored by David Schmitz's avatar David Schmitz
Browse files

fix/ipv6_rules_implicit_icmp6: add setting NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6...

fix/ipv6_rules_implicit_icmp6: add setting NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6 to enable/disable implicit ipv6 addresses+proto=icmp <-> proto=icmpv6
parent 7df3ebf7
Branches
No related tags found
No related merge requests found
...@@ -531,6 +531,9 @@ NETCONF_MAX_RETRY_BEFORE_ERROR = 5 ...@@ -531,6 +531,9 @@ NETCONF_MAX_RETRY_BEFORE_ERROR = 5
# Actually apply the rules # Actually apply the rules
COMMIT = True COMMIT = True
#
NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6 = False
############################################################################## ##############################################################################
############################################################################## ##############################################################################
# Netconf Device credentials # Netconf Device credentials
......
...@@ -7,14 +7,16 @@ logger = flowspec.logging_utils.logger_init_default(__name__, "flowspec_utils.lo ...@@ -7,14 +7,16 @@ logger = flowspec.logging_utils.logger_init_default(__name__, "flowspec_utils.lo
def map__ip_proto__for__ip_version__to_flowspec(ip_version, protocol_str): def map__ip_proto__for__ip_version__to_flowspec(ip_version, protocol_str):
logger.info("map__ip_proto__for__ip_version__to_flowspec(): called ip_version="+str(ip_version)+" protocol_str="+str(protocol_str)) logger.info("map__ip_proto__for__ip_version__to_flowspec(): called ip_version="+str(ip_version)+" protocol_str="+str(protocol_str))
if ip_version==6 and protocol_str=='icmp': if ip_version==6 and protocol_str=='icmp':
protocol_str='icmp6' if hasattr(settings, 'NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6') and settings.NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6:
protocol_str='icmp6'
logger.info("map__ip_proto__for__ip_version__to_flowspec(): returning protocol_str="+str(protocol_str)) logger.info("map__ip_proto__for__ip_version__to_flowspec(): returning protocol_str="+str(protocol_str))
return protocol_str return protocol_str
def map__ip_proto__for__ip_version__from_flowspec(ip_version, protocol_str): def map__ip_proto__for__ip_version__from_flowspec(ip_version, protocol_str):
logger.info("map__ip_proto__for__ip_version__from_flowspec(): called ip_version="+str(ip_version)+" protocol_str="+str(protocol_str)) logger.info("map__ip_proto__for__ip_version__from_flowspec(): called ip_version="+str(ip_version)+" protocol_str="+str(protocol_str))
if ip_version==6 and protocol_str=='icmp6': if ip_version==6 and protocol_str=='icmp6':
protocol_str='icmp' if hasattr(settings, 'NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6') and settings.NETCONF_FLOWSPEC_MAP_ICMP_TO_ICMPV6:
protocol_str='icmp'
logger.info("map__ip_proto__for__ip_version__from_flowspec(): returning protocol_str="+str(protocol_str)) logger.info("map__ip_proto__for__ip_version__from_flowspec(): returning protocol_str="+str(protocol_str))
return protocol_str return protocol_str
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment