From: Pravin B Shelar Date: Wed, 6 Mar 2013 00:39:01 +0000 (-0800) Subject: tunneling: Simplify ovs_tnl_send() error handling code. X-Git-Tag: v1.11.0~329 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=c9e5dfbd18dc6ba826a6e5751507040284ed45da;p=cascardo%2Fovs.git tunneling: Simplify ovs_tnl_send() error handling code. Following commit slightly improves code readability. It is also correctness fix as ip_local_out() was storing error code in err which was not int. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 87f212a13..83d2c4131 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -221,7 +221,6 @@ u16 ovs_tnl_get_src_port(struct sk_buff *skb) int ovs_tnl_send(struct vport *vport, struct sk_buff *skb) { struct tnl_vport *tnl_vport = tnl_vport_priv(vport); - enum vport_err_type err = VPORT_E_TX_ERROR; struct rtable *rt; __be32 saddr; int sent_len = 0; @@ -261,6 +260,7 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb) struct sk_buff *next_skb = skb->next; struct iphdr *iph; int frag_len; + int err; skb->next = NULL; @@ -314,7 +314,7 @@ err_free_rt: ip_rt_put(rt); error_free: kfree_skb(skb); - ovs_vport_record_error(vport, err); + ovs_vport_record_error(vport, VPORT_E_TX_ERROR); return sent_len; }