Skip to content

Commit

Permalink
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Browse files Browse the repository at this point in the history
Included changes:
- ensure RecordRoute information is added to BAT_ICMP echo_request/reply only
- use VLAN_ETH_HLEN when possible
- use htons when possible
- substitute old fragmentation code with a new improved implementation by
  Martin Hundebøll
- create common header for BAT_ICMP packets to improve extendibility
- consider the network coding overhead when computing the overall room needed by
  batman headers
- add dummy soft-interface rx mode handler
- minor code refactoring and cleanups

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 17, 2013
2 parents ccdbb6e + a4deee1 commit d7a20c8
Show file tree
Hide file tree
Showing 22 changed files with 1,105 additions and 847 deletions.
2 changes: 1 addition & 1 deletion net/batman-adv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ batman-adv-y += bitarray.o
batman-adv-$(CONFIG_BATMAN_ADV_BLA) += bridge_loop_avoidance.o
batman-adv-y += debugfs.o
batman-adv-$(CONFIG_BATMAN_ADV_DAT) += distributed-arp-table.o
batman-adv-y += fragmentation.o
batman-adv-y += gateway_client.o
batman-adv-y += gateway_common.o
batman-adv-y += hard-interface.o
Expand All @@ -37,4 +38,3 @@ batman-adv-y += send.o
batman-adv-y += soft-interface.o
batman-adv-y += sysfs.o
batman-adv-y += translation-table.o
batman-adv-y += unicast.o
14 changes: 7 additions & 7 deletions net/batman-adv/bridge_loop_avoidance.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,25 +863,25 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
struct arphdr *arphdr;
uint8_t *hw_src, *hw_dst;
struct batadv_bla_claim_dst *bla_dst;
uint16_t proto;
__be16 proto;
int headlen;
unsigned short vid = BATADV_NO_FLAGS;
int ret;

ethhdr = eth_hdr(skb);

if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) {
if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
vhdr = (struct vlan_ethhdr *)ethhdr;
vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
vid |= BATADV_VLAN_HAS_TAG;
proto = ntohs(vhdr->h_vlan_encapsulated_proto);
proto = vhdr->h_vlan_encapsulated_proto;
headlen = sizeof(*vhdr);
} else {
proto = ntohs(ethhdr->h_proto);
proto = ethhdr->h_proto;
headlen = ETH_HLEN;
}

if (proto != ETH_P_ARP)
if (proto != htons(ETH_P_ARP))
return 0; /* not a claim frame */

/* this must be a ARP frame. check if it is a claim. */
Expand Down Expand Up @@ -1379,8 +1379,8 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,

ethhdr = (struct ethhdr *)(((uint8_t *)skb->data) + hdr_size);

if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) {
if (!pskb_may_pull(skb, hdr_size + sizeof(struct vlan_ethhdr)))
if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
if (!pskb_may_pull(skb, hdr_size + VLAN_ETH_HLEN))
return 0;

vhdr = (struct vlan_ethhdr *)(skb->data + hdr_size);
Expand Down
11 changes: 5 additions & 6 deletions net/batman-adv/distributed-arp-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "send.h"
#include "types.h"
#include "translation-table.h"
#include "unicast.h"

static void batadv_dat_purge(struct work_struct *work);

Expand Down Expand Up @@ -592,9 +591,9 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
goto free_orig;

tmp_skb = pskb_copy(skb, GFP_ATOMIC);
if (!batadv_unicast_4addr_prepare_skb(bat_priv, tmp_skb,
cand[i].orig_node,
packet_subtype)) {
if (!batadv_send_skb_prepare_unicast_4addr(bat_priv, tmp_skb,
cand[i].orig_node,
packet_subtype)) {
kfree_skb(tmp_skb);
goto free_neigh;
}
Expand Down Expand Up @@ -990,10 +989,10 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
* that a node not using the 4addr packet format doesn't support it.
*/
if (hdr_size == sizeof(struct batadv_unicast_4addr_packet))
err = batadv_unicast_4addr_send_skb(bat_priv, skb_new,
err = batadv_send_skb_unicast_4addr(bat_priv, skb_new,
BATADV_P_DAT_CACHE_REPLY);
else
err = batadv_unicast_send_skb(bat_priv, skb_new);
err = batadv_send_skb_unicast(bat_priv, skb_new);

if (!err) {
batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
Expand Down
Loading

0 comments on commit d7a20c8

Please sign in to comment.