Lines Matching refs:ub
168 struct udp_bearer *ub, struct udp_media_addr *src, in tipc_udp_xmit() argument
195 udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, in tipc_udp_xmit()
202 .flowi6_oif = ub->ifindex, in tipc_udp_xmit()
208 ub->ubsock->sk, in tipc_udp_xmit()
217 err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL, in tipc_udp_xmit()
238 struct udp_bearer *ub; in tipc_udp_send_msg() local
248 ub = rcu_dereference(b->media_ptr); in tipc_udp_send_msg()
249 if (!ub) { in tipc_udp_send_msg()
255 return tipc_udp_xmit(net, skb, ub, src, dst, in tipc_udp_send_msg()
256 &ub->rcast.dst_cache); in tipc_udp_send_msg()
259 list_for_each_entry_rcu(rcast, &ub->rcast.list, list) { in tipc_udp_send_msg()
268 err = tipc_udp_xmit(net, _skb, ub, src, &rcast->addr, in tipc_udp_send_msg()
283 struct udp_bearer *ub; in tipc_udp_is_known_peer() local
285 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_is_known_peer()
286 if (!ub) { in tipc_udp_is_known_peer()
291 list_for_each_entry_safe(rcast, tmp, &ub->rcast.list, list) { in tipc_udp_is_known_peer()
303 struct udp_bearer *ub; in tipc_udp_rcast_add() local
305 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_rcast_add()
306 if (!ub) in tipc_udp_rcast_add()
327 list_add_rcu(&rcast->list, &ub->rcast.list); in tipc_udp_rcast_add()
371 struct udp_bearer *ub; in tipc_udp_recv() local
376 ub = rcu_dereference_sk_user_data(sk); in tipc_udp_recv()
377 if (!ub) { in tipc_udp_recv()
384 b = rcu_dereference(ub->bearer); in tipc_udp_recv()
405 static int enable_mcast(struct udp_bearer *ub, struct udp_media_addr *remote) in enable_mcast() argument
409 struct sock *sk = ub->ubsock->sk; in enable_mcast()
413 mreqn.imr_ifindex = ub->ifindex; in enable_mcast()
418 err = ipv6_stub->ipv6_sock_mc_join(sk, ub->ifindex, in enable_mcast()
462 struct udp_bearer *ub; in tipc_udp_nl_dump_remoteip() local
506 ub = rtnl_dereference(b->media_ptr); in tipc_udp_nl_dump_remoteip()
507 if (!ub) { in tipc_udp_nl_dump_remoteip()
513 list_for_each_entry_safe(rcast, tmp, &ub->rcast.list, list) { in tipc_udp_nl_dump_remoteip()
545 struct udp_bearer *ub; in tipc_udp_nl_add_bearer_data() local
548 ub = rtnl_dereference(b->media_ptr); in tipc_udp_nl_add_bearer_data()
549 if (!ub) in tipc_udp_nl_add_bearer_data()
563 if (!list_empty(&ub->rcast.list)) { in tipc_udp_nl_add_bearer_data()
665 struct udp_bearer *ub; in tipc_udp_enable() local
675 ub = kzalloc(sizeof(*ub), GFP_ATOMIC); in tipc_udp_enable()
676 if (!ub) in tipc_udp_enable()
679 INIT_LIST_HEAD(&ub->rcast.list); in tipc_udp_enable()
694 &ub->ifindex); in tipc_udp_enable()
723 rcu_assign_pointer(b->media_ptr, ub); in tipc_udp_enable()
724 rcu_assign_pointer(ub->bearer, b); in tipc_udp_enable()
740 ub->ifindex = dev->ifindex; in tipc_udp_enable()
749 dev = ub->ifindex ? __dev_get_by_index(net, ub->ifindex) : NULL; in tipc_udp_enable()
762 ub->ifindex = dev->ifindex; in tipc_udp_enable()
770 err = udp_sock_create(net, &udp_conf, &ub->ubsock); in tipc_udp_enable()
773 tuncfg.sk_user_data = ub; in tipc_udp_enable()
777 setup_udp_tunnel_sock(net, ub->ubsock, &tuncfg); in tipc_udp_enable()
779 err = dst_cache_init(&ub->rcast.dst_cache, GFP_ATOMIC); in tipc_udp_enable()
789 err = enable_mcast(ub, &remote); in tipc_udp_enable()
798 dst_cache_destroy(&ub->rcast.dst_cache); in tipc_udp_enable()
799 udp_tunnel_sock_release(ub->ubsock); in tipc_udp_enable()
801 kfree(ub); in tipc_udp_enable()
808 struct udp_bearer *ub = container_of(work, struct udp_bearer, work); in cleanup_bearer() local
811 list_for_each_entry_safe(rcast, tmp, &ub->rcast.list, list) { in cleanup_bearer()
817 atomic_dec(&tipc_net(sock_net(ub->ubsock->sk))->wq_count); in cleanup_bearer()
818 dst_cache_destroy(&ub->rcast.dst_cache); in cleanup_bearer()
819 udp_tunnel_sock_release(ub->ubsock); in cleanup_bearer()
821 kfree(ub); in cleanup_bearer()
827 struct udp_bearer *ub; in tipc_udp_disable() local
829 ub = rtnl_dereference(b->media_ptr); in tipc_udp_disable()
830 if (!ub) { in tipc_udp_disable()
834 sock_set_flag(ub->ubsock->sk, SOCK_DEAD); in tipc_udp_disable()
835 RCU_INIT_POINTER(ub->bearer, NULL); in tipc_udp_disable()
838 atomic_inc(&tipc_net(sock_net(ub->ubsock->sk))->wq_count); in tipc_udp_disable()
839 INIT_WORK(&ub->work, cleanup_bearer); in tipc_udp_disable()
840 schedule_work(&ub->work); in tipc_udp_disable()