COVESA / vsomeip

An implementation of Scalable service-Oriented MiddlewarE over IP
Mozilla Public License 2.0
1.01k stars 647 forks source link

[BUG] CommonAPI SOME/IP stub implementation _client->getHostAddress() returns "0.0.0.0" rather than peer's address #679

Open srl100 opened 4 weeks ago

srl100 commented 4 weeks ago

vSomeip Version

v3.4.10

Boost Version

1.81

Environment

Embedded Linux

Describe the bug

Stub implementations are passed the 'const std::shared_ptr _client' as their first parameter, but the _client->getHostAddress() does not return the IP address of the client.

Reproduction Steps

Create a simple method in .fidl, .fdepl. Implement the stub implementation of this method, and look at the content of the _client->getHostAddress() when the method is invoked from a remote client.

Expected behaviour

I expect to be able to read the IP address of the client in _client->getHostAddress().

Logs and Screenshots

Stub Implementation:

void VideoCameraStubImpl::setCamExclusive(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _ttl, setCamExclusiveReply_t _reply)
{
    (void)_ttl;
    std::cout << "getUid:" << _client->getUid() << std::endl;
    std::cout << "getGid:" << _client->getGid() << std::endl;
    std::cout << "getEnv:" << _client->getEnv() << std::endl;
    std::cout << "getHostAddress:" << _client->getHostAddress() << std::endl;
    _reply();
}

Console output:

getUid:4294967295
getGid:4294967295
getEnv:
getHostAddress:0.0.0.0