ip6_tunnel.c (bba73071b6f71be0a101658d7c13866e30b264a6) ip6_tunnel.c (b75cc8f90f07342467b3bd51dbc0054f185032c9)
1/*
2 * IPv6 tunneling device
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Ville Nuorvala <vnuorval@tcs.hut.fi>
7 * Yasuyuki Kozakai <kozakai@linux-ipv6.org>
8 *

--- 665 unchanged lines hidden (view full) ---

674 return 0;
675
676 skb_dst_drop(skb2);
677 skb_pull(skb2, offset);
678 skb_reset_network_header(skb2);
679
680 /* Try to guess incoming interface */
681 rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr,
1/*
2 * IPv6 tunneling device
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Ville Nuorvala <vnuorval@tcs.hut.fi>
7 * Yasuyuki Kozakai <kozakai@linux-ipv6.org>
8 *

--- 665 unchanged lines hidden (view full) ---

674 return 0;
675
676 skb_dst_drop(skb2);
677 skb_pull(skb2, offset);
678 skb_reset_network_header(skb2);
679
680 /* Try to guess incoming interface */
681 rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr,
682 NULL, 0, 0);
682 NULL, 0, skb2, 0);
683
684 if (rt && rt->dst.dev)
685 skb2->dev = rt->dst.dev;
686
687 icmpv6_send(skb2, rel_type, rel_code, rel_info);
688
689 ip6_rt_put(rt);
690

--- 748 unchanged lines hidden (view full) ---

1439 t_hlen = t->hlen + sizeof(struct ipv6hdr);
1440
1441 if (p->flags & IP6_TNL_F_CAP_XMIT) {
1442 int strict = (ipv6_addr_type(&p->raddr) &
1443 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL));
1444
1445 struct rt6_info *rt = rt6_lookup(t->net,
1446 &p->raddr, &p->laddr,
683
684 if (rt && rt->dst.dev)
685 skb2->dev = rt->dst.dev;
686
687 icmpv6_send(skb2, rel_type, rel_code, rel_info);
688
689 ip6_rt_put(rt);
690

--- 748 unchanged lines hidden (view full) ---

1439 t_hlen = t->hlen + sizeof(struct ipv6hdr);
1440
1441 if (p->flags & IP6_TNL_F_CAP_XMIT) {
1442 int strict = (ipv6_addr_type(&p->raddr) &
1443 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL));
1444
1445 struct rt6_info *rt = rt6_lookup(t->net,
1446 &p->raddr, &p->laddr,
1447 p->link, strict);
1447 p->link, NULL, strict);
1448
1449 if (!rt)
1450 return;
1451
1452 if (rt->dst.dev) {
1453 dev->hard_header_len = rt->dst.dev->hard_header_len +
1454 t_hlen;
1455

--- 789 unchanged lines hidden (view full) ---

2245 rtnl_unlock();
2246}
2247
2248static struct pernet_operations ip6_tnl_net_ops = {
2249 .init = ip6_tnl_init_net,
2250 .exit_batch = ip6_tnl_exit_batch_net,
2251 .id = &ip6_tnl_net_id,
2252 .size = sizeof(struct ip6_tnl_net),
1448
1449 if (!rt)
1450 return;
1451
1452 if (rt->dst.dev) {
1453 dev->hard_header_len = rt->dst.dev->hard_header_len +
1454 t_hlen;
1455

--- 789 unchanged lines hidden (view full) ---

2245 rtnl_unlock();
2246}
2247
2248static struct pernet_operations ip6_tnl_net_ops = {
2249 .init = ip6_tnl_init_net,
2250 .exit_batch = ip6_tnl_exit_batch_net,
2251 .id = &ip6_tnl_net_id,
2252 .size = sizeof(struct ip6_tnl_net),
2253 .async = true,
2253};
2254
2255/**
2256 * ip6_tunnel_init - register protocol and reserve needed resources
2257 *
2258 * Return: 0 on success
2259 **/
2260

--- 56 unchanged lines hidden ---
2254};
2255
2256/**
2257 * ip6_tunnel_init - register protocol and reserve needed resources
2258 *
2259 * Return: 0 on success
2260 **/
2261

--- 56 unchanged lines hidden ---