dhcp: Fix classless link local static routes (#161)

Detecting host routes based on address comparison is not needed in
classless routes as /32 mask can be explicitly used. This detecting
mechanism did cause issues when gateway was set to 0.0.0.0 (link local
routes).
This commit is contained in:
xvuko 2023-01-05 10:02:52 +01:00 committed by GitHub
parent 6797c08b66
commit 3e6277050f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -442,15 +442,6 @@ decode_rfc3442_rt(rb_tree_t *routes, struct interface *ifp,
memcpy(&gateway.s_addr, p, 4);
p += 4;
/* An on-link host route is normally set by having the
* gateway match the destination or assigned address */
if (gateway.s_addr == dest.s_addr ||
(gateway.s_addr == bootp->yiaddr ||
gateway.s_addr == bootp->ciaddr))
{
gateway.s_addr = INADDR_ANY;
netmask.s_addr = INADDR_BROADCAST;
}
if (netmask.s_addr == INADDR_BROADCAST)
rt->rt_flags = RTF_HOST;