mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	batman-adv: don't check the source address twice
The source address has already been checked in batadv_check_management_packet() upon packet reception and therefore it does not need to be checked again in ogm_process() Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
		
							parent
							
								
									d1dc30739c
								
							
						
					
					
						commit
						281581d3e7
					
				
					 1 changed files with 1 additions and 11 deletions
				
			
		|  | @ -988,7 +988,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | ||||||
| 	struct batadv_neigh_node *orig_neigh_router = NULL; | 	struct batadv_neigh_node *orig_neigh_router = NULL; | ||||||
| 	int has_directlink_flag; | 	int has_directlink_flag; | ||||||
| 	int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; | 	int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; | ||||||
| 	int is_broadcast = 0, is_bidirect; | 	int is_bidirect; | ||||||
| 	bool is_single_hop_neigh = false; | 	bool is_single_hop_neigh = false; | ||||||
| 	bool is_from_best_next_hop = false; | 	bool is_from_best_next_hop = false; | ||||||
| 	int is_duplicate, sameseq, simlar_ttl; | 	int is_duplicate, sameseq, simlar_ttl; | ||||||
|  | @ -1051,9 +1051,6 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | ||||||
| 		if (batadv_compare_eth(batadv_ogm_packet->prev_sender, | 		if (batadv_compare_eth(batadv_ogm_packet->prev_sender, | ||||||
| 				       hard_iface->net_dev->dev_addr)) | 				       hard_iface->net_dev->dev_addr)) | ||||||
| 			is_my_oldorig = 1; | 			is_my_oldorig = 1; | ||||||
| 
 |  | ||||||
| 		if (is_broadcast_ether_addr(ethhdr->h_source)) |  | ||||||
| 			is_broadcast = 1; |  | ||||||
| 	} | 	} | ||||||
| 	rcu_read_unlock(); | 	rcu_read_unlock(); | ||||||
| 
 | 
 | ||||||
|  | @ -1071,13 +1068,6 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (is_broadcast) { |  | ||||||
| 		batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |  | ||||||
| 			   "Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n", |  | ||||||
| 			   ethhdr->h_source); |  | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (is_my_orig) { | 	if (is_my_orig) { | ||||||
| 		unsigned long *word; | 		unsigned long *word; | ||||||
| 		int offset; | 		int offset; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Antonio Quartulli
						Antonio Quartulli