Lines Matching refs:addr
63 struct sctp_sockaddr_entry *addr; in sctp_bind_addr_copy() local
70 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_copy()
71 error = sctp_copy_one_addr(net, dest, &addr->a, scope, in sctp_bind_addr_copy()
82 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_copy()
83 error = sctp_copy_one_addr(net, dest, &addr->a, in sctp_bind_addr_copy()
107 struct sctp_sockaddr_entry *addr; in sctp_bind_addr_dup() local
113 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_dup()
114 error = sctp_add_bind_addr(dest, &addr->a, sizeof(addr->a), in sctp_bind_addr_dup()
135 struct sctp_sockaddr_entry *addr, *temp; in sctp_bind_addr_clean() local
138 list_for_each_entry_safe(addr, temp, &bp->address_list, list) { in sctp_bind_addr_clean()
139 list_del_rcu(&addr->list); in sctp_bind_addr_clean()
140 kfree_rcu(addr, rcu); in sctp_bind_addr_clean()
141 SCTP_DBG_OBJCNT_DEC(addr); in sctp_bind_addr_clean()
156 struct sctp_sockaddr_entry *addr; in sctp_add_bind_addr() local
159 addr = kzalloc(sizeof(*addr), gfp); in sctp_add_bind_addr()
160 if (!addr) in sctp_add_bind_addr()
163 memcpy(&addr->a, new, min_t(size_t, sizeof(*new), new_size)); in sctp_add_bind_addr()
168 if (!addr->a.v4.sin_port) in sctp_add_bind_addr()
169 addr->a.v4.sin_port = htons(bp->port); in sctp_add_bind_addr()
171 addr->state = addr_state; in sctp_add_bind_addr()
172 addr->valid = 1; in sctp_add_bind_addr()
174 INIT_LIST_HEAD(&addr->list); in sctp_add_bind_addr()
179 list_add_tail_rcu(&addr->list, &bp->address_list); in sctp_add_bind_addr()
180 SCTP_DBG_OBJCNT_INC(addr); in sctp_add_bind_addr()
190 struct sctp_sockaddr_entry *addr, *temp; in sctp_del_bind_addr() local
196 list_for_each_entry_safe(addr, temp, &bp->address_list, list) { in sctp_del_bind_addr()
197 if (sctp_cmp_addr_exact(&addr->a, del_addr)) { in sctp_del_bind_addr()
200 addr->valid = 0; in sctp_del_bind_addr()
201 list_del_rcu(&addr->list); in sctp_del_bind_addr()
207 kfree_rcu(addr, rcu); in sctp_del_bind_addr()
208 SCTP_DBG_OBJCNT_DEC(addr); in sctp_del_bind_addr()
229 struct sctp_sockaddr_entry *addr; in sctp_bind_addrs_to_raw() local
255 list_for_each_entry(addr, &bp->address_list, list) { in sctp_bind_addrs_to_raw()
256 af = sctp_get_af_specific(addr->a.v4.sin_family); in sctp_bind_addrs_to_raw()
257 len = af->to_addr_param(&addr->a, &rawaddr); in sctp_bind_addrs_to_raw()
277 union sctp_addr addr; in sctp_raw_to_bind_addrs() local
294 af->from_addr_param(&addr, rawaddr, htons(port), 0); in sctp_raw_to_bind_addrs()
295 retval = sctp_add_bind_addr(bp, &addr, sizeof(addr), in sctp_raw_to_bind_addrs()
317 const union sctp_addr *addr, in sctp_bind_addr_match() argument
327 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) { in sctp_bind_addr_match()
341 const union sctp_addr *addr, in sctp_bind_addr_conflict() argument
365 conflict = sp->pf->cmp_addr(&laddr->a, addr, sp); in sctp_bind_addr_conflict()
376 const union sctp_addr *addr) in sctp_bind_addr_state() argument
382 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_bind_addr_state()
390 if (af->cmp_addr(&laddr->a, addr)) { in sctp_bind_addr_state()
409 union sctp_addr *addr; in sctp_find_unmatch_addr() local
421 addr = addr_buf; in sctp_find_unmatch_addr()
422 af = sctp_get_af_specific(addr->v4.sin_family); in sctp_find_unmatch_addr()
426 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) in sctp_find_unmatch_addr()
440 union sctp_addr *addr, in sctp_copy_one_addr() argument
446 if (sctp_is_any(NULL, addr)) { in sctp_copy_one_addr()
448 } else if (sctp_in_scope(net, addr, scope)) { in sctp_copy_one_addr()
453 if ((((AF_INET == addr->sa.sa_family) && in sctp_copy_one_addr()
455 (((AF_INET6 == addr->sa.sa_family) && in sctp_copy_one_addr()
458 error = sctp_add_bind_addr(dest, addr, sizeof(*addr), in sctp_copy_one_addr()
466 int sctp_is_any(struct sock *sk, const union sctp_addr *addr) in sctp_is_any() argument
472 if (addr->sa.sa_family != AF_UNSPEC) in sctp_is_any()
473 fam = addr->sa.sa_family; in sctp_is_any()
481 return af->is_any(addr); in sctp_is_any()
485 int sctp_in_scope(struct net *net, const union sctp_addr *addr, sctp_scope_t scope) in sctp_in_scope() argument
487 sctp_scope_t addr_scope = sctp_scope(addr); in sctp_in_scope()
528 struct sctp_sockaddr_entry *addr; in sctp_is_ep_boundall() local
532 addr = list_entry(bp->address_list.next, in sctp_is_ep_boundall()
534 if (sctp_is_any(sk, &addr->a)) in sctp_is_ep_boundall()
545 sctp_scope_t sctp_scope(const union sctp_addr *addr) in sctp_scope() argument
549 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_scope()
553 return af->scope((union sctp_addr *)addr); in sctp_scope()