Lines Matching defs:t

76 	for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
94 struct ip6_tnl *t;
99 if (ipv6_addr_equal(local, &t->parms.laddr) &&
100 ipv6_addr_equal(remote, &t->parms.raddr) &&
101 (t->dev->flags & IFF_UP))
102 return t;
108 if (ipv6_addr_equal(local, &t->parms.laddr) &&
109 (t->dev->flags & IFF_UP))
110 return t;
115 if (ipv6_addr_equal(remote, &t->parms.raddr) &&
116 (t->dev->flags & IFF_UP))
117 return t;
120 t = rcu_dereference(ip6n->tnls_wc[0]);
121 if (t && (t->dev->flags & IFF_UP))
122 return t;
154 vti6_tnl_link(struct vti6_net *ip6n, struct ip6_tnl *t)
156 struct ip6_tnl __rcu **tp = vti6_tnl_bucket(ip6n, &t->parms);
158 rcu_assign_pointer(t->next, rtnl_dereference(*tp));
159 rcu_assign_pointer(*tp, t);
163 vti6_tnl_unlink(struct vti6_net *ip6n, struct ip6_tnl *t)
168 for (tp = vti6_tnl_bucket(ip6n, &t->parms);
171 if (t == iter) {
172 rcu_assign_pointer(*tp, t->next);
180 struct ip6_tnl *t = netdev_priv(dev);
181 struct vti6_net *ip6n = net_generic(t->net, vti6_net_id);
189 strcpy(t->parms.name, dev->name);
191 vti6_tnl_link(ip6n, t);
202 struct ip6_tnl *t;
214 dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, vti6_dev_setup);
220 t = netdev_priv(dev);
221 t->parms = *p;
222 t->net = dev_net(dev);
228 return t;
256 struct ip6_tnl *t;
260 (t = rtnl_dereference(*tp)) != NULL;
261 tp = &t->next) {
262 if (ipv6_addr_equal(local, &t->parms.laddr) &&
263 ipv6_addr_equal(remote, &t->parms.raddr)) {
267 return t;
284 struct ip6_tnl *t = netdev_priv(dev);
285 struct vti6_net *ip6n = net_generic(t->net, vti6_net_id);
290 vti6_tnl_unlink(ip6n, t);
291 netdev_put(dev, &t->dev_tracker);
297 struct ip6_tnl *t;
301 t = vti6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr, &ipv6h->daddr);
302 if (t) {
303 if (t->parms.proto != IPPROTO_IPV6 && t->parms.proto != 0) {
314 if (!ip6_tnl_rcv_ctl(t, &ipv6h->daddr, &ipv6h->saddr)) {
315 DEV_STATS_INC(t->dev, rx_dropped);
322 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t;
347 struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;
351 if (!t)
354 dev = t->dev;
378 skb->mark = be32_to_cpu(t->parms.i_key);
385 skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));
394 * @t: the outgoing tunnel device
399 * doesn't match source of incoming packet.
406 vti6_addr_conflict(const struct ip6_tnl *t, const struct ipv6hdr *hdr)
408 return ipv6_addr_equal(&t->parms.raddr, &hdr->saddr);
443 struct ip6_tnl *t = netdev_priv(dev);
482 dst = xfrm_lookup_route(t->net, dst, fl, NULL, 0);
493 if (!vti6_state_check(x, &t->parms.raddr, &t->parms.laddr))
496 if (!ip6_tnl_xmit_ctl(t, (const struct in6_addr *)&x->props.saddr,
505 t->parms.name);
530 skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
534 err = dst_output(t->net, skb->sk, skb);
551 struct ip6_tnl *t = netdev_priv(dev);
562 if ((t->parms.proto != IPPROTO_IPV6 && t->parms.proto != 0) ||
563 vti6_addr_conflict(t, ipv6_hdr(skb)))
578 fl.flowi_mark = be32_to_cpu(t->parms.o_key);
599 struct ip6_tnl *t;
607 t = vti6_tnl_lookup(dev_net(skb->dev), &iph->daddr, &iph->saddr);
608 if (!t)
611 mark = be32_to_cpu(t->parms.o_key);
649 static void vti6_link_config(struct ip6_tnl *t, bool keep_mtu)
651 struct net_device *dev = t->dev;
652 struct __ip6_tnl_parm *p = &t->parms;
661 p->flags |= ip6_tnl_get_cap(t, &p->laddr, &p->raddr);
677 struct rt6_info *rt = rt6_lookup(t->net,
687 tdev = __dev_get_by_index(t->net, p->link);
699 * @t: tunnel to be changed
701 * @keep_mtu: MTU was set from userspace, don't re-compute it
707 vti6_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p,
710 t->parms.laddr = p->laddr;
711 t->parms.raddr = p->raddr;
712 t->parms.link = p->link;
713 t->parms.i_key = p->i_key;
714 t->parms.o_key = p->o_key;
715 t->parms.proto = p->proto;
716 t->parms.fwmark = p->fwmark;
717 dst_cache_reset(&t->dst_cache);
718 vti6_link_config(t, keep_mtu);
722 static int vti6_update(struct ip6_tnl *t, struct __ip6_tnl_parm *p,
725 struct net *net = dev_net(t->dev);
729 vti6_tnl_unlink(ip6n, t);
731 err = vti6_tnl_change(t, p, keep_mtu);
732 vti6_tnl_link(ip6n, t);
733 netdev_state_change(t->dev);
790 * %-EPERM if current process hasn't %CAP_NET_ADMIN set
801 struct ip6_tnl *t = NULL;
815 t = vti6_locate(net, &p1, 0);
819 if (!t)
820 t = netdev_priv(dev);
821 vti6_parm_to_user(&p, &t->parms);
837 t = vti6_locate(net, &p1, cmd == SIOCADDTUNNEL);
839 if (t) {
840 if (t->dev != dev) {
845 t = netdev_priv(dev);
847 err = vti6_update(t, &p1, false);
849 if (t) {
851 vti6_parm_to_user(&p, &t->parms);
869 t = vti6_locate(net, &p1, 0);
870 if (!t)
873 if (t->dev == ip6n->fb_tnl_dev)
875 dev = t->dev;
925 struct ip6_tnl *t = netdev_priv(dev);
927 t->dev = dev;
928 netdev_hold(dev, &t->dev_tracker, GFP_KERNEL);
939 struct ip6_tnl *t = netdev_priv(dev);
944 vti6_link_config(t, true);
956 struct ip6_tnl *t = netdev_priv(dev);
960 t->net = net;
961 t->parms.proto = IPPROTO_IPV6;
963 rcu_assign_pointer(ip6n->tnls_wc[0], t);
1034 struct ip6_tnl *t;
1044 t = vti6_locate(net, &p, 0);
1046 if (t) {
1047 if (t->dev != dev)
1050 t = netdev_priv(dev);
1052 return vti6_update(t, &p, tb && tb[IFLA_MTU]);
1118 struct ip6_tnl *t;
1122 t = rtnl_net_dereference(net, ip6n->tnls_r_l[h]);
1123 while (t) {
1124 unregister_netdevice_queue(t->dev, list);
1125 t = rtnl_net_dereference(net, t->next);
1129 t = rtnl_net_dereference(net, ip6n->tnls_wc[0]);
1130 if (t)
1131 unregister_netdevice_queue(t->dev, list);
1137 struct ip6_tnl *t = NULL;
1162 t = netdev_priv(ip6n->fb_tnl_dev);
1164 strcpy(t->parms.name, ip6n->fb_tnl_dev->name);