summaryrefslogtreecommitdiff
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-07-17 21:04:03 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2016-10-30 11:11:37 +0100
commit1ad5bcb2a032262170fdc508abfa0acb0565e2b5 (patch)
tree4c5e313c22aa50eddf909ebf7974ec3c32670dc8 /net/batman-adv/routing.c
parent8def0be82dd1507bcdc5fd35d12e35ace1e39dff (diff)
batman-adv: Consume skb in batadv_send_skb_to_orig
Sending functions in Linux consume the supplied skbuff. Doing the same in batadv_send_skb_to_orig avoids the hack of returning -1 (-EPERM) to signal the caller that he is responsible for cleaning up the skb. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r--net/batman-adv/routing.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index a4cb157997d3..4d2679ad1567 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -262,9 +262,6 @@ static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv,
icmph->ttl = BATADV_TTL;
res = batadv_send_skb_to_orig(skb, orig_node, NULL);
- if (res == -1)
- goto out;
-
ret = NET_RX_SUCCESS;
break;
@@ -325,8 +322,7 @@ static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv,
icmp_packet->ttl = BATADV_TTL;
res = batadv_send_skb_to_orig(skb, orig_node, NULL);
- if (res != -1)
- ret = NET_RX_SUCCESS;
+ ret = NET_RX_SUCCESS;
out:
if (primary_if)
@@ -413,8 +409,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
/* route it */
res = batadv_send_skb_to_orig(skb, orig_node, recv_if);
- if (res != -1)
- ret = NET_RX_SUCCESS;
+ ret = NET_RX_SUCCESS;
out:
if (orig_node)
@@ -702,8 +697,6 @@ 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 == -1)
- goto out;
/* translate transmit result into receive result */
if (res == NET_XMIT_SUCCESS) {