|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (C) 2007-2010 B.A.T.M.A.N. contributors:
|
|
|
+ * Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
|
|
|
*
|
|
|
* Marek Lindner, Simon Wunderlich
|
|
|
*
|
|
@@ -433,8 +433,7 @@ static char count_real_packets(struct ethhdr *ethhdr,
|
|
|
}
|
|
|
|
|
|
/* copy primary address for bonding */
|
|
|
-static void mark_bonding_address(struct bat_priv *bat_priv,
|
|
|
- struct orig_node *orig_node,
|
|
|
+static void mark_bonding_address(struct orig_node *orig_node,
|
|
|
struct orig_node *orig_neigh_node,
|
|
|
struct batman_packet *batman_packet)
|
|
|
|
|
@@ -447,8 +446,7 @@ static void mark_bonding_address(struct bat_priv *bat_priv,
|
|
|
}
|
|
|
|
|
|
/* mark possible bond.candidates in the neighbor list */
|
|
|
-void update_bonding_candidates(struct bat_priv *bat_priv,
|
|
|
- struct orig_node *orig_node)
|
|
|
+void update_bonding_candidates(struct orig_node *orig_node)
|
|
|
{
|
|
|
int candidates;
|
|
|
int interference_candidate;
|
|
@@ -730,9 +728,8 @@ void receive_bat_packet(struct ethhdr *ethhdr,
|
|
|
update_orig(bat_priv, orig_node, ethhdr, batman_packet,
|
|
|
if_incoming, hna_buff, hna_buff_len, is_duplicate);
|
|
|
|
|
|
- mark_bonding_address(bat_priv, orig_node,
|
|
|
- orig_neigh_node, batman_packet);
|
|
|
- update_bonding_candidates(bat_priv, orig_node);
|
|
|
+ mark_bonding_address(orig_node, orig_neigh_node, batman_packet);
|
|
|
+ update_bonding_candidates(orig_node);
|
|
|
|
|
|
/* is single hop (direct) neighbor */
|
|
|
if (is_single_hop_neigh) {
|
|
@@ -810,13 +807,11 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
|
|
|
{
|
|
|
struct orig_node *orig_node;
|
|
|
struct icmp_packet_rr *icmp_packet;
|
|
|
- struct ethhdr *ethhdr;
|
|
|
struct batman_if *batman_if;
|
|
|
int ret;
|
|
|
uint8_t dstaddr[ETH_ALEN];
|
|
|
|
|
|
icmp_packet = (struct icmp_packet_rr *)skb->data;
|
|
|
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
|
|
|
|
|
/* add data to device queue */
|
|
|
if (icmp_packet->msg_type != ECHO_REQUEST) {
|
|
@@ -848,7 +843,6 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
|
|
|
return NET_RX_DROP;
|
|
|
|
|
|
icmp_packet = (struct icmp_packet_rr *)skb->data;
|
|
|
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
|
|
|
|
|
memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN);
|
|
|
memcpy(icmp_packet->orig,
|
|
@@ -866,17 +860,15 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
|
|
|
}
|
|
|
|
|
|
static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
|
|
|
- struct sk_buff *skb, size_t icmp_len)
|
|
|
+ struct sk_buff *skb)
|
|
|
{
|
|
|
struct orig_node *orig_node;
|
|
|
struct icmp_packet *icmp_packet;
|
|
|
- struct ethhdr *ethhdr;
|
|
|
struct batman_if *batman_if;
|
|
|
int ret;
|
|
|
uint8_t dstaddr[ETH_ALEN];
|
|
|
|
|
|
icmp_packet = (struct icmp_packet *)skb->data;
|
|
|
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
|
|
|
|
|
/* send TTL exceeded if packet is an echo request (traceroute) */
|
|
|
if (icmp_packet->msg_type != ECHO_REQUEST) {
|
|
@@ -909,7 +901,6 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
|
|
|
return NET_RX_DROP;
|
|
|
|
|
|
icmp_packet = (struct icmp_packet *) skb->data;
|
|
|
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
|
|
|
|
|
memcpy(icmp_packet->dst, icmp_packet->orig, ETH_ALEN);
|
|
|
memcpy(icmp_packet->orig,
|
|
@@ -978,7 +969,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
|
|
|
|
|
|
/* TTL exceeded */
|
|
|
if (icmp_packet->ttl < 2)
|
|
|
- return recv_icmp_ttl_exceeded(bat_priv, skb, hdr_size);
|
|
|
+ return recv_icmp_ttl_exceeded(bat_priv, skb);
|
|
|
|
|
|
ret = NET_RX_DROP;
|
|
|
|
|
@@ -1001,7 +992,6 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
|
|
|
return NET_RX_DROP;
|
|
|
|
|
|
icmp_packet = (struct icmp_packet_rr *)skb->data;
|
|
|
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
|
|
|
|
|
/* decrement ttl */
|
|
|
icmp_packet->ttl--;
|
|
@@ -1193,7 +1183,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if,
|
|
|
dstaddr);
|
|
|
|
|
|
if (unicast_packet->packet_type == BAT_UNICAST_FRAG &&
|
|
|
- 2 * skb->len - hdr_size <= batman_if->net_dev->mtu) {
|
|
|
+ frag_can_reassemble(skb, batman_if->net_dev->mtu)) {
|
|
|
|
|
|
ret = frag_reassemble_skb(skb, bat_priv, &new_skb);
|
|
|
|