diff options
Diffstat (limited to 'net/ipv6/sit.c')
| -rw-r--r-- | net/ipv6/sit.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index e51e650ea80b..4699cd3c3118 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
| @@ -249,8 +249,6 @@ failed: | |||
| 249 | return NULL; | 249 | return NULL; |
| 250 | } | 250 | } |
| 251 | 251 | ||
| 252 | static DEFINE_SPINLOCK(ipip6_prl_lock); | ||
| 253 | |||
| 254 | #define for_each_prl_rcu(start) \ | 252 | #define for_each_prl_rcu(start) \ |
| 255 | for (prl = rcu_dereference(start); \ | 253 | for (prl = rcu_dereference(start); \ |
| 256 | prl; \ | 254 | prl; \ |
| @@ -340,7 +338,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg) | |||
| 340 | if (a->addr == htonl(INADDR_ANY)) | 338 | if (a->addr == htonl(INADDR_ANY)) |
| 341 | return -EINVAL; | 339 | return -EINVAL; |
| 342 | 340 | ||
| 343 | spin_lock(&ipip6_prl_lock); | 341 | ASSERT_RTNL(); |
| 344 | 342 | ||
| 345 | for (p = t->prl; p; p = p->next) { | 343 | for (p = t->prl; p; p = p->next) { |
| 346 | if (p->addr == a->addr) { | 344 | if (p->addr == a->addr) { |
| @@ -370,7 +368,6 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg) | |||
| 370 | t->prl_count++; | 368 | t->prl_count++; |
| 371 | rcu_assign_pointer(t->prl, p); | 369 | rcu_assign_pointer(t->prl, p); |
| 372 | out: | 370 | out: |
| 373 | spin_unlock(&ipip6_prl_lock); | ||
| 374 | return err; | 371 | return err; |
| 375 | } | 372 | } |
| 376 | 373 | ||
| @@ -397,7 +394,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) | |||
| 397 | struct ip_tunnel_prl_entry *x, **p; | 394 | struct ip_tunnel_prl_entry *x, **p; |
| 398 | int err = 0; | 395 | int err = 0; |
| 399 | 396 | ||
| 400 | spin_lock(&ipip6_prl_lock); | 397 | ASSERT_RTNL(); |
| 401 | 398 | ||
| 402 | if (a && a->addr != htonl(INADDR_ANY)) { | 399 | if (a && a->addr != htonl(INADDR_ANY)) { |
| 403 | for (p = &t->prl; *p; p = &(*p)->next) { | 400 | for (p = &t->prl; *p; p = &(*p)->next) { |
| @@ -419,7 +416,6 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) | |||
| 419 | } | 416 | } |
| 420 | } | 417 | } |
| 421 | out: | 418 | out: |
| 422 | spin_unlock(&ipip6_prl_lock); | ||
| 423 | return err; | 419 | return err; |
| 424 | } | 420 | } |
| 425 | 421 | ||
| @@ -716,7 +712,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
| 716 | stats->tx_carrier_errors++; | 712 | stats->tx_carrier_errors++; |
| 717 | goto tx_error_icmp; | 713 | goto tx_error_icmp; |
| 718 | } | 714 | } |
| 719 | tdev = rt->u.dst.dev; | 715 | tdev = rt->dst.dev; |
| 720 | 716 | ||
| 721 | if (tdev == dev) { | 717 | if (tdev == dev) { |
| 722 | ip_rt_put(rt); | 718 | ip_rt_put(rt); |
| @@ -725,7 +721,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
| 725 | } | 721 | } |
| 726 | 722 | ||
| 727 | if (df) { | 723 | if (df) { |
| 728 | mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr); | 724 | mtu = dst_mtu(&rt->dst) - sizeof(struct iphdr); |
| 729 | 725 | ||
| 730 | if (mtu < 68) { | 726 | if (mtu < 68) { |
| 731 | stats->collisions++; | 727 | stats->collisions++; |
| @@ -784,7 +780,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
| 784 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | 780 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); |
| 785 | IPCB(skb)->flags = 0; | 781 | IPCB(skb)->flags = 0; |
| 786 | skb_dst_drop(skb); | 782 | skb_dst_drop(skb); |
| 787 | skb_dst_set(skb, &rt->u.dst); | 783 | skb_dst_set(skb, &rt->dst); |
| 788 | 784 | ||
| 789 | /* | 785 | /* |
| 790 | * Push down and install the IPIP header. | 786 | * Push down and install the IPIP header. |
| @@ -833,7 +829,7 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev) | |||
| 833 | .proto = IPPROTO_IPV6 }; | 829 | .proto = IPPROTO_IPV6 }; |
| 834 | struct rtable *rt; | 830 | struct rtable *rt; |
| 835 | if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { | 831 | if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { |
| 836 | tdev = rt->u.dst.dev; | 832 | tdev = rt->dst.dev; |
| 837 | ip_rt_put(rt); | 833 | ip_rt_put(rt); |
| 838 | } | 834 | } |
| 839 | dev->flags |= IFF_POINTOPOINT; | 835 | dev->flags |= IFF_POINTOPOINT; |
