diff mbox series

relayd: don't break localhost

Message ID mailman.6464.1625841346.1072.openwrt-devel@lists.openwrt.org
State New
Headers show
Series relayd: don't break localhost | expand

Commit Message

Dmitry Ivanov July 9, 2021, 2:35 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Relayd is adding default route to its routing tables when it's found in
DHCP response. Adding default route to routing table associated with
loopback interface makes no sense other than breaking localhost so that
DNS requests to local dnsmasq and even "ping" go to default

This patch prevents insertion of default route into "localhost" policy
routing table created by relayd.

Signed-off-by: Dmitry Ivanov <dimss79@inbox.lv>
 route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/route.c b/route.c
index c552d1f..f7cf815 100644
--- a/route.c
+++ b/route.c
@@ -243,7 +243,7 @@  rtnl_route_set(struct relayd_host *host, struct 
relayd_route *route, bool add)
 		rtnl_route_request(rif, host, route, add);
-	if (local_route_table)
+	if (local_route_table && route && route->mask)
 		rtnl_route_request(NULL, host, route, add);