Avoid the enforcement of direction if
- icmp rules specify the type/code information
- the 'skipMatch' variable is set to 'true'
bool srcMacSkipped = false;
bool skipRule = false;
bool skipMatch = false;
+ bool hasICMPType = false;
if (!iptables_cmd) {
virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
if (HAS_ENTRY_ITEM(&rule->p.icmpHdrFilter.dataICMPType)) {
const char *parm;
+ hasICMPType = true;
+
if (maySkipICMP)
goto exit_no_error;
if (match && !skipMatch)
virBufferVSprintf(&buf, " %s", match);
- if (defMatch && match != NULL)
+ if (defMatch && match != NULL && !skipMatch && !hasICMPType)
iptablesEnforceDirection(directionIn,
rule,
&buf);