Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/nwfilter_conf.c | 284 ++++++++++++++++++++-------------------
1 file changed, 143 insertions(+), 141 deletions(-)
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index a3109962af..4c4e31d5cd 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -2187,71 +2187,74 @@ virNWFilterRuleValidate(virNWFilterRuleDef *rule)
static void
-virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
+copy_neg_sign(nwItemDesc *to, const nwItemDesc *from)
{
-#define COPY_NEG_SIGN(A, B) \
- (A).flags = ((A).flags & ~NWFILTER_ENTRY_ITEM_FLAG_IS_NEG) | \
- ((B).flags & NWFILTER_ENTRY_ITEM_FLAG_IS_NEG);
+ to->flags = (to->flags & ~NWFILTER_ENTRY_ITEM_FLAG_IS_NEG) |
+ (from->flags & NWFILTER_ENTRY_ITEM_FLAG_IS_NEG);
+}
+static void
+virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
+{
switch (rule->prtclType) {
case VIR_NWFILTER_RULE_PROTOCOL_MAC:
- COPY_NEG_SIGN(rule->p.ethHdrFilter.ethHdr.dataSrcMACMask,
- rule->p.ethHdrFilter.ethHdr.dataSrcMACAddr);
- COPY_NEG_SIGN(rule->p.ethHdrFilter.ethHdr.dataDstMACMask,
- rule->p.ethHdrFilter.ethHdr.dataDstMACAddr);
+ copy_neg_sign(&rule->p.ethHdrFilter.ethHdr.dataSrcMACMask,
+ &rule->p.ethHdrFilter.ethHdr.dataSrcMACAddr);
+ copy_neg_sign(&rule->p.ethHdrFilter.ethHdr.dataDstMACMask,
+ &rule->p.ethHdrFilter.ethHdr.dataDstMACAddr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_VLAN:
- COPY_NEG_SIGN(rule->p.vlanHdrFilter.ethHdr.dataSrcMACMask,
- rule->p.vlanHdrFilter.ethHdr.dataSrcMACAddr);
- COPY_NEG_SIGN(rule->p.vlanHdrFilter.ethHdr.dataDstMACMask,
- rule->p.vlanHdrFilter.ethHdr.dataDstMACAddr);
+ copy_neg_sign(&rule->p.vlanHdrFilter.ethHdr.dataSrcMACMask,
+ &rule->p.vlanHdrFilter.ethHdr.dataSrcMACAddr);
+ copy_neg_sign(&rule->p.vlanHdrFilter.ethHdr.dataDstMACMask,
+ &rule->p.vlanHdrFilter.ethHdr.dataDstMACAddr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_STP:
- COPY_NEG_SIGN(rule->p.stpHdrFilter.ethHdr.dataSrcMACMask,
- rule->p.stpHdrFilter.ethHdr.dataSrcMACAddr);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataRootPriHi,
- rule->p.stpHdrFilter.dataRootPri);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataRootAddrMask,
- rule->p.stpHdrFilter.dataRootAddr);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataRootCostHi,
- rule->p.stpHdrFilter.dataRootCost);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataSndrPrioHi,
- rule->p.stpHdrFilter.dataSndrPrio);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataSndrAddrMask,
- rule->p.stpHdrFilter.dataSndrAddr);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataPortHi,
- rule->p.stpHdrFilter.dataPort);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataAgeHi,
- rule->p.stpHdrFilter.dataAge);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataMaxAgeHi,
- rule->p.stpHdrFilter.dataMaxAge);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataHelloTimeHi,
- rule->p.stpHdrFilter.dataHelloTime);
- COPY_NEG_SIGN(rule->p.stpHdrFilter.dataFwdDelayHi,
- rule->p.stpHdrFilter.dataFwdDelay);
+ copy_neg_sign(&rule->p.stpHdrFilter.ethHdr.dataSrcMACMask,
+ &rule->p.stpHdrFilter.ethHdr.dataSrcMACAddr);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataRootPriHi,
+ &rule->p.stpHdrFilter.dataRootPri);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataRootAddrMask,
+ &rule->p.stpHdrFilter.dataRootAddr);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataRootCostHi,
+ &rule->p.stpHdrFilter.dataRootCost);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataSndrPrioHi,
+ &rule->p.stpHdrFilter.dataSndrPrio);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataSndrAddrMask,
+ &rule->p.stpHdrFilter.dataSndrAddr);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataPortHi,
+ &rule->p.stpHdrFilter.dataPort);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataAgeHi,
+ &rule->p.stpHdrFilter.dataAge);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataMaxAgeHi,
+ &rule->p.stpHdrFilter.dataMaxAge);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataHelloTimeHi,
+ &rule->p.stpHdrFilter.dataHelloTime);
+ copy_neg_sign(&rule->p.stpHdrFilter.dataFwdDelayHi,
+ &rule->p.stpHdrFilter.dataFwdDelay);
break;
case VIR_NWFILTER_RULE_PROTOCOL_IP:
- COPY_NEG_SIGN(rule->p.ipHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.ipHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.ipHdrFilter.ipHdr.dataDstIPMask,
- rule->p.ipHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.ipHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.ipHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.ipHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.ipHdrFilter.ipHdr.dataDstIPAddr);
virNWFilterRuleDefFixupIPSet(&rule->p.ipHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_IPV6:
- COPY_NEG_SIGN(rule->p.ipv6HdrFilter.ipHdr.dataSrcIPMask,
- rule->p.ipv6HdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.ipv6HdrFilter.ipHdr.dataDstIPMask,
- rule->p.ipv6HdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.ipv6HdrFilter.dataICMPTypeEnd,
- rule->p.ipv6HdrFilter.dataICMPTypeStart);
- COPY_NEG_SIGN(rule->p.ipv6HdrFilter.dataICMPCodeStart,
- rule->p.ipv6HdrFilter.dataICMPTypeStart);
- COPY_NEG_SIGN(rule->p.ipv6HdrFilter.dataICMPCodeEnd,
- rule->p.ipv6HdrFilter.dataICMPTypeStart);
+ copy_neg_sign(&rule->p.ipv6HdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.ipv6HdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.ipv6HdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.ipv6HdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.ipv6HdrFilter.dataICMPTypeEnd,
+ &rule->p.ipv6HdrFilter.dataICMPTypeStart);
+ copy_neg_sign(&rule->p.ipv6HdrFilter.dataICMPCodeStart,
+ &rule->p.ipv6HdrFilter.dataICMPTypeStart);
+ copy_neg_sign(&rule->p.ipv6HdrFilter.dataICMPCodeEnd,
+ &rule->p.ipv6HdrFilter.dataICMPTypeStart);
virNWFilterRuleDefFixupIPSet(&rule->p.ipv6HdrFilter.ipHdr);
break;
@@ -2262,143 +2265,142 @@ virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
case VIR_NWFILTER_RULE_PROTOCOL_TCP:
case VIR_NWFILTER_RULE_PROTOCOL_TCPoIPV6:
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.tcpHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.ipHdr.dataDstIPMask,
- rule->p.tcpHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.tcpHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.ipHdr.dataDstIPTo,
- rule->p.tcpHdrFilter.ipHdr.dataDstIPFrom);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.portData.dataSrcPortEnd,
- rule->p.tcpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.portData.dataDstPortStart,
- rule->p.tcpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.tcpHdrFilter.portData.dataDstPortEnd,
- rule->p.tcpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.tcpHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.tcpHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.tcpHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.tcpHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.tcpHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.tcpHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.tcpHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.tcpHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.tcpHdrFilter.portData.dataSrcPortEnd,
+ &rule->p.tcpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.tcpHdrFilter.portData.dataDstPortStart,
+ &rule->p.tcpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.tcpHdrFilter.portData.dataDstPortEnd,
+ &rule->p.tcpHdrFilter.portData.dataSrcPortStart);
virNWFilterRuleDefFixupIPSet(&rule->p.tcpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_UDP:
case VIR_NWFILTER_RULE_PROTOCOL_UDPoIPV6:
- COPY_NEG_SIGN(rule->p.udpHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.udpHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.ipHdr.dataDstIPMask,
- rule->p.udpHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.udpHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.ipHdr.dataDstIPTo,
- rule->p.udpHdrFilter.ipHdr.dataDstIPFrom);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.portData.dataSrcPortEnd,
- rule->p.udpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.portData.dataDstPortStart,
- rule->p.udpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.udpHdrFilter.portData.dataDstPortEnd,
- rule->p.udpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.udpHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.udpHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.udpHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.udpHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.udpHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.udpHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.udpHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.udpHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.udpHdrFilter.portData.dataSrcPortEnd,
+ &rule->p.udpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.udpHdrFilter.portData.dataDstPortStart,
+ &rule->p.udpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.udpHdrFilter.portData.dataDstPortEnd,
+ &rule->p.udpHdrFilter.portData.dataSrcPortStart);
virNWFilterRuleDefFixupIPSet(&rule->p.udpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_UDPLITE:
case VIR_NWFILTER_RULE_PROTOCOL_UDPLITEoIPV6:
- COPY_NEG_SIGN(rule->p.udpliteHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.udpliteHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.udpliteHdrFilter.ipHdr.dataDstIPMask,
- rule->p.udpliteHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.udpliteHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.udpliteHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.udpliteHdrFilter.ipHdr.dataDstIPTo,
- rule->p.udpliteHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.udpliteHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.udpliteHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.udpliteHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.udpliteHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.udpliteHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.udpliteHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.udpliteHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.udpliteHdrFilter.ipHdr.dataDstIPFrom);
virNWFilterRuleDefFixupIPSet(&rule->p.udpliteHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ESP:
case VIR_NWFILTER_RULE_PROTOCOL_ESPoIPV6:
- COPY_NEG_SIGN(rule->p.espHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.espHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.espHdrFilter.ipHdr.dataDstIPMask,
- rule->p.espHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.espHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.espHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.espHdrFilter.ipHdr.dataDstIPTo,
- rule->p.espHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.espHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.espHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.espHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.espHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.espHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.espHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.espHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.espHdrFilter.ipHdr.dataDstIPFrom);
virNWFilterRuleDefFixupIPSet(&rule->p.espHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_AH:
case VIR_NWFILTER_RULE_PROTOCOL_AHoIPV6:
- COPY_NEG_SIGN(rule->p.ahHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.ahHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.ahHdrFilter.ipHdr.dataDstIPMask,
- rule->p.ahHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.ahHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.ahHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.ahHdrFilter.ipHdr.dataDstIPTo,
- rule->p.ahHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.ahHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.ahHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.ahHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.ahHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.ahHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.ahHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.ahHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.ahHdrFilter.ipHdr.dataDstIPFrom);
virNWFilterRuleDefFixupIPSet(&rule->p.ahHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_SCTP:
case VIR_NWFILTER_RULE_PROTOCOL_SCTPoIPV6:
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.sctpHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.ipHdr.dataDstIPMask,
- rule->p.sctpHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.sctpHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.ipHdr.dataDstIPTo,
- rule->p.sctpHdrFilter.ipHdr.dataDstIPFrom);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.portData.dataSrcPortEnd,
- rule->p.sctpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.portData.dataDstPortStart,
- rule->p.sctpHdrFilter.portData.dataSrcPortStart);
- COPY_NEG_SIGN(rule->p.sctpHdrFilter.portData.dataDstPortEnd,
- rule->p.sctpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.sctpHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.sctpHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.sctpHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.sctpHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.sctpHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.sctpHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.sctpHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.sctpHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.sctpHdrFilter.portData.dataSrcPortEnd,
+ &rule->p.sctpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.sctpHdrFilter.portData.dataDstPortStart,
+ &rule->p.sctpHdrFilter.portData.dataSrcPortStart);
+ copy_neg_sign(&rule->p.sctpHdrFilter.portData.dataDstPortEnd,
+ &rule->p.sctpHdrFilter.portData.dataSrcPortStart);
virNWFilterRuleDefFixupIPSet(&rule->p.sctpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ICMP:
case VIR_NWFILTER_RULE_PROTOCOL_ICMPV6:
- COPY_NEG_SIGN(rule->p.icmpHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.icmpHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.icmpHdrFilter.ipHdr.dataDstIPMask,
- rule->p.icmpHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.icmpHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.icmpHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.icmpHdrFilter.ipHdr.dataDstIPTo,
- rule->p.icmpHdrFilter.ipHdr.dataDstIPFrom);
- COPY_NEG_SIGN(rule->p.icmpHdrFilter.dataICMPCode,
- rule->p.icmpHdrFilter.dataICMPType);
+ copy_neg_sign(&rule->p.icmpHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.icmpHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.icmpHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.icmpHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.icmpHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.icmpHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.icmpHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.icmpHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.icmpHdrFilter.dataICMPCode,
+ &rule->p.icmpHdrFilter.dataICMPType);
virNWFilterRuleDefFixupIPSet(&rule->p.icmpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_ALL:
case VIR_NWFILTER_RULE_PROTOCOL_ALLoIPV6:
- COPY_NEG_SIGN(rule->p.allHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.allHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.allHdrFilter.ipHdr.dataDstIPMask,
- rule->p.allHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.allHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.allHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.allHdrFilter.ipHdr.dataDstIPTo,
- rule->p.allHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.allHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.allHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.allHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.allHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.allHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.allHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.allHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.allHdrFilter.ipHdr.dataDstIPFrom);
break;
case VIR_NWFILTER_RULE_PROTOCOL_IGMP:
- COPY_NEG_SIGN(rule->p.igmpHdrFilter.ipHdr.dataSrcIPMask,
- rule->p.igmpHdrFilter.ipHdr.dataSrcIPAddr);
- COPY_NEG_SIGN(rule->p.igmpHdrFilter.ipHdr.dataDstIPMask,
- rule->p.igmpHdrFilter.ipHdr.dataDstIPAddr);
- COPY_NEG_SIGN(rule->p.igmpHdrFilter.ipHdr.dataSrcIPTo,
- rule->p.igmpHdrFilter.ipHdr.dataSrcIPFrom);
- COPY_NEG_SIGN(rule->p.igmpHdrFilter.ipHdr.dataDstIPTo,
- rule->p.igmpHdrFilter.ipHdr.dataDstIPFrom);
+ copy_neg_sign(&rule->p.igmpHdrFilter.ipHdr.dataSrcIPMask,
+ &rule->p.igmpHdrFilter.ipHdr.dataSrcIPAddr);
+ copy_neg_sign(&rule->p.igmpHdrFilter.ipHdr.dataDstIPMask,
+ &rule->p.igmpHdrFilter.ipHdr.dataDstIPAddr);
+ copy_neg_sign(&rule->p.igmpHdrFilter.ipHdr.dataSrcIPTo,
+ &rule->p.igmpHdrFilter.ipHdr.dataSrcIPFrom);
+ copy_neg_sign(&rule->p.igmpHdrFilter.ipHdr.dataDstIPTo,
+ &rule->p.igmpHdrFilter.ipHdr.dataDstIPFrom);
virNWFilterRuleDefFixupIPSet(&rule->p.igmpHdrFilter.ipHdr);
break;
case VIR_NWFILTER_RULE_PROTOCOL_LAST:
break;
}
-#undef COPY_NEG_SIGN
}
--
2.31.1