diff options
Diffstat (limited to 'net/ipv4/ipip.c')
| -rw-r--r-- | net/ipv4/ipip.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 988f52fba54a..bfc17c5914e7 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
| @@ -460,19 +460,14 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 460 | goto tx_error_icmp; | 460 | goto tx_error_icmp; |
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | { | 463 | rt = ip_route_output_ports(dev_net(dev), NULL, |
| 464 | struct flowi fl = { | 464 | dst, tiph->saddr, |
| 465 | .oif = tunnel->parms.link, | 465 | 0, 0, |
| 466 | .fl4_dst = dst, | 466 | IPPROTO_IPIP, RT_TOS(tos), |
| 467 | .fl4_src= tiph->saddr, | 467 | tunnel->parms.link); |
| 468 | .fl4_tos = RT_TOS(tos), | 468 | if (IS_ERR(rt)) { |
| 469 | .proto = IPPROTO_IPIP | 469 | dev->stats.tx_carrier_errors++; |
| 470 | }; | 470 | goto tx_error_icmp; |
| 471 | |||
| 472 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | ||
| 473 | dev->stats.tx_carrier_errors++; | ||
| 474 | goto tx_error_icmp; | ||
| 475 | } | ||
| 476 | } | 471 | } |
| 477 | tdev = rt->dst.dev; | 472 | tdev = rt->dst.dev; |
| 478 | 473 | ||
| @@ -583,16 +578,14 @@ static void ipip_tunnel_bind_dev(struct net_device *dev) | |||
| 583 | iph = &tunnel->parms.iph; | 578 | iph = &tunnel->parms.iph; |
| 584 | 579 | ||
| 585 | if (iph->daddr) { | 580 | if (iph->daddr) { |
| 586 | struct flowi fl = { | 581 | struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, |
| 587 | .oif = tunnel->parms.link, | 582 | iph->daddr, iph->saddr, |
| 588 | .fl4_dst = iph->daddr, | 583 | 0, 0, |
| 589 | .fl4_src = iph->saddr, | 584 | IPPROTO_IPIP, |
| 590 | .fl4_tos = RT_TOS(iph->tos), | 585 | RT_TOS(iph->tos), |
| 591 | .proto = IPPROTO_IPIP | 586 | tunnel->parms.link); |
| 592 | }; | 587 | |
| 593 | struct rtable *rt; | 588 | if (!IS_ERR(rt)) { |
| 594 | |||
| 595 | if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { | ||
| 596 | tdev = rt->dst.dev; | 589 | tdev = rt->dst.dev; |
| 597 | ip_rt_put(rt); | 590 | ip_rt_put(rt); |
| 598 | } | 591 | } |
| @@ -913,4 +906,4 @@ static void __exit ipip_fini(void) | |||
| 913 | module_init(ipip_init); | 906 | module_init(ipip_init); |
| 914 | module_exit(ipip_fini); | 907 | module_exit(ipip_fini); |
| 915 | MODULE_LICENSE("GPL"); | 908 | MODULE_LICENSE("GPL"); |
| 916 | MODULE_ALIAS("tunl0"); | 909 | MODULE_ALIAS_NETDEV("tunl0"); |
