COVESA / COVESA/vsomeip

[BUG]: Client subscribes events incorrectly when multiple provided services shares same port

Open
#899 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.4k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

### vSomeip Version

v3.4.10

### Boost Version

1.71

### Environment

Embedded Linux

### Describe the bug

When two provided services share the same port, the first client subscribing events to the first provided service ends up subscribing to events in *both* services. In addition, no subscribe message is sent by vsomeip when the second client tries to subscribe events.

When the provided services are both on the same port, the the first client ends up subscribing events to both services. The second client, despite asking it to subscribe events, does not send any subscription messages.

This is similar to the behavior described in #380, but only when offered services share the same port.

### Reproduction Steps

Server config:

```json
{
"network": "Server_VLAN17",
"unicast": "172.31.17.18",
"netmask": "255.255.255.0",
"applications": [
{
"name": "Server_VLAN17",
"id": 1
}
],
"services": [
{
"service": 36867,
"instance": 1,
"unreliable": 35699,
"reliable": 0,
"events": [
{
"event": 32775,
"is_field": false,
"is_reliable": false,
"cycle": 0
}
],
"eventgroups": [
{
"eventgroup": 1,
"events": [
32775
]
}
]
},
{
"service": 36866,
"instance": 1,
"unreliable": 35699,
"reliable": 0,
"events": [
{
"event": 32769,
"is_field": false,
"is_reliable": false,
"cycle": 0
}
],
"eventgroups": [
{
"eventgroup": 1,
"events": [
32769
]
}
]
}
],
"clients": [],
"routing": "Server_VLAN17",
"service-discovery": {
"enable": true,
"multicast": "239.127.3.1",
"port": 30490,
"protocol": "UDP",
"initial_delay_min": 9,
"initial_delay_max": 50,
"repetitions_base_delay": 50,
"repetitions_max": 3,
"ttl": 3,
"cyclic_offer_delay": 1000,
"request_response_delay": 50
}
}
```

Client config:

```json
{
"network": "Consumer_VLAN17",
"unicast": "172.31.17.6",
"netmask": "255.255.255.0",
"applications": [
{
"name": "Consumer_VLAN17",
"id": 2
}
],
"services": [],
"clients": [
{
"service": 36866,
"instance": 1,
"unreliable": [
39503
],
"reliable": []
},
{
"service": 36867,
"instance": 1,
"unreliable": [
55504
],
"reliable": []
}
],
"routing": "Consumer_VLAN17",
"service-discovery": {
"enable": true,
"multicast": "239.127.3.1",
"port": 30490,
"protocol": "UDP",
"initial_delay_min": 0,
"initial_delay_max": 0,
"repetitions_base_delay": 0,
"repetitions_max": 3,
"ttl": 3
}
}
```

1. Offer all events from both services in server config (notice both services are offered on the same UDP port).
2. Try to subscribe events of both services from the client.
3. Monitor the traffic on Wireshark and observe that the first client service from port `39503` subscribes to events of both services `36866` (`0x9002`) and `36867` (`0x9003`), while the second client service from port `55503` does not subscribe any events.

![Image](https://github.com/user-attachments/assets/21d65797-0c44-485a-8ce1-fb18262b2773)

### Expected behaviour

The first client service from port `39503` should subscribe to the events of `36866` (`0x9002`), while the second client service from port `55503` should subscribe events of `36867` (`0x9003`)

This happens only when service `36866` and `36867` are NOT offered on the same port:

![Image](https://github.com/user-attachments/assets/264f1ebc-e6a9-49d3-9133-d2f0d334e450)

### Logs and Screenshots

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.