MCPcopy Create free account
hub / github.com/COVESA/vsomeip / RTA_OK

Function RTA_OK

implementation/endpoints/src/netlink_connector.cpp:388–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386 auto retrta = static_cast<const struct rtattr*>(IFA_RTA(ifa_struct));
387 while
388 RTA_OK(retrta, length) {
389 if (retrta->rta_type == IFA_ADDRESS) {
390 if (address_.is_v4() && RTA_PAYLOAD(retrta) == sizeof(struct in_addr)
391 && ::memcmp(RTA_DATA(retrta), address_.to_v4().to_bytes().data(), sizeof(struct in_addr)) == 0) {
392 return true;
393 } else if (address_.is_v6() && RTA_PAYLOAD(retrta) == sizeof(struct in6_addr)
394 && ::memcmp(RTA_DATA(retrta), address_.to_v6().to_bytes().data(), sizeof(struct in6_addr)) == 0) {
395 return true;
396 }
397 }
398 retrta = RTA_NEXT(retrta, length);
399 }
400
401 return false;
402}

Callers 1

Calls 3

is_v4Method · 0.80
is_v6Method · 0.80
dataMethod · 0.45

Tested by

no test coverage detected