Lines Matching refs:addr
34 union sctp_addr *addr, enum sctp_scope scope,
48 struct sctp_sockaddr_entry *addr; in sctp_bind_addr_copy() local
55 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_copy()
56 error = sctp_copy_one_addr(net, dest, &addr->a, scope, in sctp_bind_addr_copy()
67 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_copy()
68 error = sctp_copy_one_addr(net, dest, &addr->a, in sctp_bind_addr_copy()
98 struct sctp_sockaddr_entry *addr; in sctp_bind_addr_dup() local
104 list_for_each_entry(addr, &src->address_list, list) { in sctp_bind_addr_dup()
105 error = sctp_add_bind_addr(dest, &addr->a, sizeof(addr->a), in sctp_bind_addr_dup()
126 struct sctp_sockaddr_entry *addr, *temp; in sctp_bind_addr_clean() local
129 list_for_each_entry_safe(addr, temp, &bp->address_list, list) { in sctp_bind_addr_clean()
130 list_del_rcu(&addr->list); in sctp_bind_addr_clean()
131 kfree_rcu(addr, rcu); in sctp_bind_addr_clean()
132 SCTP_DBG_OBJCNT_DEC(addr); in sctp_bind_addr_clean()
147 struct sctp_sockaddr_entry *addr; in sctp_add_bind_addr() local
150 addr = kzalloc(sizeof(*addr), gfp); in sctp_add_bind_addr()
151 if (!addr) in sctp_add_bind_addr()
154 memcpy(&addr->a, new, min_t(size_t, sizeof(*new), new_size)); in sctp_add_bind_addr()
159 if (!addr->a.v4.sin_port) in sctp_add_bind_addr()
160 addr->a.v4.sin_port = htons(bp->port); in sctp_add_bind_addr()
162 addr->state = addr_state; in sctp_add_bind_addr()
163 addr->valid = 1; in sctp_add_bind_addr()
165 INIT_LIST_HEAD(&addr->list); in sctp_add_bind_addr()
170 list_add_tail_rcu(&addr->list, &bp->address_list); in sctp_add_bind_addr()
171 SCTP_DBG_OBJCNT_INC(addr); in sctp_add_bind_addr()
181 struct sctp_sockaddr_entry *addr, *temp; in sctp_del_bind_addr() local
187 list_for_each_entry_safe(addr, temp, &bp->address_list, list) { in sctp_del_bind_addr()
188 if (sctp_cmp_addr_exact(&addr->a, del_addr)) { in sctp_del_bind_addr()
191 addr->valid = 0; in sctp_del_bind_addr()
192 list_del_rcu(&addr->list); in sctp_del_bind_addr()
198 kfree_rcu(addr, rcu); in sctp_del_bind_addr()
199 SCTP_DBG_OBJCNT_DEC(addr); in sctp_del_bind_addr()
220 struct sctp_sockaddr_entry *addr; in sctp_bind_addrs_to_raw() local
246 list_for_each_entry(addr, &bp->address_list, list) { in sctp_bind_addrs_to_raw()
247 af = sctp_get_af_specific(addr->a.v4.sin_family); in sctp_bind_addrs_to_raw()
248 len = af->to_addr_param(&addr->a, &rawaddr); in sctp_bind_addrs_to_raw()
268 union sctp_addr addr; in sctp_raw_to_bind_addrs() local
280 !af->from_addr_param(&addr, rawaddr, htons(port), 0)) { in sctp_raw_to_bind_addrs()
285 if (sctp_bind_addr_state(bp, &addr) != -1) in sctp_raw_to_bind_addrs()
287 retval = sctp_add_bind_addr(bp, &addr, sizeof(addr), in sctp_raw_to_bind_addrs()
314 const union sctp_addr *addr, in sctp_bind_addr_match() argument
324 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) { in sctp_bind_addr_match()
366 const union sctp_addr *addr, in sctp_bind_addr_conflict() argument
390 conflict = sp->pf->cmp_addr(&laddr->a, addr, sp); in sctp_bind_addr_conflict()
401 const union sctp_addr *addr) in sctp_bind_addr_state() argument
406 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_bind_addr_state()
413 if (af->cmp_addr(&laddr->a, addr)) in sctp_bind_addr_state()
429 union sctp_addr *addr; in sctp_find_unmatch_addr() local
441 addr = addr_buf; in sctp_find_unmatch_addr()
442 af = sctp_get_af_specific(addr->v4.sin_family); in sctp_find_unmatch_addr()
446 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) in sctp_find_unmatch_addr()
460 union sctp_addr *addr, enum sctp_scope scope, in sctp_copy_one_addr() argument
465 if (sctp_is_any(NULL, addr)) { in sctp_copy_one_addr()
467 } else if (sctp_in_scope(net, addr, scope)) { in sctp_copy_one_addr()
472 if ((((AF_INET == addr->sa.sa_family) && in sctp_copy_one_addr()
475 (((AF_INET6 == addr->sa.sa_family) && in sctp_copy_one_addr()
478 error = sctp_add_bind_addr(dest, addr, sizeof(*addr), in sctp_copy_one_addr()
486 int sctp_is_any(struct sock *sk, const union sctp_addr *addr) in sctp_is_any() argument
492 if (addr->sa.sa_family != AF_UNSPEC) in sctp_is_any()
493 fam = addr->sa.sa_family; in sctp_is_any()
501 return af->is_any(addr); in sctp_is_any()
505 int sctp_in_scope(struct net *net, const union sctp_addr *addr, in sctp_in_scope() argument
508 enum sctp_scope addr_scope = sctp_scope(addr); in sctp_in_scope()
549 struct sctp_sockaddr_entry *addr; in sctp_is_ep_boundall() local
553 addr = list_entry(bp->address_list.next, in sctp_is_ep_boundall()
555 if (sctp_is_any(sk, &addr->a)) in sctp_is_ep_boundall()
566 enum sctp_scope sctp_scope(const union sctp_addr *addr) in sctp_scope() argument
570 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_scope()
574 return af->scope((union sctp_addr *)addr); in sctp_scope()