]> xenbits.xensource.com Git - libvirt.git/commitdiff
rng: fix nwfilter rule contents
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 6 Dec 2017 16:41:31 +0000 (16:41 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 7 Dec 2017 09:21:04 +0000 (09:21 +0000)
The contents of a <rule> are a choice of exactly one union member. The
RNG schema, however, was allowing an arbitrary number of instances of every
union member at once.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
docs/schemas/nwfilter.rng

index 7cfc05fa2e35040084853ffeb6c59f43f4fa025c..cca6ff29548bed20f9d19d012af0e747794feea2 100644 (file)
           </element>
           <element name="rule">
             <ref name="rule-node-attributes"/>
-            <optional>
-              <zeroOrMore>
+            <choice>
                 <element name="mac">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="mac-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="vlan">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="vlan-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="stp">
                   <ref name="match-attribute"/>
                   <ref name="srcmacandmask-attributes"/>
                   <ref name="stp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="arp">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="arp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="rarp">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="arp-attributes"/> <!-- same as arp -->
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="ip">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="dscp-attribute"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="ipv6">
                   <ref name="match-attribute"/>
                   <ref name="common-l2-attributes"/>
                   <ref name="icmp-attribute-ranges"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="tcp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="tcp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="udp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="sctp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="icmp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="icmp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="igmp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="all">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="esp">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="ah">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="udplite">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ip-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="tcp-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="tcp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="udp-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="sctp-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="icmpv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="icmp-attributes"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="all-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="esp-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="ah-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
-            <optional>
-              <zeroOrMore>
                 <element name="udplite-ipv6">
                   <ref name="match-attribute"/>
                   <ref name="srcmac-attribute"/>
                   <ref name="common-ipv6-attributes-p2"/>
                   <ref name="comment-attribute"/>
                 </element>
-              </zeroOrMore>
-            </optional>
+            </choice>
           </element>
         </choice>
       </zeroOrMore>