• Home
  • Raw
  • Download

Lines Matching full:tunnel

82 /* Tunnel hash table */
93 it will match only tunnel with the same key; if it is not present,
94 it will match only keyless tunnel.
97 will match fallback tunnel.
113 /* Given src, dst and key, find appropriate for input tunnel. */
450 net_dbg_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n", in ip6gre_err()
466 net_dbg_ratelimited("%s: Too small encapsulation limit or routing loop in tunnel!\n", in ip6gre_err()
496 struct ip6_tnl *tunnel; in ip6gre_rcv() local
499 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6gre_rcv()
502 if (tunnel) { in ip6gre_rcv()
503 if (tunnel->parms.collect_md) { in ip6gre_rcv()
515 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6gre_rcv()
517 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6gre_rcv()
533 struct ip6_tnl *tunnel; in ip6erspan_rcv() local
540 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6erspan_rcv()
543 if (tunnel) { in ip6erspan_rcv()
554 if (tunnel->parms.collect_md) { in ip6erspan_rcv()
588 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6erspan_rcv()
591 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6erspan_rcv()
725 struct ip6_tnl *tunnel = netdev_priv(dev); in __gre6_xmit() local
734 fl6->daddr = tunnel->parms.raddr; in __gre6_xmit()
736 if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen)) in __gre6_xmit()
742 if (tunnel->parms.collect_md) { in __gre6_xmit()
763 tunnel->tun_hlen = gre_calc_hlen(flags); in __gre6_xmit()
765 gre_build_header(skb, tunnel->tun_hlen, in __gre6_xmit()
768 (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) in __gre6_xmit()
772 if (tunnel->parms.o_flags & TUNNEL_SEQ) in __gre6_xmit()
773 tunnel->o_seqno++; in __gre6_xmit()
775 gre_build_header(skb, tunnel->tun_hlen, tunnel->parms.o_flags, in __gre6_xmit()
776 protocol, tunnel->parms.o_key, in __gre6_xmit()
777 htonl(tunnel->o_seqno)); in __gre6_xmit()
848 * ip6gre_tnl_addr_conflict - compare packet addresses to tunnel's own
849 * @t: the outgoing tunnel device
853 * Avoid trivial tunneling loop by checking that tunnel exit-point
975 /* For collect_md mode, derive fl6 from the tunnel key, in ip6erspan_tunnel_xmit()
1161 static int ip6gre_calc_hlen(struct ip6_tnl *tunnel) in ip6gre_calc_hlen() argument
1165 tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags); in ip6gre_calc_hlen()
1166 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; in ip6gre_calc_hlen()
1168 t_hlen = tunnel->hlen + sizeof(struct ipv6hdr); in ip6gre_calc_hlen()
1170 if (tunnel->dev->header_ops) in ip6gre_calc_hlen()
1171 tunnel->dev->hard_header_len = LL_MAX_HEADER + t_hlen; in ip6gre_calc_hlen()
1173 tunnel->dev->needed_headroom = LL_MAX_HEADER + t_hlen; in ip6gre_calc_hlen()
1467 struct ip6_tnl *tunnel; in ip6gre_tunnel_init_common() local
1471 tunnel = netdev_priv(dev); in ip6gre_tunnel_init_common()
1473 tunnel->dev = dev; in ip6gre_tunnel_init_common()
1474 tunnel->net = dev_net(dev); in ip6gre_tunnel_init_common()
1475 strcpy(tunnel->parms.name, dev->name); in ip6gre_tunnel_init_common()
1481 ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL); in ip6gre_tunnel_init_common()
1485 ret = gro_cells_init(&tunnel->gro_cells, dev); in ip6gre_tunnel_init_common()
1489 t_hlen = ip6gre_calc_hlen(tunnel); in ip6gre_tunnel_init_common()
1493 if (!(tunnel->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) in ip6gre_tunnel_init_common()
1496 if (tunnel->parms.collect_md) { in ip6gre_tunnel_init_common()
1505 dst_cache_destroy(&tunnel->dst_cache); in ip6gre_tunnel_init_common()
1514 struct ip6_tnl *tunnel; in ip6gre_tunnel_init() local
1521 tunnel = netdev_priv(dev); in ip6gre_tunnel_init()
1523 if (tunnel->parms.collect_md) in ip6gre_tunnel_init()
1526 memcpy(dev->dev_addr, &tunnel->parms.laddr, sizeof(struct in6_addr)); in ip6gre_tunnel_init()
1527 memcpy(dev->broadcast, &tunnel->parms.raddr, sizeof(struct in6_addr)); in ip6gre_tunnel_init()
1529 if (ipv6_addr_any(&tunnel->parms.raddr)) in ip6gre_tunnel_init()
1537 struct ip6_tnl *tunnel = netdev_priv(dev); in ip6gre_fb_tunnel_init() local
1539 tunnel->dev = dev; in ip6gre_fb_tunnel_init()
1540 tunnel->net = dev_net(dev); in ip6gre_fb_tunnel_init()
1541 strcpy(tunnel->parms.name, dev->name); in ip6gre_fb_tunnel_init()
1543 tunnel->hlen = sizeof(struct ipv6hdr) + 4; in ip6gre_fb_tunnel_init()
1846 static int ip6erspan_calc_hlen(struct ip6_tnl *tunnel) in ip6erspan_calc_hlen() argument
1850 tunnel->tun_hlen = 8; in ip6erspan_calc_hlen()
1851 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen + in ip6erspan_calc_hlen()
1852 erspan_hdr_len(tunnel->parms.erspan_ver); in ip6erspan_calc_hlen()
1854 t_hlen = tunnel->hlen + sizeof(struct ipv6hdr); in ip6erspan_calc_hlen()
1855 tunnel->dev->needed_headroom = LL_MAX_HEADER + t_hlen; in ip6erspan_calc_hlen()
1861 struct ip6_tnl *tunnel; in ip6erspan_tap_init() local
1865 tunnel = netdev_priv(dev); in ip6erspan_tap_init()
1867 tunnel->dev = dev; in ip6erspan_tap_init()
1868 tunnel->net = dev_net(dev); in ip6erspan_tap_init()
1869 strcpy(tunnel->parms.name, dev->name); in ip6erspan_tap_init()
1875 ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL); in ip6erspan_tap_init()
1879 ret = gro_cells_init(&tunnel->gro_cells, dev); in ip6erspan_tap_init()
1883 t_hlen = ip6erspan_calc_hlen(tunnel); in ip6erspan_tap_init()
1887 if (!(tunnel->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) in ip6erspan_tap_init()
1891 ip6erspan_tnl_link_config(tunnel, 1); in ip6erspan_tap_init()
1897 dst_cache_destroy(&tunnel->dst_cache); in ip6erspan_tap_init()