IfaceMgr::getIface types
Hello, IfaceMgr::getIface
may have some incorrect types. This may be related to issues #1825 (closed) and #2027.
I'm giving Kea a very quick check as part of the Ubuntu Main Inclusion Review process, and part of that is a Coverity scan. Coverity has identified this comparison as not depending upon the inputs:
(ifindex > std::numeric_limits<int32_t>::max())
IfacePtr
IfaceMgr::getIface(int ifindex) {
if ((ifindex < 0) || (ifindex > std::numeric_limits<int32_t>::max())) {
return (IfacePtr()); // out of range
}
return (ifaces_.getIface(ifindex));
}
https://gitlab.isc.org/isc-projects/kea/-/blob/master/src/lib/dhcp/iface_mgr.cc#L903
If the bounds really are "non-negative integers", then it's probably fine. But it seemed plausible to me that the types were intended to be different, so, this report.
Thanks