mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-18 22:14:16 +00:00 
			
		
		
		
	net-loopback: set lo dev initial state to UP
Traditionally loopback devices come up with initial state as DOWN for any new network-namespace. This would mean that anyone needing this device would have to bring this UP by issuing something like 'ip link set lo up'. This can be avoided if the initial state is set as UP. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: Jian Yang <jianyang@google.com> Link: https://lore.kernel.org/r/20210201233445.2044327-1-jianyang.kernel@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
		
							parent
							
								
									e64ffa8875
								
							
						
					
					
						commit
						c9dca822c7
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -219,6 +219,12 @@ static __net_init int loopback_net_init(struct net *net) | ||||||
| 
 | 
 | ||||||
| 	BUG_ON(dev->ifindex != LOOPBACK_IFINDEX); | 	BUG_ON(dev->ifindex != LOOPBACK_IFINDEX); | ||||||
| 	net->loopback_dev = dev; | 	net->loopback_dev = dev; | ||||||
|  | 
 | ||||||
|  | 	/* bring loopback device UP */ | ||||||
|  | 	rtnl_lock(); | ||||||
|  | 	dev_open(dev, NULL); | ||||||
|  | 	rtnl_unlock(); | ||||||
|  | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| 
 | 
 | ||||||
| out_free_netdev: | out_free_netdev: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jian Yang
						Jian Yang