<br><tt><font size=2>"Daniel P. Berrange" <berrange@redhat.com>
wrote on 03/25/2010 11:49:05 AM:<br>
<br>
> Please respond to "Daniel P. Berrange"</font></tt>
<br><tt><font size=2>> <br>
> On Tue, Mar 23, 2010 at 10:54:17AM -0400, stefanb@us.ibm.com wrote:<br>
> > +/*<br>
> > +    char macaddr[VIR_MAC_STRING_BUFLEN],<br>
> > +         ipaddr[INET_ADDRSTRLEN],<br>
> > +         number[20];<br>
> > +    char chain[MAX_CHAINNAME_LENGTH];<br>
> > +    virBuffer buf = VIR_BUFFER_INITIALIZER;<br>
> > +<br>
> > +    if (nwfilter->chainsuffix == VIR_NWFILTER_CHAINSUFFIX_ROOT)<br>
> > +        PRINT_ROOT_CHAIN(chain, chainPrefix,
ifname);<br>
> > +    else<br>
> > +        PRINT_CHAIN(chain, chainPrefix,
ifname,<br>
> > +                  
 virNWFilterChainSuffixTypeToString<br>
> (nwfilter->chainsuffix));<br>
> <br>
> Since we're passing this into the shell, I think we should do paranoid<br>
> validation on the 'chain' and 'ifname' fields, since they ultimately
come<br>
> from the user specified XML. Validate that it only contains a-Z, 0-0,
-, _</font></tt>
<br>
<br><tt><font size=2>Actually the user specified XML only currently allows
the chain names 'arp', </font></tt>
<br><tt><font size=2>'ipv4', 'ipv6' and 'root'. Others will already be
rejected when parsing the filter.</font></tt>
<br>
<br><tt><font size=2>With the interface names I was assuming that at the
point where this part here</font></tt>
<br><tt><font size=2>gets called is already well after the establishment
of tap interfaces and the</font></tt>
<br><tt><font size=2>net->ifname contains valid values otherwise the
creation of the tap or macvtap</font></tt>
<br><tt><font size=2>would have blown earlier.</font></tt>
<br><tt><font size=2><br>
> <br>
> <br>
> It would also be nice to put a variety of XML files in a tests/nwfilterdata<br>
> directory and making a test suite to run the parser API against them,
as<br>
> well as adding some real world examples in the examples/nwfilter directory<br>
> for end users to start from.</font></tt>
<br>
<br><tt><font size=2>In the v4 patch series I am adding filters to examples/xml/nwfilter
that are </font></tt>
<br><tt><font size=2>automatically copied to /etc/libvirt/nwfilter for
libvirt to pick up.</font></tt>
<br>
<br><tt><font size=2>Gerhard has written a couple of test cases but they
are for the external</font></tt>
<br><tt><font size=2>test suite from what I know. So, yes, we'll add test
cases over time.</font></tt>
<br>
<br><tt><font size=2>  Regards,</font></tt>
<br><tt><font size=2>    Stefan</font></tt>
<br><tt><font size=2><br>
> <br>
> Regards,<br>
> Daniel<br>
> -- <br>
> |: Red Hat, Engineering, London    -o-   </font></tt><a href=http://people.redhat.com/berrange/:|><tt><font size=2>http://people.redhat.com/berrange/:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://libvirt.org/><tt><font size=2>http://libvirt.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href="http://virt-manager.org/"><tt><font size=2>http://virt-manager.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href=http://deltacloud.org:|/><tt><font size=2>http://deltacloud.org:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://autobuild.org/><tt><font size=2>http://autobuild.org</font></tt></a><tt><font size=2>
       -o-         </font></tt><a href=http://search.cpan.org/~danberr/:|><tt><font size=2>http://search.cpan.org/~danberr/:|</font></tt></a><tt><font size=2><br>
> |: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1
B3DF F742 7D3B 9505 :|<br>
</font></tt>