[IPoIB] IPoIB PXE boot support: Clear remainder of chaddr
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Aug 2009 23:17:41 +0000 (23:17 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Aug 2009 23:17:41 +0000 (23:17 +0000)
    The IPoIB PXE boot firmware (gPXE) now sends the 8-byte port GUID in
    the DHCP chaddr field.  WinOF replaces the first 6 bytes of chaddr
    with the Ethernet-style MAC address, but leaves the remainder
    untouched.  This results in trailing garbage after the Ethernet-style
    MAC in the modified chaddr.

    Fix by explicitly zeroing the remainder of chaddr.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2364 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_port.c

index 59ab6ce..4d1736f 100644 (file)
@@ -2349,6 +2349,8 @@ __recv_dhcp(
                RtlFillMemory(&p_cid[11], 12, 0);\r
 \r
                RtlCopyMemory( p_dhcp->chaddr, &p_src->mac, sizeof(p_src->mac) );\r
+               RtlFillMemory( &p_dhcp->chaddr[sizeof(p_src->mac)],\r
+                              ( sizeof(p_dhcp->chaddr) - sizeof(p_src->mac) ), 0 );\r
        }\r
        IPOIB_EXIT( IPOIB_DBG_RECV );\r
        return status;\r