--- ./net/ipv4/netfilter/ipt_REDIRECT.c.iptredir	2006-03-28 16:14:50.000000000 +0400
+++ ./net/ipv4/netfilter/ipt_REDIRECT.c	2006-05-17 11:54:55.000000000 +0400
@@ -89,14 +89,18 @@ redirect_target(struct sk_buff **pskb,
 		newdst = htonl(0x7F000001);
 	else {
 		struct in_device *indev;
+		struct in_ifaddr *ifa;
 
 		/* Device might not have an associated in_device. */
 		indev = (struct in_device *)(*pskb)->dev->ip_ptr;
 		if (indev == NULL || indev->ifa_list == NULL)
 			return NF_DROP;
 
+		ifa = indev->ifa_list;
+		if (IN_LOOPBACK(ntohl(ifa->ifa_local)) && ifa->ifa_next)
+			ifa = ifa->ifa_next;
 		/* Grab first address on interface. */
-		newdst = indev->ifa_list->ifa_local;
+		newdst = ifa->ifa_local;
 	}
 
 	/* Transfer from original range. */
