From: Justin Pettit Date: Fri, 17 Jun 2011 01:04:41 +0000 (-0700) Subject: netdev-vport: Don't use ipsec options for either arg in config_equal_ipsec(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7211b387b752ce2c67f1aee639bccc8bd0500c48;p=openvswitch netdev-vport: Don't use ipsec options for either arg in config_equal_ipsec(). 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. --- diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index bc7d0501..b9c1bfe6 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; }