hillzzz
驱动牛犊
驱动牛犊
  • 注册日期2007-05-25
  • 最后登录2007-07-04
  • 粉丝0
  • 关注0
  • 积分30分
  • 威望4点
  • 贡献值0点
  • 好评度3点
  • 原创分0分
  • 专家分0分
阅读:1487回复:0

如何理解 Packets Passed by Calling NdisMIndicateReceivPacket Are Ignored

楼主#
更多 发布于:2007-07-03 16:23
以下一段来自ndis.com 网站。想请教各位如何理解其中的 MAC Header + LookaheadData
众所周知,Mac Header 为 12, LookHeadData 就不知道为多少了,或者随便给LookaHeadData 赋值为144, 那么在分配NdisBuffer时,是否要至少要这样Allocate 长度为 1500 (Data Length) + 12(Mac) + 2 (type) + Lookaheaddata length , 采用IP 分组的Ethernet 封装, 不知这样理解对不对。

另外各位是否有遇到文中提到的NdisMIndicateReceivePacket 提交的Packet 被 TCP/IP 忽略的情况?
Thanks everyone.

Packets Passed by Calling NdisMIndicateReceivPacket Are Ignored
(TCP/IP ReceivePacket Handler Bug)
Windows 2000 and Higher
Summary
There are situations where a packet passed to TCP/IP via a call to NdisMIndicateReceivePacket is apparently ignored by TCP/IP.

 

Discussion
Although there may be a variety of reasons for this behavior, there are also two (2) known bugs in the TCP/IP stack that must be accounted for.

These bugs effect how your miniport or NDIS IM miniport edge constructs a NDIS_PACKET to be indicated upwards as received data. If the packet is not constructed as necessary to accommodate these bugs, then the TCP/IP ReceivePacketHandler will essentially ignore the packet.

 

Resolution
Problem 1: Constraint On Characteristics Of First NDIS Buffer
 The TCP/IP ReceivePacketHandler does not handle the case where the virtual memory that would represent the LookAheadBuffer area spans multiple NDIS_BUFFERs (MDLs).

You must make sure that the first NDIS_BUFFER (MDL) in the NDIS_PACKET you indicate for reception (using old or new function does matter) has at least the MAC Header plus the LookAhead size (OID_GEN_CURRENT_LOOKAHEAD) packet data.

 When constructing a NDIS_PACKET to be indicated upwards as received data, insure that the first NDIS_BUFFER describes:

 MAC Header - Media-specific.
 LookaheadData - Consistent with the information returned by OID_GEN_CURRENT_LOOKAHEAD.

As far as known, this bug is present in Windows 2000 through at least SP1 as well as Windows XP. This bug will never be fixed and has become part of the NDIS specification.

 

游客

返回顶部