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>
This commit is contained in:

committed by
Simon Wunderlich

parent
8def0be82d
commit
1ad5bcb2a0
@@ -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) {
|
||||
|
Reference in New Issue
Block a user