- 論壇徽章:
- 9
|
回復(fù) 4# contestjia
給你查到了。從PRE_ROUTING的定義點(diǎn),我們可以看出,混雜模式收到包都已經(jīng)被扔了。- /* IP Hooks */
- /* After promisc drops, checksum checks. */
- #define NF_IP_PRE_ROUTING 0
- /* If the packet is destined for this box. */
- #define NF_IP_LOCAL_IN 1
- /* If the packet is destined for another interface. */
- #define NF_IP_FORWARD 2
- /* Packets coming from a local process. */
- #define NF_IP_LOCAL_OUT 3
- /* Packets about to hit the wire. */
- #define NF_IP_POST_ROUTING 4
- #define NF_IP_NUMHOOKS 5
復(fù)制代碼- int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
- {
- struct iphdr *iph;
- u32 len;
- if (dev->nd_net != &init_net)
- goto drop;
- /* When the interface is in promisc. mode, drop all the crap
- * that it receives, do not try to analyse it.
- */
- if (skb->pkt_type == PACKET_OTHERHOST)
- goto drop;
- 。。。。。。
- /* Remove any debris in the socket control block */
- memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
- return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL,
- ip_rcv_finish);
- inhdr_error:
- IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
- drop:
- kfree_skb(skb);
- out:
- return NET_RX_DROP;
復(fù)制代碼 以上代碼的內(nèi)核版本為2.6.34.10
|
|