patch-1.3.94 linux/net/ipv4/ipip.c

Next file: linux/scripts/Menuconfig
Previous file: linux/net/ipv4/ip_masq_irc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.93/linux/net/ipv4/ipip.c linux/net/ipv4/ipip.c
@@ -74,6 +74,25 @@
 	skb->h.iph=(struct iphdr *)skb->data;
 	skb->ip_hdr=(struct iphdr *)skb->data;
 	memset(skb->proto_priv, 0, sizeof(struct options));
+	if (skb->ip_hdr->ihl > 5) 
+	{
+		if (ip_options_compile(NULL, skb))
+			return 0;
+	}
+	
+#ifdef CONFIG_FIREWALL
+	/*
+	 *	Check the firewall [well spotted Olaf]
+	 */
+	 
+	if((err=call_in_firewall(PF_INET, skb->dev, skb->ip_hdr))<FW_ACCEPT)
+	{
+		if(err==FW_REJECT)
+			icmp_send(skb,ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0 , dev);
+		kfree_skb(skb, FREE_READ);
+		return 0;
+	}	
+#endif
 
 	/*
 	 *	If you want to add LZ compressed IP or things like that here,
@@ -81,12 +100,13 @@
 	 */
 	
 	/* skb=lzw_uncompress(skb); */
-
+	
 	/*
-	 *	Feed it to the IP layer.
+	 *	Feed to IP forward.
 	 */
-	ip_rcv(skb, dev, NULL);
-
+	 
+	if(ip_forward(skb, dev, 0, daddr))
+		kfree_skb(skb, FREE_READ);
 	MOD_DEC_USE_COUNT;
 	return(0);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this