内核收到包后(netif_receive_skb),
|
|—— 检测嗅探器,把包的副本给每个嗅探器
|
判断该包是否属于网桥-->handle_bridge --> br_handle_frame 钩子:
netfilet_bridge.h 中定义
|/* Bridge Hooks */
/* After promisc drops, checksum checks. */#define NF_BR_PRE_ROUTING 0/* If the packet is destined for this box. */#define NF_BR_LOCAL_IN 1/* If the packet is destined for another interface. */#define NF_BR_FORWARD 2/* Packets coming from a local process. */#define NF_BR_LOCAL_OUT 3/* Packets about to hit the wire. */#define NF_BR_POST_ROUTING 4/* Not really a hook, but used for the ebtables broute table */#define NF_BR_BROUTING 5#define NF_BR_NUMHOOKS 6
钩子协议类型(pf) : NFPROTO_BRIDGE netfilet.h中定义或者 AF_BRIDGE socket.h(include/linux) 中定义 两者值相等
判断该包类型(根据以太网头判断包协议类型)
|