Lines Matching refs:ub

156 	struct udp_bearer *ub;  in tipc_udp_send_msg()  local
168 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_send_msg()
169 if (!ub) { in tipc_udp_send_msg()
186 err = udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, in tipc_udp_send_msg()
199 .flowi6_oif = ub->ifindex, in tipc_udp_send_msg()
204 err = ipv6_stub->ipv6_dst_lookup(net, ub->ubsock->sk, &ndst, in tipc_udp_send_msg()
209 err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, in tipc_udp_send_msg()
225 struct udp_bearer *ub; in tipc_udp_recv() local
232 ub = rcu_dereference_sk_user_data(sk); in tipc_udp_recv()
233 if (!ub) { in tipc_udp_recv()
241 b = rcu_dereference_rtnl(ub->bearer); in tipc_udp_recv()
253 static int enable_mcast(struct udp_bearer *ub, struct udp_media_addr *remote) in enable_mcast() argument
257 struct sock *sk = ub->ubsock->sk; in enable_mcast()
263 mreqn.imr_ifindex = ub->ifindex; in enable_mcast()
269 err = ipv6_stub->ipv6_sock_mc_join(sk, ub->ifindex, in enable_mcast()
283 static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub, in parse_options() argument
326 ub->ifindex = ip6->sin6_scope_id; in parse_options()
351 struct udp_bearer *ub; in tipc_udp_enable() local
357 ub = kzalloc(sizeof(*ub), GFP_ATOMIC); in tipc_udp_enable()
358 if (!ub) in tipc_udp_enable()
363 err = parse_options(attrs, ub, &local, remote); in tipc_udp_enable()
369 rcu_assign_pointer(b->media_ptr, ub); in tipc_udp_enable()
370 rcu_assign_pointer(ub->bearer, b); in tipc_udp_enable()
383 ub->ifindex = dev->ifindex; in tipc_udp_enable()
399 err = udp_sock_create(net, &udp_conf, &ub->ubsock); in tipc_udp_enable()
402 tuncfg.sk_user_data = ub; in tipc_udp_enable()
406 setup_udp_tunnel_sock(net, ub->ubsock, &tuncfg); in tipc_udp_enable()
408 if (enable_mcast(ub, remote)) in tipc_udp_enable()
412 kfree(ub); in tipc_udp_enable()
419 struct udp_bearer *ub = container_of(work, struct udp_bearer, work); in cleanup_bearer() local
421 if (ub->ubsock) in cleanup_bearer()
422 udp_tunnel_sock_release(ub->ubsock); in cleanup_bearer()
424 kfree(ub); in cleanup_bearer()
430 struct udp_bearer *ub; in tipc_udp_disable() local
432 ub = rcu_dereference_rtnl(b->media_ptr); in tipc_udp_disable()
433 if (!ub) { in tipc_udp_disable()
437 if (ub->ubsock) in tipc_udp_disable()
438 sock_set_flag(ub->ubsock->sk, SOCK_DEAD); in tipc_udp_disable()
439 RCU_INIT_POINTER(ub->bearer, NULL); in tipc_udp_disable()
442 INIT_WORK(&ub->work, cleanup_bearer); in tipc_udp_disable()
443 schedule_work(&ub->work); in tipc_udp_disable()