QUOTE:原帖由 Joephy 于 2009-8-6 12:36 发表

混杂是不行的,包进协议栈的时候被丢了
白金版主觉得类似黑洞路由的方案可行么(听人说的,还没有配过)
377 /*
378 * Main IP Receive routine.
379 */
380 int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
381 {
382 struct iphdr *iph;
383 u32 len;
384
385 /* When the interface is in promisc. mode, drop all the crap
386 * that it receives, do not try to analyse it.
387 */
388 if (skb->pkt_type == PACKET_OTHERHOST)
389 goto drop;
390
……
……
……
432 /* Our transport medium may have padded the buffer out. Now we know it
433 * is IP we can trim to the true length of the frame.
434 * Note this now means skb->len holds ntohs(iph->tot_len).
435 */
436 if (pskb_trim_rcsum(skb, len)) {
437 IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
438 goto drop;
439 }
440
441 /* Remove any debris in the socket control block */
442 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
443
444 return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL,
445 ip_rcv_finish);
复制代码
的确,IP 栈一上来就把 OTHERHOST 包丢掉了,而之后才调用的 netfilter
不知道如果修改内核代码 IP 栈的实现,能不能解决这个问题……
另外我还不了解黑洞路由的技术实现,可能帮不上你什么
[ 本帖最后由 platinum 于 2009-8-6 14:56 编辑 ]