14 #include <linux/slab.h>
15 #include <linux/kernel.h>
16 #include <linux/netdevice.h>
18 #include <linux/netfilter_bridge.h>
19 #include <linux/export.h>
29 static int br_pass_frame_up(
struct sk_buff *
skb)
35 u64_stats_update_begin(&brstats->
syncp);
38 u64_stats_update_end(&brstats->
syncp);
50 const unsigned char *
dest = eth_hdr(skb)->h_dest;
64 if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) &&
81 if (is_broadcast_ether_addr(dest))
83 else if (is_multicast_ether_addr(dest)) {
86 if ((mdst && mdst->
mglist) ||
87 br_multicast_is_router(br))
89 br_multicast_forward(mdst, skb, skb2);
96 br->
dev->stats.multicast++;
112 return br_pass_frame_up(skb2);
122 static int br_handle_local_finish(
struct sk_buff *
skb)
133 static inline int is_link_local(
const unsigned char *
dest)
139 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
150 const unsigned char *dest = eth_hdr(skb)->h_dest;
156 if (!is_valid_ether_addr(eth_hdr(skb)->
h_source))
163 p = br_port_get_rcu(skb->
dev);
165 if (
unlikely(is_link_local(dest))) {
183 if (p->
br->stp_enabled == BR_NO_STP)
192 if (p->
br->group_fwd_mask & (1
u << dest[5]))
198 NULL, br_handle_local_finish)) {
215 dest = eth_hdr(skb)->h_dest;
219 if (ether_addr_equal(p->
br->dev->dev_addr, dest))