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

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

diff -u --recursive --new-file v1.3.50/linux/net/ipv4/ip_input.c linux/net/ipv4/ip_input.c
@@ -273,6 +273,17 @@
 	}
 	
 	/*
+	 *	Try to select closest <src,dst> alias device, if any.
+	 *	net_alias_dev_rcv_sel32 returns main device if it 
+	 *	fails to found other.
+	 */
+
+#ifdef CONFIG_NET_ALIAS
+	if (iph->daddr != skb->dev->pa_addr && net_alias_has(skb->dev)) 
+		skb->dev = dev = net_alias_dev_rcv_sel32(skb->dev, AF_INET, iph->saddr, iph->daddr);
+#endif
+
+	/*
 	 *	See if the firewall wants to dispose of the packet. 
 	 */
 
@@ -316,18 +327,7 @@
 	 *	function entry.
 	 */
 
-	/*
-	 *	also check device aliases address : will avoid
-	 *	a full lookup over device chain
-	 */
-
-#ifdef CONFIG_NET_ALIAS
-	if ( iph->daddr == skb->dev->pa_addr ||
-	    ( net_alias_has(skb->dev) && net_alias_addr_chk32(skb->dev,AF_INET, iph->daddr )) ||
-	    (brd = ip_chk_addr(iph->daddr)) != 0)
-#else
 	if ( iph->daddr == skb->dev->pa_addr || (brd = ip_chk_addr(iph->daddr)) != 0)
-#endif
 	{
 	        if (opt && opt->srr) 
 	        {

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