forked from mirrors/linux
		
	xfrm: add missed call to delete offloaded policies
Offloaded policies are deleted through two flows: netdev is going
down and policy flush.
In both cases, the code lacks relevant call to delete offloaded policy.
Fixes: 919e43fad5 ("xfrm: add an interface to offload policy")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
			
			
This commit is contained in:
		
							parent
							
								
									a287f5b0cf
								
							
						
					
					
						commit
						bf06fcf4be
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -1831,6 +1831,7 @@ int xfrm_policy_flush(struct net *net, u8 type, bool task_valid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		__xfrm_policy_unlink(pol, dir);
 | 
							__xfrm_policy_unlink(pol, dir);
 | 
				
			||||||
		spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
 | 
							spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
 | 
				
			||||||
 | 
							xfrm_dev_policy_delete(pol);
 | 
				
			||||||
		cnt++;
 | 
							cnt++;
 | 
				
			||||||
		xfrm_audit_policy_delete(pol, 1, task_valid);
 | 
							xfrm_audit_policy_delete(pol, 1, task_valid);
 | 
				
			||||||
		xfrm_policy_kill(pol);
 | 
							xfrm_policy_kill(pol);
 | 
				
			||||||
| 
						 | 
					@ -1869,6 +1870,7 @@ int xfrm_dev_policy_flush(struct net *net, struct net_device *dev,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		__xfrm_policy_unlink(pol, dir);
 | 
							__xfrm_policy_unlink(pol, dir);
 | 
				
			||||||
		spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
 | 
							spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
 | 
				
			||||||
 | 
							xfrm_dev_policy_delete(pol);
 | 
				
			||||||
		cnt++;
 | 
							cnt++;
 | 
				
			||||||
		xfrm_audit_policy_delete(pol, 1, task_valid);
 | 
							xfrm_audit_policy_delete(pol, 1, task_valid);
 | 
				
			||||||
		xfrm_policy_kill(pol);
 | 
							xfrm_policy_kill(pol);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue