Author: cgutman
Date: Tue Jan 13 11:42:01 2009
New Revision: 38747
URL:
http://svn.reactos.org/svn/reactos?rev=38747&view=rev
Log:
- Don't store a null pointer to the protocol table
Modified:
branches/aicom-network-fixes/lib/drivers/ip/network/ip.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/network/ip.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/network/ip.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/lib/drivers/ip/network/ip.c [iso-8859-1] Tue Jan 13
11:42:01 2009
@@ -346,6 +346,21 @@
}
+VOID DefaultProtocolHandler(
+ PIP_INTERFACE Interface,
+ PIP_PACKET IPPacket)
+/*
+ * FUNCTION: Default handler for Internet protocols
+ * ARGUMENTS:
+ * NTE = Pointer to net table entry which the packet was received on
+ * IPPacket = Pointer to an IP packet that was received
+ */
+{
+ TI_DbgPrint(MID_TRACE, ("[IF %x] Packet of unknown Internet protocol "
+ "discarded.\n", Interface));
+}
+
+
VOID IPRegisterProtocol(
UINT ProtocolNumber,
IP_PROTOCOL_HANDLER Handler)
@@ -363,22 +378,7 @@
return;
}
- ProtocolTable[ProtocolNumber] = Handler;
-}
-
-
-VOID DefaultProtocolHandler(
- PIP_INTERFACE Interface,
- PIP_PACKET IPPacket)
-/*
- * FUNCTION: Default handler for Internet protocols
- * ARGUMENTS:
- * NTE = Pointer to net table entry which the packet was received on
- * IPPacket = Pointer to an IP packet that was received
- */
-{
- TI_DbgPrint(MID_TRACE, ("[IF %x] Packet of unknown Internet protocol "
- "discarded.\n", Interface));
+ ProtocolTable[ProtocolNumber] = Handler ? Handler : DefaultProtocolHandler;
}