diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2012-06-01 19:32:06 -0400 |
---|---|---|
committer | Stefan Berger <stefanb@us.ibm.com> | 2012-06-01 19:32:06 -0400 |
commit | 797b47580a5c5de1cc32e061e9be38ff6c834928 (patch) | |
tree | fd4d32865f874a70d1db5143978b2f439ff4e6f7 /src/nwfilter/nwfilter_gentech_driver.c | |
parent | nwfilter: add DHCP snooping (diff) | |
download | libvirt-797b47580a5c5de1cc32e061e9be38ff6c834928.tar.gz libvirt-797b47580a5c5de1cc32e061e9be38ff6c834928.tar.bz2 libvirt-797b47580a5c5de1cc32e061e9be38ff6c834928.zip |
nwfilter: move code for IP address map into separate file
The goal of this patch is to prepare for support for multiple IP
addresses per interface in the DHCP snooping code.
Move the code for the IP address map that maps interface names to
IP addresses into their own file. Rename the functions on the way
but otherwise leave the code as-is. Initialize this new layer
separately before dependent layers (iplearning, dhcpsnooping)
and shut it down after them.
Diffstat (limited to 'src/nwfilter/nwfilter_gentech_driver.c')
-rw-r--r-- | src/nwfilter/nwfilter_gentech_driver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 1738f5cba..4769d21d4 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -33,6 +33,7 @@ #include "nwfilter_gentech_driver.h" #include "nwfilter_ebiptables_driver.h" #include "nwfilter_dhcpsnoop.h" +#include "nwfilter_ipaddrmap.h" #include "nwfilter_learnipaddr.h" #include "virnetdev.h" #include "datatypes.h" @@ -870,7 +871,7 @@ __virNWFilterInstantiateFilter(const unsigned char *vmuuid, goto err_exit; } - ipaddr = virNWFilterGetIpAddrForIfname(ifname); + ipaddr = virNWFilterIPAddrMapGetIPAddr(ifname); vars1 = virNWFilterCreateVarHashmap(str_macaddr, ipaddr); if (!vars1) { @@ -1132,7 +1133,7 @@ _virNWFilterTeardownFilter(const char *ifname) techdriver->allTeardown(ifname); - virNWFilterDelIpAddrForIfname(ifname, NULL); + virNWFilterIPAddrMapDelIPAddr(ifname, NULL); virNWFilterUnlockIface(ifname); |