Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit 3fe1afd

Browse files
vsomeip 2.10.14
1 parent 0bfa45d commit 3fe1afd

19 files changed

+490
-82
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changes
22
=======
3+
v2.10.14
4+
- Bugfix for pending subscriptions when same port is used
5+
for TCP and UDP endpoint option.
6+
37
v2.10.13
48

59
v2.10.12

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project (vsomeip)
88

99
set (VSOMEIP_MAJOR_VERSION 2)
1010
set (VSOMEIP_MINOR_VERSION 10)
11-
set (VSOMEIP_PATCH_VERSION 13)
11+
set (VSOMEIP_PATCH_VERSION 14)
1212
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
1313
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in
1414
set (CMAKE_VERBOSE_MAKEFILE off)

implementation/routing/include/eventgroupinfo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class eventgroupinfo {
109109

110110
std::mutex pending_subscriptions_mutex_;
111111
std::map<pending_subscription_id_t, pending_subscription_t> pending_subscriptions_;
112-
std::map<std::pair<boost::asio::ip::address, std::uint16_t>,
112+
std::map<std::tuple<boost::asio::ip::address, std::uint16_t, bool>,
113113
std::vector<pending_subscription_id_t>> pending_subscriptions_by_remote_;
114114
pending_subscription_id_t subscription_id_;
115115
};

implementation/routing/include/routing_manager_proxy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class routing_manager_proxy: public routing_manager_base {
189189
ST_REGISTERING = 0x2
190190
};
191191

192-
bool is_connected_;
192+
std::atomic<bool> is_connected_;
193193
std::atomic<bool> is_started_;
194194
inner_state_type_e state_;
195195

implementation/routing/src/eventgroupinfo.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,10 @@ pending_subscription_id_t eventgroupinfo::add_pending_subscription(
238238
}
239239
pending_subscriptions_[subscription_id_] = _pending_subscription;
240240

241-
const auto remote_address_port = std::make_pair(
241+
const auto remote_address_port = std::make_tuple(
242242
_pending_subscription.subscriber_->get_address(),
243-
_pending_subscription.subscriber_->get_port());
243+
_pending_subscription.subscriber_->get_port(),
244+
_pending_subscription.subscriber_->is_reliable());
244245

245246
auto found_address = pending_subscriptions_by_remote_.find(remote_address_port);
246247
if (found_address != pending_subscriptions_by_remote_.end()) {
@@ -262,9 +263,10 @@ std::vector<pending_subscription_t> eventgroupinfo::remove_pending_subscription(
262263
_subscription_id);
263264
if (found_pending_subscription != pending_subscriptions_.end()) {
264265
pending_subscription_t its_pending_sub = found_pending_subscription->second;
265-
const auto remote_address_port = std::make_pair(
266+
const auto remote_address_port = std::make_tuple(
266267
its_pending_sub.subscriber_->get_address(),
267-
its_pending_sub.subscriber_->get_port());
268+
its_pending_sub.subscriber_->get_port(),
269+
its_pending_sub.subscriber_->is_reliable());
268270
const bool removed_is_subscribe = (found_pending_subscription->second.ttl_ > 0);
269271

270272
// check if more (un)subscriptions to this eventgroup arrived from the
@@ -327,8 +329,8 @@ std::vector<pending_subscription_t> eventgroupinfo::remove_pending_subscription(
327329
boost::system::error_code ec;
328330
VSOMEIP_WARNING << __func__ << " Subscriptions were answered in "
329331
<< " in wrong order by rm_proxy! ["
330-
<< " subscriber: " << remote_address_port.first.to_string(ec)
331-
<< ":" << std::dec << remote_address_port.second;
332+
<< " subscriber: " << std::get<0>(remote_address_port).to_string(ec)
333+
<< ":" << std::dec << std::get<1>(remote_address_port);
332334
// found_pending_subscription isn't deleted from
333335
// pending_subscriptions_ map in this case to ensure answer
334336
// sequence of SD messages.

implementation/routing/src/routing_manager_impl.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,10 @@ void routing_manager_impl::notify_one(service_t _service, instance_t _instance,
967967
}
968968
}
969969
if (found_eventgroup) {
970+
const bool is_offered_both =
971+
(configuration_->get_reliable_port(_service, _instance) != ILLEGAL_PORT &&
972+
configuration_->get_unreliable_port(_service, _instance) != ILLEGAL_PORT);
973+
970974
std::set<std::shared_ptr<endpoint_definition>> its_targets;
971975
// Now set event's payload!
972976
// Either with endpoint_definition (remote) or with client (local).
@@ -984,7 +988,15 @@ void routing_manager_impl::notify_one(service_t _service, instance_t _instance,
984988
}
985989
}
986990
for (const auto &its_target : its_targets) {
987-
its_event->set_payload(_payload, its_target, _force, _flush);
991+
if (!is_offered_both) {
992+
its_event->set_payload(_payload, its_target, _force, _flush);
993+
} else {
994+
if (its_event->is_reliable() && its_target->is_reliable()) {
995+
its_event->set_payload(_payload, its_target, _force, _flush);
996+
} else if (!its_event->is_reliable() && !its_target->is_reliable()) {
997+
its_event->set_payload(_payload, its_target, _force, _flush);
998+
}
999+
}
9881000
}
9891001
}
9901002
} else {

implementation/utility/src/utility.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ bool utility::auto_configuration_init(const std::shared_ptr<configuration> &_con
146146
= reinterpret_cast<configuration_data_t *>(its_segment);
147147

148148
++its_configuration_refs__;
149+
used_client_ids__ = reinterpret_cast<unsigned short*>(
150+
reinterpret_cast<size_t>(&the_configuration_data__->routing_manager_host_) + sizeof(unsigned short));
151+
149152
} else {
150153
VSOMEIP_ERROR << "utility::auto_configuration_init: MapViewOfFile failed (" << GetLastError() << ")";
151154
}

test/CMakeLists.txt

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,30 @@ if(NOT ${TESTS_BAT})
16151615
${TEST_SUBSCRIBE_NOTIFY_ONE_SERVICE}
16161616
)
16171617

1618+
set(TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE
1619+
${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_master_udp.json)
1620+
configure_file(
1621+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/conf/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE}.in
1622+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE}
1623+
@ONLY)
1624+
copy_to_builddir(
1625+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE}
1626+
${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE}
1627+
${TEST_SUBSCRIBE_NOTIFY_ONE_SERVICE}
1628+
)
1629+
1630+
set(TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_SLAVE_UDP_CONFIG_FILE
1631+
${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_slave_udp.json)
1632+
configure_file(
1633+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/conf/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_SLAVE_UDP_CONFIG_FILE}.in
1634+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_SLAVE_UDP_CONFIG_FILE}
1635+
@ONLY)
1636+
copy_to_builddir(
1637+
${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_SLAVE_UDP_CONFIG_FILE}
1638+
${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_SLAVE_UDP_CONFIG_FILE}
1639+
${TEST_SUBSCRIBE_NOTIFY_ONE_SERVICE}
1640+
)
1641+
16181642
# copy starter scripts into builddir
16191643
set(TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER ${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_master_starter.sh)
16201644
copy_to_builddir(${PROJECT_SOURCE_DIR}/test/subscribe_notify_one_tests/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER}
@@ -2606,15 +2630,15 @@ if(NOT ${TESTS_BAT})
26062630

26072631
# subscribe notify one id tests
26082632
add_test(NAME ${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_udp
2609-
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER} UDP ${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_CONFIG_FILE})
2633+
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER} UDP ${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_UDP_CONFIG_FILE})
26102634
set_tests_properties(${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_udp PROPERTIES TIMEOUT 120)
26112635

26122636
add_test(NAME ${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_tcp
26132637
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER} TCP ${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_TCP_CONFIG_FILE})
26142638
set_tests_properties(${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_tcp PROPERTIES TIMEOUT 120)
26152639

26162640
add_test(NAME ${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_both_tcp_and_udp
2617-
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER} TCP_AND_UDP ${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_TCP_CONFIG_FILE})
2641+
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_SUBSCRIBE_NOTIFY_ONE_MASTER_STARTER} TCP_AND_UDP ${TEST_SUBSCRIBE_NOTIFY_ONE_DIFF_IDS_DIFF_PORTS_MASTER_CONFIG_FILE})
26182642
set_tests_properties(${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_both_tcp_and_udp PROPERTIES TIMEOUT 120)
26192643

26202644
add_test(NAME ${TEST_SUBSCRIBE_NOTIFY_ONE_NAME}_diff_client_ids_diff_ports_prefer_udp
@@ -2820,6 +2844,10 @@ if(NOT ${TESTS_BAT})
28202844
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_PENDING_SUBSCRIPTION_MASTER_STARTER} SUBSCRIBE_UNSUBSCRIBE_NACK)
28212845
set_tests_properties(${TEST_PENDING_SUBSCRIPTION_NAME}_alternating_subscribe_unsubscribe_nack PROPERTIES TIMEOUT 180)
28222846

2847+
add_test(NAME ${TEST_PENDING_SUBSCRIPTION_NAME}_alternating_subscribe_unsubscribe_same_port
2848+
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_PENDING_SUBSCRIPTION_MASTER_STARTER} SUBSCRIBE_UNSUBSCRIBE_SAME_PORT)
2849+
set_tests_properties(${TEST_PENDING_SUBSCRIPTION_NAME}_alternating_subscribe_unsubscribe_same_port PROPERTIES TIMEOUT 180)
2850+
28232851
# malicious data test
28242852
add_test(NAME ${TEST_MALICIOUS_DATA_NAME}
28252853
COMMAND ${PROJECT_BINARY_DIR}/test/${TEST_MALICIOUS_DATA_MASTER_STARTER})

test/pending_subscription_tests/conf/pending_subscription_test_master_starter.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ then
1717
echo "Please pass a test mode to this script."
1818
echo "For example: $0 SUSCRIBE"
1919
echo "Valid subscription types include:"
20-
echo " [SUBSCRIBE, SUBSCRIBE_UNSUBSCRIBE, UNSUBSCRIBE, SUBSCRIBE_UNSUBSCRIBE_NACK]"
20+
echo " [SUBSCRIBE, SUBSCRIBE_UNSUBSCRIBE, UNSUBSCRIBE, SUBSCRIBE_UNSUBSCRIBE_NACK, SUBSCRIBE_UNSUBSCRIBE_SAME_PORT]"
2121
exit 1
2222
fi
2323
TESTMODE=$1

test/pending_subscription_tests/pending_subscription_test_globals.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ enum test_mode_e {
2424
SUBSCRIBE,
2525
SUBSCRIBE_UNSUBSCRIBE,
2626
UNSUBSCRIBE,
27-
SUBSCRIBE_UNSUBSCRIBE_NACK
27+
SUBSCRIBE_UNSUBSCRIBE_NACK,
28+
SUBSCRIBE_UNSUBSCRIBE_SAME_PORT
2829
};
2930

3031
}

0 commit comments

Comments
 (0)