aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index b3d6dbc0c696..e916ba8caccf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -897,23 +897,25 @@ struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type)
897EXPORT_SYMBOL(dev_getfirstbyhwtype); 897EXPORT_SYMBOL(dev_getfirstbyhwtype);
898 898
899/** 899/**
900 * dev_get_by_flags_rcu - find any device with given flags 900 * __dev_get_by_flags - find any device with given flags
901 * @net: the applicable net namespace 901 * @net: the applicable net namespace
902 * @if_flags: IFF_* values 902 * @if_flags: IFF_* values
903 * @mask: bitmask of bits in if_flags to check 903 * @mask: bitmask of bits in if_flags to check
904 * 904 *
905 * Search for any interface with the given flags. Returns NULL if a device 905 * Search for any interface with the given flags. Returns NULL if a device
906 * is not found or a pointer to the device. Must be called inside 906 * is not found or a pointer to the device. Must be called inside
907 * rcu_read_lock(), and result refcount is unchanged. 907 * rtnl_lock(), and result refcount is unchanged.
908 */ 908 */
909 909
910struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short if_flags, 910struct net_device *__dev_get_by_flags(struct net *net, unsigned short if_flags,
911 unsigned short mask) 911 unsigned short mask)
912{ 912{
913 struct net_device *dev, *ret; 913 struct net_device *dev, *ret;
914 914
915 ASSERT_RTNL();
916
915 ret = NULL; 917 ret = NULL;
916 for_each_netdev_rcu(net, dev) { 918 for_each_netdev(net, dev) {
917 if (((dev->flags ^ if_flags) & mask) == 0) { 919 if (((dev->flags ^ if_flags) & mask) == 0) {
918 ret = dev; 920 ret = dev;
919 break; 921 break;
@@ -921,7 +923,7 @@ struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short if_flags
921 } 923 }
922 return ret; 924 return ret;
923} 925}
924EXPORT_SYMBOL(dev_get_by_flags_rcu); 926EXPORT_SYMBOL(__dev_get_by_flags);
925 927
926/** 928/**
927 * dev_valid_name - check if name is okay for network device 929 * dev_valid_name - check if name is okay for network device