]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/route.c
Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / net / ipv4 / route.c
index f62187bb6d087caa3b0680e2122cd39988a77fb6..942be04e795571084c71abbde6060600ad3b348d 100644 (file)
@@ -2361,11 +2361,6 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
                    ipv4_is_zeronet(oldflp->fl4_src))
                        goto out;
 
-               /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
-               dev_out = ip_dev_find(net, oldflp->fl4_src);
-               if (dev_out == NULL)
-                       goto out;
-
                /* I removed check for oif == dev_out->oif here.
                   It was wrong for two reasons:
                   1. ip_dev_find(net, saddr) can return wrong iface, if saddr
@@ -2377,6 +2372,11 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
                if (oldflp->oif == 0
                    && (ipv4_is_multicast(oldflp->fl4_dst) ||
                        oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
+                       /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
+                       dev_out = ip_dev_find(net, oldflp->fl4_src);
+                       if (dev_out == NULL)
+                               goto out;
+
                        /* Special hack: user can direct multicasts
                           and limited broadcast via necessary interface
                           without fiddling with IP_MULTICAST_IF or IP_PKTINFO.
@@ -2395,9 +2395,15 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
                        fl.oif = dev_out->ifindex;
                        goto make_route;
                }
-               if (dev_out)
+
+               if (!(oldflp->flags & FLOWI_FLAG_ANYSRC)) {
+                       /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
+                       dev_out = ip_dev_find(net, oldflp->fl4_src);
+                       if (dev_out == NULL)
+                               goto out;
                        dev_put(dev_out);
-               dev_out = NULL;
+                       dev_out = NULL;
+               }
        }
 
 
@@ -2902,8 +2908,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
 }
 
 static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
-                                               int __user *name,
-                                               int nlen,
                                                void __user *oldval,
                                                size_t __user *oldlenp,
                                                void __user *newval,
@@ -2966,16 +2970,13 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
 }
 
 static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
-                                                  int __user *name,
-                                                  int nlen,
                                                   void __user *oldval,
                                                   size_t __user *oldlenp,
                                                   void __user *newval,
                                                   size_t newlen)
 {
        int old = ip_rt_secret_interval;
-       int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval,
-                                newlen);
+       int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
 
        rt_secret_reschedule(old);