Skip to contentSkip to conversation

ipv4: Set rt->rt_iif more sanely on output routes.

PATCH In review David Miller 2 participants 2 messages Mar 5, 2011

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 ipv4: Set rt->rt_iif more sanely on output routes.

rt->rt_iif is only ever inspected on input routes, for example DCCP uses this to populate a route lookup flow key when generating replies to another packet.

Therefore, setting it to anything other than zero on output routes makes no sense.

---
 net/ipv4/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/route.c +1 -1
index 9794a2c..602473c 100644
@@ -2381,7 +2381,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
 	rth->fl.mark    = oldflp->mark;
 	rth->rt_dst	= fl->fl4_dst;
 	rth->rt_src	= fl->fl4_src;
-	rth->rt_iif	= oldflp->oif ? : dev_out->ifindex;
+	rth->rt_iif	= 0;
 	/* get references to the devices that are to be hold by the routing
 	   cache entry */
 	rth->dst.dev	= dev_out;
Signature · 1 line
1.7.4.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · David Miller

rt->rt_iif is only ever inspected on input routes, for example DCCP uses this to populate a route lookup flow key when generating replies to another packet.

Therefore, setting it to anything other than zero on output routes makes no sense.

---
 net/ipv4/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/route.c +0 -0
index 9794a2c..602473c 100644

net/ipv4/route.c static struct rtable *__mkroute_output(const struct fib_result *res, · line 2387

Quoted 8 lines
net/ipv4/route.c +1 -1
@@ -2381,7 +2381,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
 	rth->fl.mark    = oldflp->mark;
 	rth->rt_dst	= fl->fl4_dst;
 	rth->rt_src	= fl->fl4_src;
-	rth->rt_iif	= oldflp->oif ? : dev_out->ifindex;
+	rth->rt_iif	= 0;
 	/* get references to the devices that are to be hold by the routing
 	   cache entry */
 	rth->dst.dev	= dev_out;