route: Set orig_output when redirecting to lwt on locally generated traffic
authorThomas Graf <tgraf@suug.ch>
Wed, 30 Nov 2016 16:10:08 +0000 (17:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 15:51:49 +0000 (10:51 -0500)
orig_output for IPv4 was only set for dsts which hit an input route.
Set it consistently for locally generated traffic as well to allow
lwt to continue the dst_output() path as configured by the nexthop.

Fixes: 2536862311d ("lwt: Add support to redirect dst.input")
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 6402d745d192dac716ccf354fd3ab0a75fb1926f..f09866327d709bd20cb16803e01bb39099604cda 100644 (file)
@@ -2155,8 +2155,10 @@ add:
        }
 
        rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0);
-       if (lwtunnel_output_redirect(rth->dst.lwtstate))
+       if (lwtunnel_output_redirect(rth->dst.lwtstate)) {
+               rth->dst.lwtstate->orig_output = rth->dst.output;
                rth->dst.output = lwtunnel_output;
+       }
 
        return rth;
 }