From 3e6277050fc561633a47fe19da541e0adc99da52 Mon Sep 17 00:00:00 2001 From: xvuko Date: Thu, 5 Jan 2023 10:02:52 +0100 Subject: [PATCH] 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). --- src/dhcp.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/dhcp.c b/src/dhcp.c index 39839562..68411864 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -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;