refactor: dedupe `if_nametoindex()` call
This commit is contained in:
parent
8de4269047
commit
5e8ab62de5
|
@ -637,7 +637,7 @@ std::optional<unsigned> tr_address::to_interface_index() const noexcept
|
||||||
{
|
{
|
||||||
auto const ret = if_nametoindex(ifa->ifa_name);
|
auto const ret = if_nametoindex(ifa->ifa_name);
|
||||||
tr_logAddDebug(fmt::format("Found interface index for {}: {}", display_name(), ret));
|
tr_logAddDebug(fmt::format("Found interface index for {}: {}", display_name(), ret));
|
||||||
return if_nametoindex(ifa->ifa_name);
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue