From: Ben Pfaff Date: Fri, 14 Oct 2011 21:33:11 +0000 (-0700) Subject: datapath: Avoid confusing tunnels that have different types. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=004cce23a6223a1fc062ff1fd3948de83742bc9c;p=openvswitch datapath: Avoid confusing tunnels that have different types. Without this change, the following commands succeed: # ovs-dpctl add-if br1 gre1,type=gre,remote_ip=1.2.3.4,local_ip=2.3.4.5 # ovs-dpctl add-if br1 gre0,type=gre,remote_ip=1.2.3.4 but if they are run in the opposite order, they fail with: ovs-dpctl: adding gre1 to br1 failed (File exists) This fixes the problem. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 5b3d7f51..e97b9f21 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1326,10 +1326,7 @@ static int tnl_set_config(struct nlattr *options, const struct tnl_ops *tnl_ops, mutable->tunnel_hlen += sizeof(struct iphdr); - old_vport = tnl_find_port(mutable->key.saddr, mutable->key.daddr, - mutable->key.in_key, mutable->key.tunnel_type, - &old_mutable); - + old_vport = port_table_lookup(&mutable->key, &old_mutable); if (old_vport && old_vport != cur_vport) return -EEXIST;