diff options
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 988f52fba54a..e1e17576baa6 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -469,7 +469,8 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
469 | .proto = IPPROTO_IPIP | 469 | .proto = IPPROTO_IPIP |
470 | }; | 470 | }; |
471 | 471 | ||
472 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 472 | rt = ip_route_output_key(dev_net(dev), &fl); |
473 | if (IS_ERR(rt)) { | ||
473 | dev->stats.tx_carrier_errors++; | 474 | dev->stats.tx_carrier_errors++; |
474 | goto tx_error_icmp; | 475 | goto tx_error_icmp; |
475 | } | 476 | } |
@@ -590,9 +591,9 @@ static void ipip_tunnel_bind_dev(struct net_device *dev) | |||
590 | .fl4_tos = RT_TOS(iph->tos), | 591 | .fl4_tos = RT_TOS(iph->tos), |
591 | .proto = IPPROTO_IPIP | 592 | .proto = IPPROTO_IPIP |
592 | }; | 593 | }; |
593 | struct rtable *rt; | 594 | struct rtable *rt = ip_route_output_key(dev_net(dev), &fl); |
594 | 595 | ||
595 | if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { | 596 | if (!IS_ERR(rt)) { |
596 | tdev = rt->dst.dev; | 597 | tdev = rt->dst.dev; |
597 | ip_rt_put(rt); | 598 | ip_rt_put(rt); |
598 | } | 599 | } |