From 81158e4f4a7071c689aac7ac4fb1389c8e8d3875 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 1 Mar 2011 15:31:32 -0800 Subject: [PATCH] datapath: Simplify send_frags(). This should make no difference at runtime, but it is shorter and looks more straightforward to me. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- datapath/tunnel.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/datapath/tunnel.c b/datapath/tunnel.c index f1711f1f..07bb00b6 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1105,25 +1105,21 @@ static int send_frags(struct sk_buff *skb, const struct tnl_mutable_config *mutable) { int sent_len; - int err; sent_len = 0; while (skb) { struct sk_buff *next = skb->next; int frag_len = skb->len - mutable->tunnel_hlen; + int err; skb->next = NULL; memset(IPCB(skb), 0, sizeof(*IPCB(skb))); err = ip_local_out(skb); - if (likely(net_xmit_eval(err) == 0)) - sent_len += frag_len; - else { - skb = next; - goto free_frags; - } - skb = next; + if (unlikely(net_xmit_eval(err))) + goto free_frags; + sent_len += frag_len; } return sent_len; -- 2.30.2