[ovs-dev] [PATCH] netdev-vport: Don't use ipsec options for either arg in config_equal_ipsec().
Justin Pettit
jpettit at nicira.com
Fri Jun 17 01:14:21 UTC 2011
Commit aebf423 (netdev: Add methods to do netdev-specific argument
comparisons.) added a new config_equal_ipsec() function to ignore
IPsec key options when comparing an existing netdev's options with a new
netdev. We only ignored the options for the new netdev configuration,
which works when pulling the existing configuration from the kernel.
Unfortunately, if this is just a re-init of a netdev for which we just
created, this ignoring of the IPsec key options on the new netdev will
cause the check to fail, since the full options actually available in
both netdevs. This commit just ignore all IPsec key options from both
netdevs.
---
lib/netdev-vport.c | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index bc7d050..b9c1bfe 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -898,19 +898,26 @@ unparse_patch_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED,
static bool
config_equal_ipsec(const struct shash *nd_args, const struct shash *args)
{
- struct shash tmp;
+ struct shash tmp1, tmp2;
bool result;
- smap_clone(&tmp, args);
-
- shash_find_and_delete(&tmp, "psk");
- shash_find_and_delete(&tmp, "peer_cert");
- shash_find_and_delete(&tmp, "certificate");
- shash_find_and_delete(&tmp, "private_key");
- shash_find_and_delete(&tmp, "use_ssl_cert");
-
- result = smap_equal(&tmp, nd_args);
- smap_destroy(&tmp);
+ smap_clone(&tmp1, nd_args);
+ smap_clone(&tmp2, args);
+
+ shash_find_and_delete(&tmp1, "psk");
+ shash_find_and_delete(&tmp2, "psk");
+ shash_find_and_delete(&tmp1, "peer_cert");
+ shash_find_and_delete(&tmp2, "peer_cert");
+ shash_find_and_delete(&tmp1, "certificate");
+ shash_find_and_delete(&tmp2, "certificate");
+ shash_find_and_delete(&tmp1, "private_key");
+ shash_find_and_delete(&tmp2, "private_key");
+ shash_find_and_delete(&tmp1, "use_ssl_cert");
+ shash_find_and_delete(&tmp2, "use_ssl_cert");
+
+ result = smap_equal(&tmp1, &tmp2);
+ smap_destroy(&tmp1);
+ smap_destroy(&tmp2);
return result;
}
--
1.7.1
More information about the dev
mailing list