]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix changing routes on BSD.
authorRoy Marples <roy@marples.name>
Mon, 10 Nov 2008 08:31:33 +0000 (08:31 +0000)
committerRoy Marples <roy@marples.name>
Mon, 10 Nov 2008 08:31:33 +0000 (08:31 +0000)
configure.c

index 53fd9a8de1cacd7c0aa18f6c35d468417a0e3d75..09b59dfeb34e6fa9312df0f616ae5868ccaf237b 100644 (file)
@@ -268,20 +268,15 @@ c_route(struct rt *ort, struct rt *nrt, const struct interface *iface)
                        iface->name, addr,
                        inet_ntocidr(nrt->net), inet_ntoa(nrt->gate));
        free(addr);
-#if HAVE_ROUTE_METRIC
+       /* We don't call change_route because it doesn't work when something
+        * has already used it. */
        del_route(ort->iface, &ort->dest, &ort->net, &ort->gate, ort->iface->metric);
        if (!add_route(iface, &nrt->dest, &nrt->net, &nrt->gate, iface->metric))
                return 0;
        syslog(LOG_ERR, "add_route: %m");
-#else
-       if (!change_route(iface, &ort->dest, &ort->net, &nrt->gate, iface->metric))
-               return 0;
-       syslog(LOG_ERR, "change_route: %m");
-#endif
        return -1;
 }
 
-
 static int
 d_route(struct rt *rt, const struct interface *iface, int metric)
 {