|
@@ -1138,6 +1138,9 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
|
|
* @bat_priv: the bat priv with all the soft interface information
|
|
* @bat_priv: the bat priv with all the soft interface information
|
|
* @skb: packet to check
|
|
* @skb: packet to check
|
|
* @hdr_size: size of the encapsulation header
|
|
* @hdr_size: size of the encapsulation header
|
|
|
|
+ *
|
|
|
|
+ * Returns true if the packet was snooped and consumed by DAT. False if the
|
|
|
|
+ * packet has to be delivered to the interface
|
|
*/
|
|
*/
|
|
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
|
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
|
struct sk_buff *skb, int hdr_size)
|
|
struct sk_buff *skb, int hdr_size)
|
|
@@ -1145,7 +1148,7 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
|
uint16_t type;
|
|
uint16_t type;
|
|
__be32 ip_src, ip_dst;
|
|
__be32 ip_src, ip_dst;
|
|
uint8_t *hw_src, *hw_dst;
|
|
uint8_t *hw_src, *hw_dst;
|
|
- bool ret = false;
|
|
|
|
|
|
+ bool dropped = false;
|
|
unsigned short vid;
|
|
unsigned short vid;
|
|
|
|
|
|
if (!atomic_read(&bat_priv->distributed_arp_table))
|
|
if (!atomic_read(&bat_priv->distributed_arp_table))
|
|
@@ -1174,12 +1177,17 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
|
/* if this REPLY is directed to a client of mine, let's deliver the
|
|
/* if this REPLY is directed to a client of mine, let's deliver the
|
|
* packet to the interface
|
|
* packet to the interface
|
|
*/
|
|
*/
|
|
- ret = !batadv_is_my_client(bat_priv, hw_dst, vid);
|
|
|
|
|
|
+ dropped = !batadv_is_my_client(bat_priv, hw_dst, vid);
|
|
|
|
+
|
|
|
|
+ /* if this REPLY is sent on behalf of a client of mine, let's drop the
|
|
|
|
+ * packet because the client will reply by itself
|
|
|
|
+ */
|
|
|
|
+ dropped |= batadv_is_my_client(bat_priv, hw_src, vid);
|
|
out:
|
|
out:
|
|
- if (ret)
|
|
|
|
|
|
+ if (dropped)
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
- /* if ret == false -> packet has to be delivered to the interface */
|
|
|
|
- return ret;
|
|
|
|
|
|
+ /* if dropped == false -> deliver to the interface */
|
|
|
|
+ return dropped;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|