分类: LINUX
2010-09-01 09:13:38
/srv/sources/sources/k/kernel/2.6.18-194.el5/pre-build /kernel-2.6.18/linux-2.6.18.x86_64/net/bridge/br_input.c int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb) { struct sk_buff *skb = *pskb; const unsigned char *dest = eth_hdr(skb)->h_dest; if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) goto err; /srv/sources/sources/k/kernel/2.6.18-194.el5/pre-build/ kernel-2.6.18/linux-2.6.18.x86_64/include/linux/etherdevice.h /** * is_valid_ether_addr - Determine if the given thernet address is valid * @addr: Pointer to a six-byte array containing the Ethernet address * * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not * a multicast address, and is not FF:FF:FF:FF:FF:FF. * * Return true if the address is valid. */ static inline int is_valid_ether_addr(const u8 *addr) { /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to * explicitly check for it here. */ return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); } /** * is_multicast_ether_addr - Determine if the Ethernet address is a multicast. * @addr: Pointer to a six-byte array containing the Ethernet address * * Return true if the address is a multicast address. * By definition the broadcast address is also a multicast address. */ static inline int is_multicast_ether_addr(const u8 *addr) { return (0x01 & addr[0]); }