scsi: sr: Sanity check returned mode data
[pandora-kernel.git] / net / ipv4 / route.c
index 8e79a9e..d3e45fc 100644 (file)
@@ -2604,6 +2604,18 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
                 */
                if (fi && res->prefixlen < 4)
                        fi = NULL;
+       } else if ((type == RTN_LOCAL) && (orig_oif != 0) &&
+                  (orig_oif != dev_out->ifindex)) {
+               /* For local routes that require a particular output interface
+                * we do not want to cache the result.  Caching the result
+                * causes incorrect behaviour when there are multiple source
+                * addresses on the interface, the end result being that if the
+                * intended recipient is waiting on that interface for the
+                * packet he won't receive it because it will be delivered on
+                * the loopback interface and the IP_PKTINFO ipi_ifindex will
+                * be set to the loopback interface as well.
+                */
+               fi = NULL;
        }
 
        rth = rt_dst_alloc(dev_out,
@@ -3077,7 +3089,8 @@ static int rt_fill_info(struct net *net,
                    IPV4_DEVCONF_ALL(net, MC_FORWARDING)) {
                        int err = ipmr_get_route(net, skb,
                                                 rt->rt_src, rt->rt_dst,
-                                                r, nowait);
+                                                r, nowait, pid);
+
                        if (err <= 0) {
                                if (!nowait) {
                                        if (err == 0)