[ovs-dev] [PATCH] tunnel: Correctly check for internal device.

Justin Pettit jpettit at nicira.com
Mon Oct 4 16:27:19 PDT 2010


Looks good.

--Justin


On Oct 1, 2010, at 7:29 PM, Jesse Gross wrote:

> With header caching we check to see if the next device in the stack
> is an OVS device and, if so, cache that flow as well.  However, the
> test for this called internal_dev_get_vport() assuming that it would
> return NULL if the device is not an internal device.  It doesn't,
> however, it just returns the offset from the device where the vport
> data structure would be if it were an internal device.  This changes
> it to explicitly check for an internal device first to avoid a panic.
> 
> Bug #3470
> 
> Reported-by: Ram Jothikumar <rjothikumar at nicira.com>
> Signed-off-by: Jesse Gross <jesse at nicira.com>
> ---
> datapath/tunnel.c |    6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/datapath/tunnel.c b/datapath/tunnel.c
> index 77f976f..ad45228 100644
> --- a/datapath/tunnel.c
> +++ b/datapath/tunnel.c
> @@ -1266,17 +1266,15 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
> 
> 		if (likely(cache)) {
> 			int orig_len = skb->len - cache->len;
> -			struct vport *cache_vport = internal_dev_get_vport(rt_dst(rt).dev);
> 
> 			skb->protocol = htons(ETH_P_IP);
> -
> 			iph->tot_len = htons(skb->len - skb_network_offset(skb));
> 			ip_send_check(iph);
> 
> -			if (likely(cache_vport)) {
> +			if (is_internal_dev(rt_dst(rt).dev)) {
> 				OVS_CB(skb)->flow = cache->flow;
> 				compute_ip_summed(skb, true);
> -				vport_receive(cache_vport, skb);
> +				vport_receive(internal_dev_get_vport(rt_dst(rt).dev), skb);
> 				sent_len += orig_len;
> 			} else {
> 				int err;
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list