• Home
  • Raw
  • Download

Lines Matching full:tunnel

73 /* Fallback tunnel: no source, no destination, no key, no options
75 Tunnel hash table:
77 it will match only tunnel with the same key; if it is not present,
78 it will match only keyless tunnel.
81 will match fallback tunnel.
82 Given src, dst and key, find appropriate for input tunnel.
237 struct ip_tunnel *tunnel; in __ip_tunnel_create() local
263 tunnel = netdev_priv(dev); in __ip_tunnel_create()
264 tunnel->parms = *parms; in __ip_tunnel_create()
265 tunnel->net = net; in __ip_tunnel_create()
282 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_bind_dev() local
286 int t_hlen = tunnel->hlen + sizeof(struct iphdr); in ip_tunnel_bind_dev()
288 iph = &tunnel->parms.iph; in ip_tunnel_bind_dev()
296 iph->saddr, tunnel->parms.o_key, in ip_tunnel_bind_dev()
297 iph->tos & INET_DSCP_MASK, tunnel->net, in ip_tunnel_bind_dev()
298 tunnel->parms.link, tunnel->fwmark, 0, 0); in ip_tunnel_bind_dev()
299 rt = ip_route_output_key(tunnel->net, &fl4); in ip_tunnel_bind_dev()
308 dst_cache_reset(&tunnel->dst_cache); in ip_tunnel_bind_dev()
311 if (!tdev && tunnel->parms.link) in ip_tunnel_bind_dev()
312 tdev = __dev_get_by_index(tunnel->net, tunnel->parms.link); in ip_tunnel_bind_dev()
376 int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, in ip_tunnel_rcv() argument
385 DEV_STATS_INC(tunnel->dev, multicast); in ip_tunnel_rcv()
390 if ((!(tpi->flags&TUNNEL_CSUM) && (tunnel->parms.i_flags&TUNNEL_CSUM)) || in ip_tunnel_rcv()
391 ((tpi->flags&TUNNEL_CSUM) && !(tunnel->parms.i_flags&TUNNEL_CSUM))) { in ip_tunnel_rcv()
392 DEV_STATS_INC(tunnel->dev, rx_crc_errors); in ip_tunnel_rcv()
393 DEV_STATS_INC(tunnel->dev, rx_errors); in ip_tunnel_rcv()
397 if (tunnel->parms.i_flags&TUNNEL_SEQ) { in ip_tunnel_rcv()
399 (tunnel->i_seqno && (s32)(ntohl(tpi->seq) - tunnel->i_seqno) < 0)) { in ip_tunnel_rcv()
400 DEV_STATS_INC(tunnel->dev, rx_fifo_errors); in ip_tunnel_rcv()
401 DEV_STATS_INC(tunnel->dev, rx_errors); in ip_tunnel_rcv()
404 tunnel->i_seqno = ntohl(tpi->seq) + 1; in ip_tunnel_rcv()
413 skb_set_network_header(skb, (tunnel->dev->type == ARPHRD_ETHER) ? ETH_HLEN : 0); in ip_tunnel_rcv()
416 DEV_STATS_INC(tunnel->dev, rx_length_errors); in ip_tunnel_rcv()
417 DEV_STATS_INC(tunnel->dev, rx_errors); in ip_tunnel_rcv()
428 DEV_STATS_INC(tunnel->dev, rx_frame_errors); in ip_tunnel_rcv()
429 DEV_STATS_INC(tunnel->dev, rx_errors); in ip_tunnel_rcv()
434 dev_sw_netstats_rx_add(tunnel->dev, skb->len); in ip_tunnel_rcv()
435 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(tunnel->dev))); in ip_tunnel_rcv()
437 if (tunnel->dev->type == ARPHRD_ETHER) { in ip_tunnel_rcv()
438 skb->protocol = eth_type_trans(skb, tunnel->dev); in ip_tunnel_rcv()
441 skb->dev = tunnel->dev; in ip_tunnel_rcv()
447 gro_cells_receive(&tunnel->gro_cells, skb); in ip_tunnel_rcv()
516 struct ip_tunnel *tunnel = netdev_priv(dev); in tnl_update_pmtu() local
520 tunnel_hlen = md ? tunnel_hlen : tunnel->hlen; in tnl_update_pmtu()
549 daddr = md ? dst : tunnel->parms.iph.daddr; in tnl_update_pmtu()
587 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_md_tunnel_xmit() local
614 tos & INET_DSCP_MASK, tunnel->net, 0, skb->mark, in ip_md_tunnel_xmit()
627 rt = ip_route_output_key(tunnel->net, &fl4); in ip_md_tunnel_xmit()
670 df, !net_eq(tunnel->net, dev_net(dev))); in ip_md_tunnel_xmit()
685 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_xmit() local
700 connected = (tunnel->parms.iph.daddr != 0); in ip_tunnel_xmit()
707 /* NBMA tunnel */ in ip_tunnel_xmit()
776 tunnel->parms.o_key, tos & INET_DSCP_MASK, in ip_tunnel_xmit()
777 tunnel->net, READ_ONCE(tunnel->parms.link), in ip_tunnel_xmit()
778 tunnel->fwmark, skb_get_hash(skb), 0); in ip_tunnel_xmit()
780 if (ip_tunnel_encap(skb, &tunnel->encap, &protocol, &fl4) < 0) in ip_tunnel_xmit()
789 rt = connected ? dst_cache_get_ip4(&tunnel->dst_cache, in ip_tunnel_xmit()
794 rt = ip_route_output_key(tunnel->net, &fl4); in ip_tunnel_xmit()
804 dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, in ip_tunnel_xmit()
815 if (payload_protocol == htons(ETH_P_IP) && !tunnel->ignore_df) in ip_tunnel_xmit()
823 if (tunnel->err_count > 0) { in ip_tunnel_xmit()
825 tunnel->err_time + IPTUNNEL_ERR_TIMEO)) { in ip_tunnel_xmit()
826 tunnel->err_count--; in ip_tunnel_xmit()
830 tunnel->err_count = 0; in ip_tunnel_xmit()
847 + rt->dst.header_len + ip_encap_hlen(&tunnel->encap); in ip_tunnel_xmit()
859 df, !net_eq(tunnel->net, dev_net(dev))); in ip_tunnel_xmit()
1026 struct ip_tunnel *tunnel = netdev_priv(dev); in __ip_tunnel_change_mtu() local
1027 int t_hlen = tunnel->hlen + sizeof(struct iphdr); in __ip_tunnel_change_mtu()
1056 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_dev_free() local
1058 gro_cells_destroy(&tunnel->gro_cells); in ip_tunnel_dev_free()
1059 dst_cache_destroy(&tunnel->dst_cache); in ip_tunnel_dev_free()
1065 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_dellink() local
1068 itn = net_generic(tunnel->net, tunnel->ip_tnl_net_id); in ip_tunnel_dellink()
1079 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_get_link_net() local
1081 return tunnel->net; in ip_tunnel_get_link_net()
1087 const struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_get_iflink() local
1089 return READ_ONCE(tunnel->parms.link); in ip_tunnel_get_iflink()
1234 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_changelink() local
1235 struct net *net = tunnel->net; in ip_tunnel_changelink()
1236 struct ip_tunnel_net *itn = net_generic(net, tunnel->ip_tnl_net_id); in ip_tunnel_changelink()
1247 t = tunnel; in ip_tunnel_changelink()
1270 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_init() local
1271 struct iphdr *iph = &tunnel->parms.iph; in ip_tunnel_init()
1280 err = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL); in ip_tunnel_init()
1286 err = gro_cells_init(&tunnel->gro_cells, dev); in ip_tunnel_init()
1288 dst_cache_destroy(&tunnel->dst_cache); in ip_tunnel_init()
1293 tunnel->dev = dev; in ip_tunnel_init()
1294 tunnel->net = dev_net(dev); in ip_tunnel_init()
1295 strcpy(tunnel->parms.name, dev->name); in ip_tunnel_init()
1299 if (tunnel->collect_md) in ip_tunnel_init()
1308 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_uninit() local
1309 struct net *net = tunnel->net; in ip_tunnel_uninit()
1312 itn = net_generic(net, tunnel->ip_tnl_net_id); in ip_tunnel_uninit()
1317 dst_cache_reset(&tunnel->dst_cache); in ip_tunnel_uninit()
1324 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_setup() local
1325 tunnel->ip_tnl_net_id = net_id; in ip_tunnel_setup()