1 2 3 4 5 6 7 8 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) if (skb->dev->br_port != NULL && br_handle_frame_hook != NULL) { handle_bridge(skb, pt_prev); dev_put(rx_dev); continue; } #endif |
1 2 3 4 5 6 7 8 | if (br->dev.flags & IFF_PROMISC) { struct sk_buff *skb2; skb2 = skb_clone(skb, GFP_ATOMIC); if (skb2) { passedup = 1; br_pass_frame_up(br, skb2); } } |
1 2 | if (skb->mac.ethernet->h_source[0] & 1) goto freeandout; |
1 2 3 4 5 6 7 8 9 10 | if (!passedup && (dest[0] & 1) && (br->dev.flags & IFF_ALLMULTI || br->dev.mc_list != NULL)) { struct sk_buff *skb2; skb2 = skb_clone(skb, GFP_ATOMIC); if (skb2) { passedup = 1; br_pass_frame_up(br, skb2); } } |
1 2 3 4 | if (br->stp_enabled && !memcmp(dest, bridge_ula, 5) && !(dest[5] & 0xF0)) goto handle_special_frame; |
1 2 3 | if (p->state == BR_STATE_LEARNING || p->state == BR_STATE_FORWARDING) br_fdb_insert(br, p, skb->mac.ethernet->h_source, 0); |
1 2 3 4 5 6 7 8 | if (dest[0] & 1) { br_flood(br, skb, 1); if (!passedup) br_pass_frame_up(br, skb); else kfree_skb(skb); return; } |
1 | dst = br_fdb_get(br, dest); |
1 2 3 4 5 6 7 8 | if (dst != NULL && dst->is_local) { if (!passedup) br_pass_frame_up(br, skb); else kfree_skb(skb); br_fdb_put(dst); return; } |
1 2 3 4 5 | if (dst != NULL) { br_forward(dst->dst, skb); br_fdb_put(dst); return; } |
1 2 | br_flood(br, skb, 0); return; |
1 2 3 4 5 6 7 8 9 10 | static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb) { br->statistics.rx_packets++; br->statistics.rx_bytes += skb->len; skb->dev = &br->dev; skb->pkt_type = PACKET_HOST; skb_pull(skb, skb->mac.raw - skb->data); skb->protocol = eth_type_trans(skb, &br->dev); netif_rx(skb); } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |