dev: update __dev_notify_flags() to send rtnl msg
This patch only prepares the next one, there is no functional change. Now, __dev_notify_flags() can also be used to notify flags changes via rtnetlink. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
					parent
					
						
							
								e058495126
							
						
					
				
			
			
				commit
				
					
						a528c219df
					
				
			
		
					 3 changed files with 10 additions and 8 deletions
				
			
		|  | @ -5235,10 +5235,14 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags) | |||
| 	return ret; | ||||
| } | ||||
| 
 | ||||
| void __dev_notify_flags(struct net_device *dev, unsigned int old_flags) | ||||
| void __dev_notify_flags(struct net_device *dev, unsigned int old_flags, | ||||
| 			unsigned int gchanges) | ||||
| { | ||||
| 	unsigned int changes = dev->flags ^ old_flags; | ||||
| 
 | ||||
| 	if (gchanges) | ||||
| 		rtmsg_ifinfo(RTM_NEWLINK, dev, gchanges); | ||||
| 
 | ||||
| 	if (changes & IFF_UP) { | ||||
| 		if (dev->flags & IFF_UP) | ||||
| 			call_netdevice_notifiers(NETDEV_UP, dev); | ||||
|  | @ -5274,10 +5278,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags) | |||
| 		return ret; | ||||
| 
 | ||||
| 	changes = old_flags ^ dev->flags; | ||||
| 	if (changes) | ||||
| 		rtmsg_ifinfo(RTM_NEWLINK, dev, changes); | ||||
| 
 | ||||
| 	__dev_notify_flags(dev, old_flags); | ||||
| 	__dev_notify_flags(dev, old_flags, changes); | ||||
| 	return ret; | ||||
| } | ||||
| EXPORT_SYMBOL(dev_change_flags); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nicolas Dichtel
				Nicolas Dichtel