• S
    nwfilter: add DHCP snooping · cec281fc
    Stefan Berger 提交于
    This patch adds DHCP snooping support to libvirt. The learning method for
    IP addresses is specified by setting the "CTRL_IP_LEARNING" variable to one of
    "any" [default] (existing IP learning code), "none" (static only addresses)
    or "dhcp" (DHCP snooping).
    
    Active leases are saved in a lease file and reloaded on restart or HUP.
    
    The following interface XML activates and uses the DHCP snooping:
    
        <interface type='bridge'>
          <source bridge='virbr0'/>
          <filterref filter='clean-traffic'>
            <parameter name='CTRL_IP_LEARNING' value='dhcp'/>
          </filterref>
        </interface>
    
    All filters containing the variable 'IP' are automatically adjusted when
    the VM receives an IP address via DHCP. However, multiple IP addresses per
    interface are silently ignored in this patch, thus only supporting one IP
    address per interface. Multiple IP address support is added in a later
    patch in this series.
    Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
    Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
    cec281fc
nwfilter_dhcpsnoop.c 60.9 KB