Project

General

Profile

Bug #216 » 0001-batman-adv-avoid-DAT-to-mess-up-LAN-state.patch

Antonio Quartulli, 06/01/2015 05:35 PM

View differences:

distributed-arp-table.c
1107 1107
 * @bat_priv: the bat priv with all the soft interface information
1108 1108
 * @skb: packet to check
1109 1109
 * @hdr_size: size of the encapsulation header
1110
 *
1111
 * Returns true if the packet was snooped and consumed by DAT. False if the
1112
 * packet has to be delivered to the interface
1110 1113
 */
1111 1114
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
1112 1115
					 struct sk_buff *skb, int hdr_size)
......
1114 1117
	uint16_t type;
1115 1118
	__be32 ip_src, ip_dst;
1116 1119
	uint8_t *hw_src, *hw_dst;
1117
	bool ret = false;
1120
	bool dropped = false;
1118 1121
	unsigned short vid;
1119 1122

  
1120 1123
	if (!atomic_read(&bat_priv->distributed_arp_table))
......
1143 1146
	/* if this REPLY is directed to a client of mine, let's deliver the
1144 1147
	 * packet to the interface
1145 1148
	 */
1146
	ret = !batadv_is_my_client(bat_priv, hw_dst, vid);
1149
	dropped = !batadv_is_my_client(bat_priv, hw_dst, vid);
1150

  
1151
	/* if this REPLY is sent on behalf of a client of mine, let's drop the
1152
	 * packet because the client will reply by itself
1153
	 */
1154
	dropped |= batadv_is_my_client(bat_priv, hw_src, vid);
1147 1155
out:
1148
	if (ret)
1156
	if (dropped)
1149 1157
		kfree_skb(skb);
1150
	/* if ret == false -> packet has to be delivered to the interface */
1151
	return ret;
1158
	/* if dropped == false -> deliver to the interface */
1159
	return dropped;
1152 1160
}
1153 1161

  
1154 1162
/**
1155
- 
(1-1/4)