ipv4: Kill rt->rt_oif
authorDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 21:39:44 +0000 (14:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jul 2012 20:38:34 +0000 (13:38 -0700)
Never actually used.

It was being set on output routes to the original OIF specified in the
flow key used for the lookup.

Adjust the only user, ipmr_rt_fib_lookup(), for greater correctness of
the flowi4_oif and flowi4_iif values, thanks to feedback from Julian
Anastasov.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/route.h
net/ipv4/ipmr.c
net/ipv4/route.c
net/ipv4/xfrm4_policy.c

index 3c1eeab9749b6e29c8064d3873c1293c5b744c2d..e789a92fd6029e34d875054988cbcbe9e8191e78 100644 (file)
@@ -50,7 +50,6 @@ struct rtable {
 
        int                     rt_route_iif;
        int                     rt_iif;
-       int                     rt_oif;
 
        /* Info on neighbour */
        __be32                  rt_gateway;
index eee3bf6676fe19e22341e41eb76304f908971dca..8eec8f4a05360d24897719495100ea100f0c69b2 100644 (file)
@@ -1795,8 +1795,11 @@ static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
                .daddr = iph->daddr,
                .saddr = iph->saddr,
                .flowi4_tos = RT_TOS(iph->tos),
-               .flowi4_oif = rt->rt_oif,
-               .flowi4_iif = rt->rt_iif,
+               .flowi4_oif = (rt_is_output_route(rt) ?
+                              skb->dev->ifindex : 0),
+               .flowi4_iif = (rt_is_output_route(rt) ?
+                              net->loopback_dev->ifindex :
+                              skb->dev->ifindex),
                .flowi4_mark = skb->mark,
        };
        struct mr_table *mrt;
index b8707779b85d0a4c610e98b35189fda8e56a37c0..a280b6ac8eb23168a8b55e0f55acfb03fb4ef8b6 100644 (file)
@@ -1332,7 +1332,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
        rth->rt_type    = RTN_MULTICAST;
        rth->rt_route_iif = dev->ifindex;
        rth->rt_iif     = dev->ifindex;
-       rth->rt_oif     = 0;
        rth->rt_pmtu    = 0;
        rth->rt_gateway = 0;
        rth->fi = NULL;
@@ -1463,7 +1462,6 @@ static int __mkroute_input(struct sk_buff *skb,
        rth->rt_type = res->type;
        rth->rt_route_iif = in_dev->dev->ifindex;
        rth->rt_iif     = in_dev->dev->ifindex;
-       rth->rt_oif     = 0;
        rth->rt_pmtu    = 0;
        rth->rt_gateway = 0;
        rth->fi = NULL;
@@ -1642,7 +1640,6 @@ local_input:
        rth->rt_type    = res.type;
        rth->rt_route_iif = dev->ifindex;
        rth->rt_iif     = dev->ifindex;
-       rth->rt_oif     = 0;
        rth->rt_pmtu    = 0;
        rth->rt_gateway = 0;
        rth->fi = NULL;
@@ -1808,7 +1805,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
        rth->rt_type    = type;
        rth->rt_route_iif = 0;
        rth->rt_iif     = orig_oif ? : dev_out->ifindex;
-       rth->rt_oif     = orig_oif;
        rth->rt_pmtu    = 0;
        rth->rt_gateway = 0;
        rth->fi = NULL;
@@ -2085,7 +2081,6 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
 
                rt->rt_route_iif = ort->rt_route_iif;
                rt->rt_iif = ort->rt_iif;
-               rt->rt_oif = ort->rt_oif;
                rt->rt_pmtu = ort->rt_pmtu;
 
                rt->rt_genid = rt_genid(net);
index 6074b694f118d117bd715c8468f5056203131bb1..3c99b4cdd290320f644fa683899b42a6675b8bab 100644 (file)
@@ -81,7 +81,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
 
        xdst->u.rt.rt_route_iif = fl4->flowi4_iif;
        xdst->u.rt.rt_iif = fl4->flowi4_iif;
-       xdst->u.rt.rt_oif = fl4->flowi4_oif;
 
        xdst->u.dst.dev = dev;
        dev_hold(dev);