• Home
  • Raw
  • Download

Lines Matching refs:entry

156 	struct mptcp_pm_addr_entry *entry;  in select_local_address()  local
162 list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { in select_local_address()
163 if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)) in select_local_address()
166 if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) in select_local_address()
169 *new_entry = *entry; in select_local_address()
182 struct mptcp_pm_addr_entry *entry; in select_signal_address() local
191 list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { in select_signal_address()
192 if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) in select_signal_address()
195 if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) in select_signal_address()
198 *new_entry = *entry; in select_signal_address()
256 struct mptcp_pm_add_entry *entry; in mptcp_lookup_anno_list_by_saddr() local
260 list_for_each_entry(entry, &msk->pm.anno_list, list) { in mptcp_lookup_anno_list_by_saddr()
261 if (mptcp_addresses_equal(&entry->addr, addr, true)) in mptcp_lookup_anno_list_by_saddr()
262 return entry; in mptcp_lookup_anno_list_by_saddr()
270 struct mptcp_pm_add_entry *entry; in mptcp_pm_sport_in_anno_list() local
277 list_for_each_entry(entry, &msk->pm.anno_list, list) { in mptcp_pm_sport_in_anno_list()
278 if (mptcp_addresses_equal(&entry->addr, &saddr, true)) { in mptcp_pm_sport_in_anno_list()
291 struct mptcp_pm_add_entry *entry = from_timer(entry, timer, add_timer); in mptcp_pm_add_timer() local
292 struct mptcp_sock *msk = entry->sock; in mptcp_pm_add_timer()
303 if (!entry->addr.id) in mptcp_pm_add_timer()
314 pr_debug("retransmit ADD_ADDR id=%d", entry->addr.id); in mptcp_pm_add_timer()
315 mptcp_pm_announce_addr(msk, &entry->addr, false); in mptcp_pm_add_timer()
317 entry->retrans_times++; in mptcp_pm_add_timer()
320 if (entry->retrans_times < ADD_ADDR_RETRANS_MAX) in mptcp_pm_add_timer()
326 if (entry->retrans_times == ADD_ADDR_RETRANS_MAX) in mptcp_pm_add_timer()
337 struct mptcp_pm_add_entry *entry; in mptcp_pm_del_add_timer() local
341 entry = mptcp_lookup_anno_list_by_saddr(msk, addr); in mptcp_pm_del_add_timer()
342 if (entry && (!check_id || entry->addr.id == addr->id)) in mptcp_pm_del_add_timer()
343 entry->retrans_times = ADD_ADDR_RETRANS_MAX; in mptcp_pm_del_add_timer()
346 if (entry && (!check_id || entry->addr.id == addr->id)) in mptcp_pm_del_add_timer()
347 sk_stop_timer_sync(sk, &entry->add_timer); in mptcp_pm_del_add_timer()
349 return entry; in mptcp_pm_del_add_timer()
391 struct mptcp_pm_add_entry *entry, *tmp; in mptcp_pm_free_anno_list() local
401 list_for_each_entry_safe(entry, tmp, &free_list, list) { in mptcp_pm_free_anno_list()
402 sk_stop_timer_sync(sk, &entry->add_timer); in mptcp_pm_free_anno_list()
403 kfree(entry); in mptcp_pm_free_anno_list()
505 struct mptcp_pm_addr_entry *entry; in __lookup_addr_by_id() local
507 list_for_each_entry(entry, &pernet->local_addr_list, list) { in __lookup_addr_by_id()
508 if (entry->addr.id == id) in __lookup_addr_by_id()
509 return entry; in __lookup_addr_by_id()
518 struct mptcp_pm_addr_entry *entry; in __lookup_addr() local
520 list_for_each_entry(entry, &pernet->local_addr_list, list) { in __lookup_addr()
522 mptcp_addresses_equal(&entry->addr, info, entry->addr.port)) || in __lookup_addr()
523 (lookup_by_id && entry->addr.id == info->id)) in __lookup_addr()
524 return entry; in __lookup_addr()
548 struct mptcp_pm_addr_entry *entry; in mptcp_pm_create_subflow_or_signal_addr() local
554 entry = __lookup_addr(pernet, &mpc_addr, false); in mptcp_pm_create_subflow_or_signal_addr()
555 if (entry) { in mptcp_pm_create_subflow_or_signal_addr()
556 __clear_bit(entry->addr.id, msk->pm.id_avail_bitmap); in mptcp_pm_create_subflow_or_signal_addr()
557 msk->mpc_endpoint_id = entry->addr.id; in mptcp_pm_create_subflow_or_signal_addr()
558 backup = !!(entry->flags & MPTCP_PM_ADDR_FLAG_BACKUP); in mptcp_pm_create_subflow_or_signal_addr()
650 struct mptcp_pm_addr_entry *entry; in fill_local_addresses_vec() local
662 list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { in fill_local_addresses_vec()
663 if (!(entry->flags & MPTCP_PM_ADDR_FLAG_FULLMESH)) in fill_local_addresses_vec()
666 if (!mptcp_pm_addr_families_match(sk, &entry->addr, remote)) in fill_local_addresses_vec()
671 addrs[i] = entry->addr; in fill_local_addresses_vec()
674 if (mptcp_addresses_equal(&entry->addr, &mpc_addr, entry->addr.port)) in fill_local_addresses_vec()
925 static bool address_use_port(struct mptcp_pm_addr_entry *entry) in address_use_port() argument
927 return (entry->flags & in address_use_port()
933 static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry) in __mptcp_pm_release_addr_entry() argument
935 if (entry->lsk) in __mptcp_pm_release_addr_entry()
936 sock_release(entry->lsk); in __mptcp_pm_release_addr_entry()
937 kfree(entry); in __mptcp_pm_release_addr_entry()
941 struct mptcp_pm_addr_entry *entry, in mptcp_pm_nl_append_new_local_addr() argument
958 if (test_bit(entry->addr.id, pernet->id_bitmap)) { in mptcp_pm_nl_append_new_local_addr()
966 if (!address_use_port(entry)) in mptcp_pm_nl_append_new_local_addr()
967 entry->addr.port = 0; in mptcp_pm_nl_append_new_local_addr()
969 if (mptcp_addresses_equal(&cur->addr, &entry->addr, in mptcp_pm_nl_append_new_local_addr()
970 cur->addr.port || entry->addr.port)) { in mptcp_pm_nl_append_new_local_addr()
979 if (entry->addr.id) in mptcp_pm_nl_append_new_local_addr()
983 entry->addr.id = cur->addr.id; in mptcp_pm_nl_append_new_local_addr()
990 if (!entry->addr.id && needs_id) { in mptcp_pm_nl_append_new_local_addr()
992 entry->addr.id = find_next_zero_bit(pernet->id_bitmap, in mptcp_pm_nl_append_new_local_addr()
995 if (!entry->addr.id && pernet->next_id != 1) { in mptcp_pm_nl_append_new_local_addr()
1001 if (!entry->addr.id && needs_id) in mptcp_pm_nl_append_new_local_addr()
1004 __set_bit(entry->addr.id, pernet->id_bitmap); in mptcp_pm_nl_append_new_local_addr()
1005 if (entry->addr.id > pernet->next_id) in mptcp_pm_nl_append_new_local_addr()
1006 pernet->next_id = entry->addr.id; in mptcp_pm_nl_append_new_local_addr()
1008 if (entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { in mptcp_pm_nl_append_new_local_addr()
1012 if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) { in mptcp_pm_nl_append_new_local_addr()
1018 if (!entry->addr.port) in mptcp_pm_nl_append_new_local_addr()
1019 list_add_tail_rcu(&entry->list, &pernet->local_addr_list); in mptcp_pm_nl_append_new_local_addr()
1021 list_add_rcu(&entry->list, &pernet->local_addr_list); in mptcp_pm_nl_append_new_local_addr()
1022 ret = entry->addr.id; in mptcp_pm_nl_append_new_local_addr()
1039 struct mptcp_pm_addr_entry *entry) in mptcp_pm_nl_create_listen_socket() argument
1048 err = sock_create_kern(sock_net(sk), entry->addr.family, in mptcp_pm_nl_create_listen_socket()
1049 SOCK_STREAM, IPPROTO_MPTCP, &entry->lsk); in mptcp_pm_nl_create_listen_socket()
1053 newsk = entry->lsk->sk; in mptcp_pm_nl_create_listen_socket()
1075 mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family); in mptcp_pm_nl_create_listen_socket()
1077 if (entry->addr.family == AF_INET6) in mptcp_pm_nl_create_listen_socket()
1105 struct mptcp_pm_addr_entry *entry; in mptcp_pm_nl_get_local_id() local
1112 list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { in mptcp_pm_nl_get_local_id()
1113 if (mptcp_addresses_equal(&entry->addr, skc, entry->addr.port)) { in mptcp_pm_nl_get_local_id()
1114 ret = entry->addr.id; in mptcp_pm_nl_get_local_id()
1123 entry = kmalloc(sizeof(*entry), GFP_ATOMIC); in mptcp_pm_nl_get_local_id()
1124 if (!entry) in mptcp_pm_nl_get_local_id()
1127 entry->addr = *skc; in mptcp_pm_nl_get_local_id()
1128 entry->addr.id = 0; in mptcp_pm_nl_get_local_id()
1129 entry->addr.port = 0; in mptcp_pm_nl_get_local_id()
1130 entry->ifindex = 0; in mptcp_pm_nl_get_local_id()
1131 entry->flags = MPTCP_PM_ADDR_FLAG_IMPLICIT; in mptcp_pm_nl_get_local_id()
1132 entry->lsk = NULL; in mptcp_pm_nl_get_local_id()
1133 ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, true); in mptcp_pm_nl_get_local_id()
1135 kfree(entry); in mptcp_pm_nl_get_local_id()
1143 struct mptcp_pm_addr_entry *entry; in mptcp_pm_nl_is_backup() local
1147 list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { in mptcp_pm_nl_is_backup()
1148 if (mptcp_addresses_equal(&entry->addr, skc, entry->addr.port)) { in mptcp_pm_nl_is_backup()
1149 backup = !!(entry->flags & MPTCP_PM_ADDR_FLAG_BACKUP); in mptcp_pm_nl_is_backup()
1310 struct mptcp_pm_addr_entry *entry) in mptcp_pm_parse_entry() argument
1315 memset(entry, 0, sizeof(*entry)); in mptcp_pm_parse_entry()
1317 err = mptcp_pm_parse_pm_addr_attr(tb, attr, info, &entry->addr, require_family); in mptcp_pm_parse_entry()
1324 entry->ifindex = val; in mptcp_pm_parse_entry()
1328 entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]); in mptcp_pm_parse_entry()
1331 entry->addr.port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT])); in mptcp_pm_parse_entry()
1383 struct mptcp_pm_addr_entry addr, *entry; in mptcp_nl_cmd_add_addr() local
1406 entry = kzalloc(sizeof(*entry), GFP_KERNEL_ACCOUNT); in mptcp_nl_cmd_add_addr()
1407 if (!entry) { in mptcp_nl_cmd_add_addr()
1412 *entry = addr; in mptcp_nl_cmd_add_addr()
1413 if (entry->addr.port) { in mptcp_nl_cmd_add_addr()
1414 ret = mptcp_pm_nl_create_listen_socket(skb->sk, entry); in mptcp_nl_cmd_add_addr()
1420 ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, in mptcp_nl_cmd_add_addr()
1431 __mptcp_pm_release_addr_entry(entry); in mptcp_nl_cmd_add_addr()
1438 struct mptcp_pm_addr_entry *entry; in mptcp_pm_nl_get_flags_and_ifindex_by_id() local
1447 entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id); in mptcp_pm_nl_get_flags_and_ifindex_by_id()
1448 if (entry) { in mptcp_pm_nl_get_flags_and_ifindex_by_id()
1449 *flags = entry->flags; in mptcp_pm_nl_get_flags_and_ifindex_by_id()
1450 *ifindex = entry->ifindex; in mptcp_pm_nl_get_flags_and_ifindex_by_id()
1460 struct mptcp_pm_add_entry *entry; in remove_anno_list_by_saddr() local
1462 entry = mptcp_pm_del_add_timer(msk, addr, false); in remove_anno_list_by_saddr()
1463 if (entry) { in remove_anno_list_by_saddr()
1464 list_del(&entry->list); in remove_anno_list_by_saddr()
1465 kfree(entry); in remove_anno_list_by_saddr()
1503 const struct mptcp_pm_addr_entry *entry) in mptcp_nl_remove_subflow_and_signal_addr() argument
1505 const struct mptcp_addr_info *addr = &entry->addr; in mptcp_nl_remove_subflow_and_signal_addr()
1529 !(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT)); in mptcp_nl_remove_subflow_and_signal_addr()
1537 if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) { in mptcp_nl_remove_subflow_and_signal_addr()
1593 struct mptcp_pm_addr_entry addr, *entry; in mptcp_nl_cmd_del_addr() local
1610 entry = __lookup_addr_by_id(pernet, addr.addr.id); in mptcp_nl_cmd_del_addr()
1611 if (!entry) { in mptcp_nl_cmd_del_addr()
1616 if (entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { in mptcp_nl_cmd_del_addr()
1620 if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) { in mptcp_nl_cmd_del_addr()
1626 list_del_rcu(&entry->list); in mptcp_nl_cmd_del_addr()
1627 __clear_bit(entry->addr.id, pernet->id_bitmap); in mptcp_nl_cmd_del_addr()
1630 mptcp_nl_remove_subflow_and_signal_addr(sock_net(skb->sk), entry); in mptcp_nl_cmd_del_addr()
1632 __mptcp_pm_release_addr_entry(entry); in mptcp_nl_cmd_del_addr()
1640 struct mptcp_pm_addr_entry *entry; in mptcp_pm_remove_addrs() local
1643 list_for_each_entry(entry, rm_list, list) { in mptcp_pm_remove_addrs()
1648 if (remove_anno_list_by_saddr(msk, &entry->addr)) in mptcp_pm_remove_addrs()
1651 &entry->addr)) in mptcp_pm_remove_addrs()
1654 alist.ids[alist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs()
1669 struct mptcp_pm_addr_entry *entry; in mptcp_pm_remove_addrs_and_subflows() local
1671 list_for_each_entry(entry, rm_list, list) { in mptcp_pm_remove_addrs_and_subflows()
1673 lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) in mptcp_pm_remove_addrs_and_subflows()
1674 slist.ids[slist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs_and_subflows()
1677 remove_anno_list_by_saddr(msk, &entry->addr)) in mptcp_pm_remove_addrs_and_subflows()
1678 alist.ids[alist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs_and_subflows()
1756 struct mptcp_pm_addr_entry *entry) in mptcp_nl_fill_addr() argument
1758 struct mptcp_addr_info *addr = &entry->addr; in mptcp_nl_fill_addr()
1771 if (nla_put_u32(skb, MPTCP_PM_ADDR_ATTR_FLAGS, entry->flags)) in mptcp_nl_fill_addr()
1773 if (entry->ifindex && in mptcp_nl_fill_addr()
1774 nla_put_s32(skb, MPTCP_PM_ADDR_ATTR_IF_IDX, entry->ifindex)) in mptcp_nl_fill_addr()
1798 struct mptcp_pm_addr_entry addr, *entry; in mptcp_nl_cmd_get_addr() local
1820 entry = __lookup_addr_by_id(pernet, addr.addr.id); in mptcp_nl_cmd_get_addr()
1821 if (!entry) { in mptcp_nl_cmd_get_addr()
1827 ret = mptcp_nl_fill_addr(msg, entry); in mptcp_nl_cmd_get_addr()
1848 struct mptcp_pm_addr_entry *entry; in mptcp_nl_cmd_dump_addrs() local
1859 entry = __lookup_addr_by_id(pernet, i); in mptcp_nl_cmd_dump_addrs()
1860 if (!entry) in mptcp_nl_cmd_dump_addrs()
1863 if (entry->addr.id <= id) in mptcp_nl_cmd_dump_addrs()
1872 if (mptcp_nl_fill_addr(msg, entry) < 0) { in mptcp_nl_cmd_dump_addrs()
1877 id = entry->addr.id; in mptcp_nl_cmd_dump_addrs()
2009 struct mptcp_pm_addr_entry *entry; in mptcp_pm_nl_set_flags() local
2019 entry = __lookup_addr(pernet, &addr->addr, lookup_by_id); in mptcp_pm_nl_set_flags()
2020 if (!entry) { in mptcp_pm_nl_set_flags()
2025 (entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) { in mptcp_pm_nl_set_flags()
2030 changed = (addr->flags ^ entry->flags) & mask; in mptcp_pm_nl_set_flags()
2031 entry->flags = (entry->flags & ~mask) | (addr->flags & mask); in mptcp_pm_nl_set_flags()
2032 *addr = *entry; in mptcp_pm_nl_set_flags()