[ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets

Alex Naslednikov xalex at mellanox.co.il
Sun Jan 18 06:36:35 PST 2009


Several test were failed on sending UDP packets with MTU-like sizes.
Fragmented UDP packets do not contain UDP header, except the first one.
So, appropriate check was inserted.
 
This bug was shown rarely (only when the last fragment was less than 8
bytes), because the following check always worked (by mistake):
 
if( (p_udp_hdr->src_port != DHCP_PORT_CLIENT ||
  p_udp_hdr->dst_port != DHCP_PORT_SERVER) &&
  (p_udp_hdr->src_port != DHCP_PORT_SERVER ||
  p_udp_hdr->dst_port != DHCP_PORT_CLIENT) )
 {
  /* Not a DHCP packet. */
  return NDIS_STATUS_PENDING;
 }
 
Index: ipoib_port.c
===================================================================
--- ipoib_port.c (revision 3752)
+++ ipoib_port.c (working copy)
@@ -3763,6 +3763,15 @@
   p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);
  }
  /* Get the UDP header and check the destination port numbers. */
+ 
+ if (p_ip_hdr->offset > 0) {
+  /* This is a fragmented part of UDP packet
+   * Only first packet will contain UDP header in such case
+   * So, return if offset > 0
+   */
+   return NDIS_STATUS_PENDING;
+ }
+   
  if( buf_len < sizeof(udp_hdr_t) )
  {
   IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090118/c8183d73/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_udp_mtu_patch.patch
Type: application/octet-stream
Size: 637 bytes
Desc: ipoib_udp_mtu_patch.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090118/c8183d73/attachment.obj>


More information about the ofw mailing list