mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
@@ -97,7 +97,7 @@ netdev_prefixlen_findby_lipv4addr(in_addr_t lipaddr, FAR int8_t *prefixlen)
|
|||||||
/* Its a match */
|
/* Its a match */
|
||||||
|
|
||||||
bestdev = dev;
|
bestdev = dev;
|
||||||
bestpref = 32; /* Regard as best (exact) match */
|
bestpref = (int8_t)net_ipv4_mask2pref(dev->d_netmask);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user