Commit 0843f197 authored by Gao Feng's avatar Gao Feng Committed by Simon Wunderlich

batman-adv: Remove one condition check in batadv_route_unicast_packet

It could decrease one condition check to collect some statements in the
first condition block.
Signed-off-by: default avatarGao Feng <gfree.wind@gmail.com>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
parent 269cee62
......@@ -719,20 +719,19 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
len = skb->len;
res = batadv_send_skb_to_orig(skb, orig_node, recv_if);
if (res == NET_XMIT_SUCCESS)
ret = NET_RX_SUCCESS;
/* skb was consumed */
skb = NULL;
/* translate transmit result into receive result */
if (res == NET_XMIT_SUCCESS) {
ret = NET_RX_SUCCESS;
/* skb was transmitted and consumed */
batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
len + ETH_HLEN);
}
/* skb was consumed */
skb = NULL;
put_orig_node:
batadv_orig_node_put(orig_node);
free_skb:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment