]> xenbits.xensource.com Git - libvirt.git/commit
nwfilter: Instantiate comments in ip(6)tables rules
authorStefan Berger <stefanb@us.ibm.com>
Thu, 30 Sep 2010 19:56:09 +0000 (15:56 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Thu, 30 Sep 2010 19:56:09 +0000 (15:56 -0400)
commitb00f41a1d2554c945d56cd3f0fe52c553c324681
tree41194ddf1cffce9dfad2adc278caa11011259798
parentec3d03db88cd35d310b28d328fe9a904f58d0230
nwfilter: Instantiate comments in ip(6)tables rules

In this patch I am extending the rule instantiator to create the comment
node where supported, which is the case for iptables and ip6tables.

Since commands are written in the format

cmd='iptables ...-m comment --comment \"\" '

certain characters ('`) in the comment need to be escaped to
prevent comments from becoming commands themselves or cause other
forms of (bash) substitutions. I have tested this with various input and in
my tests the input made it straight into the comment. A test case for TCK
will be provided separately that tests this.
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_ebiptables_driver.h