有的win2000机器上,运行完全正常,有的win2000上只能抓到进来的包,一个出去的包也没抓到,实在不明白原因。
双贴200分求助!

解决方案 »

  1.   

    对,除了发给本机的包,只要看到的包都抓的到。
    可我现在就是要发给自己的数据包啊,sigh
      

  2.   

    raw socket只不过把等级设定低了一点,可以收到所有IP层的包。
    既然它只不过是调用了recv函数而已,当然只能接收数据包,那么它如何可能截获到你发送的数据包呢?如果你确实想截获发送的数据包,你应该使用驱动或者使用现成的winpcap,而不是使用raw socket来接收(注意:只是接收而已)数据包。
      

  3.   

    raw socket有丢包,但是没有缓冲,相应速度比winpcap快。
    我的冬冬里面,这点时间可要命啊。
      

  4.   

    真是奇了,很多人都反映有这样的事情,如果是bug为什么现在还没有纠正过来?我以前测试过很多主机,确实是有这样的情况存在,不过2000的主机基本都没有问题,xp出现异常情况的比例比较大
      

  5.   

    不行的话楼主就用winpcap,这是没有问题的,所有的包都能抓到
      

  6.   

    回复人: gracezhu(eutom) ( ) 信誉:100 
    搜索这个版的旧贴,事实确实如此
    帅哥,贴出来,200分贡献给你。:D理论上的东西和实际有区别的,我发现不止我一个人问这个问题了;
    "如何可能"确实发生了.
      

  7.   

    真是奇了,很多人都反映有这样的事情,如果是bug为什么现在还没有纠正过来?我以前测试过很多主机,确实是有这样的情况存在,不过2000的主机基本都没有问题,xp出现异常情况的比例比较大
    ++++++++++++++++++++++++
    猪哥哥:
    给点相关的帖子嘛;
      

  8.   

    唉,给你相关的帖子也没有用啊,还没有什么有效的解决方案的要不就用winpcap驱动得了呵呵,winpcap抓包是没有任何问题的呵呵你要相关资料的话再联系我了
      

  9.   

    Sorry for repetition, but I've revealed this possibility only after I had posted the question.
    I am registered to access MSDN managed newsgroups now and I am waiting for the support from MS Professionals.
    The question:As I wrote in older thread, we create a sniffer, based on raw sockets with the netcard in promiscuous mode.Fragment of our code:socket( AF_INET, SOCK_RAW , IPPROTO_IP ) ;
    setsockopt( rawsocket , SOL_SOCKET , SO_RCVTIMEO, (const char *)&rcvtimeo , sizeof(rcvtimeo) );
    bind(rawsocket,(PSOCKADDR)&sa, sizeof(sa));
    ioctlsocket( rawsocket, SIO_RCVALL, &flag));
    recv(rawsocket, (char*)(buffer) , sizeof(buffer), 0 );There is the problem to capture outgoing traffic from own computer. We see only incoming IP packets.
    We tested the program on Windows 2000, Windows XP Professional and Windows 2003 Server
    There is the problem only on Windows XP Professional (SP1). The tests was run on some computers with different network cards and connected to different network devices.
    After we've upgraded Windows XP Professional (SP1) to Windows XP SP2 Beta Build 2082, the problem had vanished completely. It was done on some computers with Windows XP Professional (SP1) and effect was same.But we have some doubts about it. May be we done something improperly?Could anybody say something about the problem and give me a reference to Windows XP Professional bugs list, corrected in SP2 Beta, or article about the problem?
     
     
     
    Expand AllCollapse All  
    ================================
    Hi Denis,
    I have it reproed with your code and a sniffer of mine. I find the key to this problem is kB818043 "L2TP/IPSec NAT-T Update for Windows XP and Windows 
    2000". (you can find the update information on sp1 at http://support.microsoft.com/?id=818043#5)
    This update enhances the current functionality of L2TP and IPSec, but it breaks the raw socket as we saw in our tests.Fortunately, it has been fixed in the XP sp2b (since the sp2 is not officially released, the update list is not available at present. Thanks).Best regards,
    Rhett Gong [MSFT]
    Microsoft Online Partner SupportThis posting is provided "AS IS" with no warranties, and confers no rights.
    Please reply to newsgroups only. Thanks. 
    ===========================================