forked from mirrors/linux
		
	sctp: Do not try to search for the transport twice
When removing an non-primary transport during ASCONF processing, we end up traversing the transport list twice: once in sctp_cmd_del_non_primary, and once in sctp_assoc_del_peer. We can avoid the second search and call sctp_assoc_rm_peer() instead. Found by code inspection during code reviews. Signed-off-by: Vladislav Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									b0d4943eec
								
							
						
					
					
						commit
						73e6742027
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -954,7 +954,7 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc) | ||||||
| 		t = list_entry(pos, struct sctp_transport, transports); | 		t = list_entry(pos, struct sctp_transport, transports); | ||||||
| 		if (!sctp_cmp_addr_exact(&t->ipaddr, | 		if (!sctp_cmp_addr_exact(&t->ipaddr, | ||||||
| 					 &asoc->peer.primary_addr)) { | 					 &asoc->peer.primary_addr)) { | ||||||
| 			sctp_assoc_del_peer(asoc, &t->ipaddr); | 			sctp_assoc_rm_peer(asoc, t); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Vlad Yasevich
						Vlad Yasevich