aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/etherdevice.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-23 00:47:29 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-23 00:47:29 -0400
commitbd072111e7319d90a7b8127f91c2806b9a6f279e (patch)
tree1686978814a2387ebfc16f9f5778a7f0caaf319b /include/linux/etherdevice.h
parent24d01c0681bfbc10a99304c48a89ad213d2d7a4b (diff)
parent4be3bd7849165e7efa6b0b35a23d6a3598d97465 (diff)
Merge commit 'v2.6.31-rc4' into next
Diffstat (limited to 'include/linux/etherdevice.h')
-rw-r--r--include/linux/etherdevice.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index a1f17abba7dc..3d7a6687d247 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -182,6 +182,33 @@ static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2],
182 return compare_ether_addr(addr1, addr2); 182 return compare_ether_addr(addr1, addr2);
183#endif 183#endif
184} 184}
185
186/**
187 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
188 * @dev: Pointer to a device structure
189 * @addr: Pointer to a six-byte array containing the Ethernet address
190 *
191 * Compare passed address with all addresses of the device. Return true if the
192 * address if one of the device addresses.
193 *
194 * Note that this function calls compare_ether_addr_64bits() so take care of
195 * the right padding.
196 */
197static inline bool is_etherdev_addr(const struct net_device *dev,
198 const u8 addr[6 + 2])
199{
200 struct netdev_hw_addr *ha;
201 int res = 1;
202
203 rcu_read_lock();
204 for_each_dev_addr(dev, ha) {
205 res = compare_ether_addr_64bits(addr, ha->addr);
206 if (!res)
207 break;
208 }
209 rcu_read_unlock();
210 return !res;
211}
185#endif /* __KERNEL__ */ 212#endif /* __KERNEL__ */
186 213
187/** 214/**