net: Remove redundant oif checks in rt6_device_match
authorDavid Ahern <dsa@cumulusnetworks.com>
Fri, 25 Sep 2015 21:22:54 +0000 (15:22 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 05:30:24 +0000 (22:30 -0700)
The oif has already been checked that it is non-zero; the 2 additional
checks on oif within that if (oif) {...} block are redundant.

CC: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index 6fbf6fdde7e753430f0f65bb906c1fcb00484f1d..66a6b2c485dde819e14c27a85cd053f76ae57293 100644 (file)
@@ -474,10 +474,10 @@ static inline struct rt6_info *rt6_device_match(struct net *net,
                        if (dev->flags & IFF_LOOPBACK) {
                                if (!sprt->rt6i_idev ||
                                    sprt->rt6i_idev->dev->ifindex != oif) {
-                                       if (flags & RT6_LOOKUP_F_IFACE && oif)
+                                       if (flags & RT6_LOOKUP_F_IFACE)
                                                continue;
-                                       if (local && (!oif ||
-                                                     local->rt6i_idev->dev->ifindex == oif))
+                                       if (local &&
+                                           local->rt6i_idev->dev->ifindex == oif)
                                                continue;
                                }
                                local = sprt;