net/netdev: Fix best prefix in findby

When comparing with netmask, the best prefix len is netmask.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
This commit is contained in:
Jiri Vlasak
2026-01-08 11:47:46 +01:00
committed by Xiang Xiao
parent 45f6d86f37
commit 7fa4a7f3b4
+1 -1
View File
@@ -97,7 +97,7 @@ netdev_prefixlen_findby_lipv4addr(in_addr_t lipaddr, FAR int8_t *prefixlen)
/* Its a match */
bestdev = dev;
bestpref = 32; /* Regard as best (exact) match */
bestpref = (int8_t)net_ipv4_mask2pref(dev->d_netmask);
break;
}
#else