[ofw] [PATCH 1/2] IPoIB PXE boot support: Filter proxy DHCP requests too

Fab Tillier ftillier at windows.microsoft.com
Wed May 27 10:04:22 PDT 2009


In the later stages of PXE boot, a proxy DHCP request can be received.  Currently that request will not get the DHCP filtering resulting in a DHCP packet that the proxy DHCP server doesn't understand.  The patch defines the proxy DHCP port, and adds filtering for received DHCP packets that come to/from a proxy DHCP server.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c	(revision 2205)
+++ ulp/ipoib/kernel/ipoib_port.c	(working copy)
@@ -2072,7 +2072,11 @@ __recv_mgr_filter(
 			if( (p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_SERVER &&
 				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_CLIENT) ||
 				(p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_CLIENT &&
-				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_SERVER) )
+				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_SERVER) ||
+				(p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_PROXY_SERVER &&
+				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_CLIENT) ||
+				(p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_CLIENT &&
+				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_PROXY_SERVER) )
 			{
 				if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) +
 					sizeof(udp_hdr_t) + DHCP_MIN_SIZE) )
@@ -2256,7 +2260,7 @@ __recv_dhcp(
 		return IB_INVALID_PARAMETER;
 	}
 
-	p_option = &p_dhcp->options[4];
+	p_option = &p_dhcp->options[DHCP_COOKIE_SIZE];
 	while( *p_option != DHCP_OPT_END && p_option < &p_dhcp->options[312] )
 	{
 		switch( *p_option )
Index: inc/kernel/ip_packet.h
===================================================================
--- inc/kernel/ip_packet.h	(revision 2205)
+++ inc/kernel/ip_packet.h	(working copy)
@@ -432,6 +432,7 @@ typedef struct _igmp_v2_hdr
 
 #define DHCP_PORT_SERVER		CL_HTON16(67)
 #define DHCP_PORT_CLIENT		CL_HTON16(68)
+#define DHCP_PORT_PROXY_SERVER	CL_HTON16(4011)
 
 #define DHCP_REQUEST			1
 #define DHCP_REPLY				2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_pxe1.patch
Type: application/octet-stream
Size: 1687 bytes
Desc: ipoib_pxe1.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090527/adecf298/attachment.obj>


More information about the ofw mailing list