]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix detecting fake default routes.
authorRoy Marples <roy@marples.name>
Thu, 26 Mar 2015 22:25:26 +0000 (22:25 +0000)
committerRoy Marples <roy@marples.name>
Thu, 26 Mar 2015 22:25:26 +0000 (22:25 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index 774029dcda24b672a652e85c48b0acbeb0b20226..195201103bd7db57523725a022cfafa8446afc03 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -704,8 +704,10 @@ ipv4_buildroutes(struct dhcpcd_ctx *ctx)
                                free(or);
                        } else {
                                if (state->added & STATE_FAKE) {
-                                       if (!ipv4_findrt(ctx, rt, 1))
-                                               continue;
+                                       or = ipv4_findrt(ctx, rt, 1);
+                                       if (or == NULL ||
+                                           or->gate.s_addr != rt->gate.s_addr)
+                                               continue;
                                } else {
                                        if (n_route(rt) != 0)
                                                continue;