]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
route: Don't log error when adding a route which already exists
authorRoy Marples <roy@marples.name>
Tue, 8 Oct 2019 11:17:22 +0000 (12:17 +0100)
committerRoy Marples <roy@marples.name>
Tue, 8 Oct 2019 11:17:22 +0000 (12:17 +0100)
Add a comment to explain why.

src/route.c

index 01bf8df9dfaa6c094bb716f95601e6d66f2ea27b..a9d971024d0afb4d9f26643ace83b68d7d555812 100644 (file)
@@ -594,7 +594,9 @@ rt_add(rb_tree_t *kroutes, struct rt *nrt, struct rt *ort)
        }
 #endif
 
-       if (if_route(RTM_ADD, nrt) != -1) {
+       /* Shouldn't need to check for EEXIST, but some kernels don't
+        * dump the subnet route just after we added the address. */
+       if (if_route(RTM_ADD, nrt) != -1 || errno == EEXIST) {
                result = true;
                goto out;
        }