patch-2.1.89 linux/net/ipv4/ip_input.c

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

diff -u --recursive --new-file v2.1.88/linux/net/ipv4/ip_input.c linux/net/ipv4/ip_input.c
@@ -97,6 +97,7 @@
  *		Alan Cox	:	Multicast routing hooks
  *		Jos Vos		:	Do accounting *before* call_in_firewall
  *	Willy Konynenberg	:	Transparent proxying support
+ *	Mike McLagan		:	Routing by source
  *
  *  
  *
@@ -464,18 +465,18 @@
 
 		opt = &(IPCB(skb)->opt);
 		if (opt->srr) {
-			if (!ipv4_config.source_route) {
-				if (ipv4_config.log_martians && net_ratelimit())
+			struct in_device *in_dev = dev->ip_ptr;
+			if (in_dev && !IN_DEV_SOURCE_ROUTE(in_dev)) {
+				if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit())
 					printk(KERN_INFO "source route option %08lx -> %08lx\n",
 					       ntohl(iph->saddr), ntohl(iph->daddr));
 				goto drop;
 			}
-			if (((struct rtable*)skb->dst)->rt_type == RTN_LOCAL &&
-			    ip_options_rcv_srr(skb))
+			if (ip_options_rcv_srr(skb))
 				goto drop;
 		}
 	}
-	
+
 	/*
 	 *	See if the firewall wants to dispose of the packet. 
 	 */

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