patch-2.1.68 linux/net/ipv4/protocol.c

Next file: linux/net/ipv4/rarp.c
Previous file: linux/net/ipv4/proc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.67/linux/net/ipv4/protocol.c linux/net/ipv4/protocol.c
@@ -5,7 +5,7 @@
  *
  *		INET protocol dispatch tables.
  *
- * Version:	@(#)protocol.c	1.0.5	05/25/93
+ * Version:	$Id: protocol.c,v 1.9 1997/10/29 20:27:34 kuznet Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -45,20 +45,23 @@
 #include <net/ipip.h>
 #include <linux/igmp.h>
 
+#define IPPROTO_PREVIOUS NULL
 
-#ifdef CONFIG_NET_IPIP
+#ifdef CONFIG_IP_MULTICAST
 
-static struct inet_protocol ipip_protocol = 
+static struct inet_protocol igmp_protocol = 
 {
-	ipip_rcv,             /* IPIP handler          */
-	ipip_err,             /* TUNNEL error control    */
-	0,                    /* next                 */
-	IPPROTO_IPIP,         /* protocol ID          */
-	0,                    /* copy                 */
-	NULL,                 /* data                 */
-	"IPIP"                /* name                 */
+	igmp_rcv,		/* IGMP handler		*/
+	NULL,			/* IGMP error control	*/
+	IPPROTO_PREVIOUS,	/* next			*/
+	IPPROTO_IGMP,		/* protocol ID		*/
+	0,			/* copy			*/
+	NULL,			/* data			*/
+	"IGMP"			/* name			*/
 };
 
+#undef  IPPROTO_PREVIOUS
+#define IPPROTO_PREVIOUS &igmp_protocol
 
 #endif
 
@@ -66,52 +69,47 @@
 {
 	tcp_v4_rcv,		/* TCP handler		*/
 	tcp_v4_err,		/* TCP error control	*/  
-#ifdef CONFIG_NET_IPIP
-	&ipip_protocol,
-#else  
-	NULL,			/* next			*/
-#endif  
+	IPPROTO_PREVIOUS,
 	IPPROTO_TCP,		/* protocol ID		*/
 	0,			/* copy			*/
 	NULL,			/* data			*/
 	"TCP"			/* name			*/
 };
 
+#undef  IPPROTO_PREVIOUS
+#define IPPROTO_PREVIOUS &tcp_protocol
+
 static struct inet_protocol udp_protocol = 
 {
 	udp_rcv,		/* UDP handler		*/
 	udp_err,		/* UDP error control	*/
-	&tcp_protocol,		/* next			*/
+	IPPROTO_PREVIOUS,	/* next			*/
 	IPPROTO_UDP,		/* protocol ID		*/
 	0,			/* copy			*/
 	NULL,			/* data			*/
 	"UDP"			/* name			*/
 };
 
+#undef  IPPROTO_PREVIOUS
+#define IPPROTO_PREVIOUS &udp_protocol
+
 
 static struct inet_protocol icmp_protocol = 
 {
 	icmp_rcv,		/* ICMP handler		*/
 	NULL,			/* ICMP error control	*/
-	&udp_protocol,		/* next			*/
+	IPPROTO_PREVIOUS,	/* next			*/
 	IPPROTO_ICMP,		/* protocol ID		*/
 	0,			/* copy			*/
 	NULL,			/* data			*/
 	"ICMP"			/* name			*/
 };
 
-static struct inet_protocol igmp_protocol = 
-{
-	igmp_rcv,		/* IGMP handler		*/
-	NULL,			/* IGMP error control	*/
-	&icmp_protocol,		/* next			*/
-	IPPROTO_IGMP,		/* protocol ID		*/
-	0,			/* copy			*/
-	NULL,			/* data			*/
-	"IGMP"			/* name			*/
-};
+#undef  IPPROTO_PREVIOUS
+#define IPPROTO_PREVIOUS &icmp_protocol
+
 
-struct inet_protocol *inet_protocol_base = &igmp_protocol;
+struct inet_protocol *inet_protocol_base = IPPROTO_PREVIOUS;
 
 struct inet_protocol *inet_protos[MAX_INET_PROTOS] = 
 {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov