Lines Matching refs:ub
154 struct udp_bearer *ub; in tipc_udp_send_msg() local
162 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_send_msg()
163 if (!ub) { in tipc_udp_send_msg()
180 err = udp_tunnel_xmit_skb(rt, ub->ubsock->sk, clone, in tipc_udp_send_msg()
193 .flowi6_oif = ub->ifindex, in tipc_udp_send_msg()
198 err = ipv6_stub->ipv6_dst_lookup(ub->ubsock->sk, &ndst, &fl6); in tipc_udp_send_msg()
202 err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, clone, in tipc_udp_send_msg()
218 struct udp_bearer *ub; in tipc_udp_recv() local
225 ub = rcu_dereference_sk_user_data(sk); in tipc_udp_recv()
226 if (!ub) { in tipc_udp_recv()
234 b = rcu_dereference_rtnl(ub->bearer); in tipc_udp_recv()
246 static int enable_mcast(struct udp_bearer *ub, struct udp_media_addr *remote) in enable_mcast() argument
250 struct sock *sk = ub->ubsock->sk; in enable_mcast()
256 mreqn.imr_ifindex = ub->ifindex; in enable_mcast()
262 err = ipv6_stub->ipv6_sock_mc_join(sk, ub->ifindex, in enable_mcast()
276 static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub, in parse_options() argument
319 ub->ifindex = ip6->sin6_scope_id; in parse_options()
344 struct udp_bearer *ub; in tipc_udp_enable() local
350 ub = kzalloc(sizeof(*ub), GFP_ATOMIC); in tipc_udp_enable()
351 if (!ub) in tipc_udp_enable()
356 err = parse_options(attrs, ub, &local, remote); in tipc_udp_enable()
362 rcu_assign_pointer(b->media_ptr, ub); in tipc_udp_enable()
363 rcu_assign_pointer(ub->bearer, b); in tipc_udp_enable()
376 ub->ifindex = dev->ifindex; in tipc_udp_enable()
392 err = udp_sock_create(net, &udp_conf, &ub->ubsock); in tipc_udp_enable()
395 tuncfg.sk_user_data = ub; in tipc_udp_enable()
399 setup_udp_tunnel_sock(net, ub->ubsock, &tuncfg); in tipc_udp_enable()
401 if (enable_mcast(ub, remote)) in tipc_udp_enable()
405 kfree(ub); in tipc_udp_enable()
412 struct udp_bearer *ub = container_of(work, struct udp_bearer, work); in cleanup_bearer() local
414 if (ub->ubsock) in cleanup_bearer()
415 udp_tunnel_sock_release(ub->ubsock); in cleanup_bearer()
417 kfree(ub); in cleanup_bearer()
423 struct udp_bearer *ub; in tipc_udp_disable() local
425 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_disable()
426 if (!ub) { in tipc_udp_disable()
430 if (ub->ubsock) in tipc_udp_disable()
431 sock_set_flag(ub->ubsock->sk, SOCK_DEAD); in tipc_udp_disable()
433 RCU_INIT_POINTER(ub->bearer, NULL); in tipc_udp_disable()
436 INIT_WORK(&ub->work, cleanup_bearer); in tipc_udp_disable()
437 schedule_work(&ub->work); in tipc_udp_disable()