• Home
  • Raw
  • Download

Lines Matching refs:addr

139 	struct sctp_sockaddr_entry *addr;  in sctp_v4_copy_addrlist()  local
149 addr = kzalloc(sizeof(*addr), GFP_ATOMIC); in sctp_v4_copy_addrlist()
150 if (addr) { in sctp_v4_copy_addrlist()
151 addr->a.v4.sin_family = AF_INET; in sctp_v4_copy_addrlist()
152 addr->a.v4.sin_port = 0; in sctp_v4_copy_addrlist()
153 addr->a.v4.sin_addr.s_addr = ifa->ifa_local; in sctp_v4_copy_addrlist()
154 addr->valid = 1; in sctp_v4_copy_addrlist()
155 INIT_LIST_HEAD(&addr->list); in sctp_v4_copy_addrlist()
156 list_add_tail(&addr->list, addrlist); in sctp_v4_copy_addrlist()
185 struct sctp_sockaddr_entry *addr; in sctp_free_local_addr_list() local
189 addr = list_entry(pos, struct sctp_sockaddr_entry, list); in sctp_free_local_addr_list()
191 kfree(addr); in sctp_free_local_addr_list()
199 struct sctp_sockaddr_entry *addr; in sctp_copy_local_addr_list() local
203 list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) { in sctp_copy_local_addr_list()
204 if (!addr->valid) in sctp_copy_local_addr_list()
206 if (sctp_in_scope(net, &addr->a, scope)) { in sctp_copy_local_addr_list()
211 if ((((AF_INET == addr->a.sa.sa_family) && in sctp_copy_local_addr_list()
213 (((AF_INET6 == addr->a.sa.sa_family) && in sctp_copy_local_addr_list()
216 error = sctp_add_bind_addr(bp, &addr->a, in sctp_copy_local_addr_list()
230 static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb, in sctp_v4_from_skb() argument
237 port = &addr->v4.sin_port; in sctp_v4_from_skb()
238 addr->v4.sin_family = AF_INET; in sctp_v4_from_skb()
248 memcpy(&addr->v4.sin_addr.s_addr, from, sizeof(struct in_addr)); in sctp_v4_from_skb()
252 static void sctp_v4_from_sk(union sctp_addr *addr, struct sock *sk) in sctp_v4_from_sk() argument
254 addr->v4.sin_family = AF_INET; in sctp_v4_from_sk()
255 addr->v4.sin_port = 0; in sctp_v4_from_sk()
256 addr->v4.sin_addr.s_addr = inet_sk(sk)->inet_rcv_saddr; in sctp_v4_from_sk()
260 static void sctp_v4_to_sk_saddr(union sctp_addr *addr, struct sock *sk) in sctp_v4_to_sk_saddr() argument
262 inet_sk(sk)->inet_rcv_saddr = addr->v4.sin_addr.s_addr; in sctp_v4_to_sk_saddr()
266 static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) in sctp_v4_to_sk_daddr() argument
268 inet_sk(sk)->inet_daddr = addr->v4.sin_addr.s_addr; in sctp_v4_to_sk_daddr()
272 static void sctp_v4_from_addr_param(union sctp_addr *addr, in sctp_v4_from_addr_param() argument
276 addr->v4.sin_family = AF_INET; in sctp_v4_from_addr_param()
277 addr->v4.sin_port = port; in sctp_v4_from_addr_param()
278 addr->v4.sin_addr.s_addr = param->v4.addr.s_addr; in sctp_v4_from_addr_param()
284 static int sctp_v4_to_addr_param(const union sctp_addr *addr, in sctp_v4_to_addr_param() argument
291 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; in sctp_v4_to_addr_param()
320 static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) in sctp_v4_inaddr_any() argument
322 addr->v4.sin_family = AF_INET; in sctp_v4_inaddr_any()
323 addr->v4.sin_addr.s_addr = htonl(INADDR_ANY); in sctp_v4_inaddr_any()
324 addr->v4.sin_port = port; in sctp_v4_inaddr_any()
328 static int sctp_v4_is_any(const union sctp_addr *addr) in sctp_v4_is_any() argument
330 return htonl(INADDR_ANY) == addr->v4.sin_addr.s_addr; in sctp_v4_is_any()
340 static int sctp_v4_addr_valid(union sctp_addr *addr, in sctp_v4_addr_valid() argument
349 if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) in sctp_v4_addr_valid()
360 static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) in sctp_v4_available() argument
363 int ret = inet_addr_type(net, addr->v4.sin_addr.s_addr); in sctp_v4_available()
366 if (addr->v4.sin_addr.s_addr != htonl(INADDR_ANY) && in sctp_v4_available()
395 static sctp_scope_t sctp_v4_scope(union sctp_addr *addr) in sctp_v4_scope() argument
400 if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
402 } else if (ipv4_is_loopback(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
404 } else if (ipv4_is_linklocal_169(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
406 } else if (ipv4_is_private_10(addr->v4.sin_addr.s_addr) || in sctp_v4_scope()
407 ipv4_is_private_172(addr->v4.sin_addr.s_addr) || in sctp_v4_scope()
408 ipv4_is_private_192(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
579 static int sctp_v4_addr_to_user(struct sctp_sock *sp, union sctp_addr *addr) in sctp_v4_addr_to_user() argument
586 static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) in sctp_v4_seq_dump_addr() argument
588 seq_printf(seq, "%pI4 ", &addr->v4.sin_addr); in sctp_v4_seq_dump_addr()
674 struct sctp_sockaddr_entry *addr) in sctp_addr_wq_lookup() argument
679 if (addrw->a.sa.sa_family != addr->a.sa.sa_family) in sctp_addr_wq_lookup()
683 addr->a.v4.sin_addr.s_addr) in sctp_addr_wq_lookup()
687 &addr->a.v6.sin6_addr)) in sctp_addr_wq_lookup()
694 void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cmd) in sctp_addr_wq_mgmt() argument
707 addrw = sctp_addr_wq_lookup(net, addr); in sctp_addr_wq_mgmt()
722 addrw = kmemdup(addr, sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); in sctp_addr_wq_mgmt()
751 struct sctp_sockaddr_entry *addr = NULL; in sctp_inetaddr_event() local
758 addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); in sctp_inetaddr_event()
759 if (addr) { in sctp_inetaddr_event()
760 addr->a.v4.sin_family = AF_INET; in sctp_inetaddr_event()
761 addr->a.v4.sin_port = 0; in sctp_inetaddr_event()
762 addr->a.v4.sin_addr.s_addr = ifa->ifa_local; in sctp_inetaddr_event()
763 addr->valid = 1; in sctp_inetaddr_event()
765 list_add_tail_rcu(&addr->list, &net->sctp.local_addr_list); in sctp_inetaddr_event()
766 sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_NEW); in sctp_inetaddr_event()
772 list_for_each_entry_safe(addr, temp, in sctp_inetaddr_event()
774 if (addr->a.sa.sa_family == AF_INET && in sctp_inetaddr_event()
775 addr->a.v4.sin_addr.s_addr == in sctp_inetaddr_event()
777 sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_DEL); in sctp_inetaddr_event()
779 addr->valid = 0; in sctp_inetaddr_event()
780 list_del_rcu(&addr->list); in sctp_inetaddr_event()
786 kfree_rcu(addr, rcu); in sctp_inetaddr_event()
928 static int sctp_inet_bind_verify(struct sctp_sock *opt, union sctp_addr *addr) in sctp_inet_bind_verify() argument
930 return sctp_v4_available(addr, opt); in sctp_inet_bind_verify()
936 static int sctp_inet_send_verify(struct sctp_sock *opt, union sctp_addr *addr) in sctp_inet_send_verify() argument