]> xenbits.xensource.com Git - libvirt.git/commit
nwfilter: fix for directionality of ICMP traffic
authorStefan Berger <stefanb@us.ibm.com>
Thu, 8 Apr 2010 10:25:38 +0000 (06:25 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Thu, 8 Apr 2010 10:25:38 +0000 (06:25 -0400)
commit9fd54a78dcafebf63d74a2e0a83167393c017402
treeb80a6d2538693d9a2c1ecc4c3a4d140d1752039f
parent4acab37f56fbc9bd9e41e6cb392d71545ca52bed
nwfilter: fix for directionality of ICMP traffic

Changes from V1 to V2 of this patch
- I had reversed the logic thinking that icmp type 0 is a echo
request,but it's reply -- needed to reverse the logic
- Found that ebtables takes the --ip-tos argument only as a hex number

This patch enables the skipping of some of the ICMP traffic rules on the
iptables level under certain circumstances so that the following filter
properly enables unidirectional pings:

<filter name='testcase'>
    <uuid>d6b1a2af-def6-2898-9f8d-4a74e3c39558</uuid>
    <!-- allow incoming ICMP Echo Request -->
    <rule action='accept' direction='in' priority='500'>
        <icmp type='8'/>
    </rule>
    <!-- allow outgoing ICMP Echo Reply -->
    <rule action='accept' direction='out' priority='500'>
        <icmp type='0'/>
    </rule>
    <!-- drop all other ICMP traffic -->
    <rule action='drop' direction='inout' priority='600'>
        <icmp/>
    </rule>
</filter>
src/nwfilter/nwfilter_ebiptables_driver.c