[ovs-dev] [tunnels2 2/5] datapath: Fix tunnel reconfiguration that does not change key data.

Ben Pfaff blp at nicira.com
Mon Oct 17 15:13:59 PDT 2011


Without this commit, a pair of commands like
    ovs-dpctl add-if br0 gre0,type=gre,remote_ip=192.168.5.2,csum=true
    ovs-dpctl set-if br0 gre0,csum=false
would result in a csum of "true" for gre0, that is, the second command
would silently have no effect.  This could also happen when the key data
(such as remote_ip) changed but the port hash just happened to have the
same value.

This also fixes a small kernel memory leak in this case.

An upcoming commit implements the "ovs-dpctl set-if" command mentioned
above.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 datapath/tunnel.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index 38004e9..8edff06 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -1408,6 +1408,8 @@ int tnl_set_options(struct vport *vport, struct nlattr *options)
 
 	if (port_hash(&mutable->key) != port_hash(&old_mutable->key))
 		port_table_move_port(vport, mutable);
+	else
+		assign_config_rcu(vport, mutable);
 
 	return 0;
 
-- 
1.7.4.4




More information about the dev mailing list