• Home
  • Raw
  • Download

Lines Matching refs:addr

76 	struct sctp_sockaddr_entry *addr;  in sctp_v4_copy_addrlist()  local
86 addr = kzalloc(sizeof(*addr), GFP_ATOMIC); in sctp_v4_copy_addrlist()
87 if (addr) { in sctp_v4_copy_addrlist()
88 addr->a.v4.sin_family = AF_INET; in sctp_v4_copy_addrlist()
89 addr->a.v4.sin_addr.s_addr = ifa->ifa_local; in sctp_v4_copy_addrlist()
90 addr->valid = 1; in sctp_v4_copy_addrlist()
91 INIT_LIST_HEAD(&addr->list); in sctp_v4_copy_addrlist()
92 list_add_tail(&addr->list, addrlist); in sctp_v4_copy_addrlist()
121 struct sctp_sockaddr_entry *addr; in sctp_free_local_addr_list() local
125 addr = list_entry(pos, struct sctp_sockaddr_entry, list); in sctp_free_local_addr_list()
127 kfree(addr); in sctp_free_local_addr_list()
135 struct sctp_sockaddr_entry *addr; in sctp_copy_local_addr_list() local
140 list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) { in sctp_copy_local_addr_list()
141 if (!addr->valid) in sctp_copy_local_addr_list()
143 if (!sctp_in_scope(net, &addr->a, scope)) in sctp_copy_local_addr_list()
150 if (addr->a.sa.sa_family == AF_INET && in sctp_copy_local_addr_list()
153 if (addr->a.sa.sa_family == AF_INET6 && in sctp_copy_local_addr_list()
158 laddr = addr->a; in sctp_copy_local_addr_list()
164 error = sctp_add_bind_addr(bp, &addr->a, sizeof(addr->a), in sctp_copy_local_addr_list()
214 static void sctp_v4_from_skb(union sctp_addr *addr, struct sk_buff *skb, in sctp_v4_from_skb() argument
219 struct sockaddr_in *sa = &addr->v4; in sctp_v4_from_skb()
221 addr->v4.sin_family = AF_INET; in sctp_v4_from_skb()
234 static void sctp_v4_from_sk(union sctp_addr *addr, struct sock *sk) in sctp_v4_from_sk() argument
236 addr->v4.sin_family = AF_INET; in sctp_v4_from_sk()
237 addr->v4.sin_port = 0; in sctp_v4_from_sk()
238 addr->v4.sin_addr.s_addr = inet_sk(sk)->inet_rcv_saddr; in sctp_v4_from_sk()
239 memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero)); in sctp_v4_from_sk()
243 static void sctp_v4_to_sk_saddr(union sctp_addr *addr, struct sock *sk) in sctp_v4_to_sk_saddr() argument
245 inet_sk(sk)->inet_rcv_saddr = addr->v4.sin_addr.s_addr; in sctp_v4_to_sk_saddr()
249 static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) in sctp_v4_to_sk_daddr() argument
251 inet_sk(sk)->inet_daddr = addr->v4.sin_addr.s_addr; in sctp_v4_to_sk_daddr()
255 static void sctp_v4_from_addr_param(union sctp_addr *addr, in sctp_v4_from_addr_param() argument
259 addr->v4.sin_family = AF_INET; in sctp_v4_from_addr_param()
260 addr->v4.sin_port = port; in sctp_v4_from_addr_param()
261 addr->v4.sin_addr.s_addr = param->v4.addr.s_addr; in sctp_v4_from_addr_param()
262 memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero)); in sctp_v4_from_addr_param()
268 static int sctp_v4_to_addr_param(const union sctp_addr *addr, in sctp_v4_to_addr_param() argument
275 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; in sctp_v4_to_addr_param()
305 static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) in sctp_v4_inaddr_any() argument
307 addr->v4.sin_family = AF_INET; in sctp_v4_inaddr_any()
308 addr->v4.sin_addr.s_addr = htonl(INADDR_ANY); in sctp_v4_inaddr_any()
309 addr->v4.sin_port = port; in sctp_v4_inaddr_any()
310 memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero)); in sctp_v4_inaddr_any()
314 static int sctp_v4_is_any(const union sctp_addr *addr) in sctp_v4_is_any() argument
316 return htonl(INADDR_ANY) == addr->v4.sin_addr.s_addr; in sctp_v4_is_any()
326 static int sctp_v4_addr_valid(union sctp_addr *addr, in sctp_v4_addr_valid() argument
335 if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) in sctp_v4_addr_valid()
346 static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) in sctp_v4_available() argument
349 int ret = inet_addr_type(net, addr->v4.sin_addr.s_addr); in sctp_v4_available()
352 if (addr->v4.sin_addr.s_addr != htonl(INADDR_ANY) && in sctp_v4_available()
381 static enum sctp_scope sctp_v4_scope(union sctp_addr *addr) in sctp_v4_scope() argument
386 if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
388 } else if (ipv4_is_loopback(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
390 } else if (ipv4_is_linklocal_169(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
392 } else if (ipv4_is_private_10(addr->v4.sin_addr.s_addr) || in sctp_v4_scope()
393 ipv4_is_private_172(addr->v4.sin_addr.s_addr) || in sctp_v4_scope()
394 ipv4_is_private_192(addr->v4.sin_addr.s_addr)) { in sctp_v4_scope()
590 static int sctp_v4_addr_to_user(struct sctp_sock *sp, union sctp_addr *addr) in sctp_v4_addr_to_user() argument
593 memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero)); in sctp_v4_addr_to_user()
598 static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) in sctp_v4_seq_dump_addr() argument
600 seq_printf(seq, "%pI4 ", &addr->v4.sin_addr); in sctp_v4_seq_dump_addr()
686 struct sctp_sockaddr_entry *addr) in sctp_addr_wq_lookup() argument
691 if (addrw->a.sa.sa_family != addr->a.sa.sa_family) in sctp_addr_wq_lookup()
695 addr->a.v4.sin_addr.s_addr) in sctp_addr_wq_lookup()
699 &addr->a.v6.sin6_addr)) in sctp_addr_wq_lookup()
706 void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cmd) in sctp_addr_wq_mgmt() argument
719 addrw = sctp_addr_wq_lookup(net, addr); in sctp_addr_wq_mgmt()
734 addrw = kmemdup(addr, sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); in sctp_addr_wq_mgmt()
763 struct sctp_sockaddr_entry *addr = NULL; in sctp_inetaddr_event() local
770 addr = kzalloc(sizeof(*addr), GFP_ATOMIC); in sctp_inetaddr_event()
771 if (addr) { in sctp_inetaddr_event()
772 addr->a.v4.sin_family = AF_INET; in sctp_inetaddr_event()
773 addr->a.v4.sin_addr.s_addr = ifa->ifa_local; in sctp_inetaddr_event()
774 addr->valid = 1; in sctp_inetaddr_event()
776 list_add_tail_rcu(&addr->list, &net->sctp.local_addr_list); in sctp_inetaddr_event()
777 sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_NEW); in sctp_inetaddr_event()
783 list_for_each_entry_safe(addr, temp, in sctp_inetaddr_event()
785 if (addr->a.sa.sa_family == AF_INET && in sctp_inetaddr_event()
786 addr->a.v4.sin_addr.s_addr == in sctp_inetaddr_event()
788 sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_DEL); in sctp_inetaddr_event()
790 addr->valid = 0; in sctp_inetaddr_event()
791 list_del_rcu(&addr->list); in sctp_inetaddr_event()
797 kfree_rcu(addr, rcu); in sctp_inetaddr_event()
939 static int sctp_inet_bind_verify(struct sctp_sock *opt, union sctp_addr *addr) in sctp_inet_bind_verify() argument
941 return sctp_v4_available(addr, opt); in sctp_inet_bind_verify()
947 static int sctp_inet_send_verify(struct sctp_sock *opt, union sctp_addr *addr) in sctp_inet_send_verify() argument