The following commit has been merged in the merge/master branch: commit 0a5c1a8f7b619cfe3bf0a0480dd05ba8341e4acb Merge: d947cc01e3c40f891e36f0871ce181965963e334 6c27cef04bc11514b91aa20f199e5bda9abe6207 Author: Marek Lindner mareklindner@neomailbox.ch Date: Mon Jun 6 23:40:54 2016 +0800
Merge branch 'next'
diff --combined net/batman-adv/routing.c index b9a500a,6c2901a..105f37c --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@@ -40,15 -40,12 +40,15 @@@ #include "fragmentation.h" #include "hard-interface.h" #include "icmp_socket.h" +#include "log.h" #include "network-coding.h" #include "originator.h" #include "packet.h" #include "send.h" #include "soft-interface.h" +#include "tp_meter.h" #include "translation-table.h" +#include "tvlv.h"
static int batadv_route_unicast_packet(struct sk_buff *skb, struct batadv_hard_iface *recv_if); @@@ -271,20 -268,10 +271,20 @@@ static int batadv_recv_my_icmp_packet(s icmph->ttl = BATADV_TTL;
res = batadv_send_skb_to_orig(skb, orig_node, NULL); - if (res != NET_XMIT_DROP) + if (res == -1) + goto out; + + if (dev_xmit_complete(res)) ret = NET_RX_SUCCESS;
break; + case BATADV_TP: + if (!pskb_may_pull(skb, sizeof(struct batadv_icmp_tp_packet))) + goto out; + + batadv_tp_meter_recv(bat_priv, skb); + ret = NET_RX_SUCCESS; + goto out; default: /* drop unknown type */ goto out; @@@ -303,7 -290,7 +303,7 @@@ static int batadv_recv_icmp_ttl_exceede struct batadv_hard_iface *primary_if = NULL; struct batadv_orig_node *orig_node = NULL; struct batadv_icmp_packet *icmp_packet; - int ret = NET_RX_DROP; + int res, ret = NET_RX_DROP;
icmp_packet = (struct batadv_icmp_packet *)skb->data;
@@@ -334,8 -321,7 +334,8 @@@ icmp_packet->msg_type = BATADV_TTL_EXCEEDED; icmp_packet->ttl = BATADV_TTL;
- if (batadv_send_skb_to_orig(skb, orig_node, NULL) != NET_XMIT_DROP) + res = batadv_send_skb_to_orig(skb, orig_node, NULL); + if (res != -1 && dev_xmit_complete(res)) ret = NET_RX_SUCCESS;
out: @@@ -355,7 -341,7 +355,7 @@@ int batadv_recv_icmp_packet(struct sk_b struct ethhdr *ethhdr; struct batadv_orig_node *orig_node = NULL; int hdr_size = sizeof(struct batadv_icmp_header); - int ret = NET_RX_DROP; + int res, ret = NET_RX_DROP;
/* drop packet if it has not necessary minimum size */ if (unlikely(!pskb_may_pull(skb, hdr_size))) @@@ -388,6 -374,7 +388,7 @@@ if (skb_cow(skb, ETH_HLEN) < 0) goto out;
+ ethhdr = eth_hdr(skb); icmph = (struct batadv_icmp_header *)skb->data; icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmph; if (icmp_packet_rr->rr_cur >= BATADV_RR_LEN) @@@ -421,8 -408,7 +422,8 @@@ icmph->ttl--;
/* route it */ - if (batadv_send_skb_to_orig(skb, orig_node, recv_if) != NET_XMIT_DROP) + res = batadv_send_skb_to_orig(skb, orig_node, recv_if); + if (res != -1 && dev_xmit_complete(res)) ret = NET_RX_SUCCESS;
out: @@@ -659,8 -645,6 +660,8 @@@ static int batadv_route_unicast_packet(
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) { @@@ -668,10 -652,12 +669,10 @@@ batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD); batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES, len + ETH_HLEN); + }
+ if (dev_xmit_complete(res)) ret = NET_RX_SUCCESS; - } else if (res == NET_XMIT_POLICED) { - /* skb was buffered and consumed */ - ret = NET_RX_SUCCESS; - }
out: if (orig_node) @@@ -1021,8 -1007,6 +1022,8 @@@ int batadv_recv_frag_packet(struct sk_b if (!orig_node_src) goto out;
+ skb->priority = frag_packet->priority + 256; + /* Route the fragment if it is not for us and too big to be merged. */ if (!batadv_is_my_mac(bat_priv, frag_packet->dest) && batadv_frag_skb_fwd(skb, recv_if, orig_node_src)) {