summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-12-27 19:53:31 +0000
committerRoy Marples <roy@marples.name>2020-12-27 19:53:31 +0000
commit3547ed19f021396e2f4624f758d681e9a5251dc9 (patch)
treed674c9d03f4f4baf55ce73e4bb18819868d1b203 /src/if.c
parent572a94cef8286f343f39fbfdedcc469ebb94977e (diff)
downloaddhcpcd-3547ed19f021396e2f4624f758d681e9a5251dc9.tar.xz
hooks: add NOCARRIER_ROAMING reason
This is given when the OS supports the concept of wireless roaming or the IP setup can be persisted when the carrier drops. When this happens, routes are moved to a higher metric (if supported) to support non preferred but non roaming routes. The `interface_order` hook variable will now order the interfaces according to priority and move roaming interfaces to the back of the list. If resolvconf is present then it is called with the -C option to deprecate DNS and if carrier comes back it is called again with the -c option to activate it once more. As part of this change, default route metrics have been changed to support a larger number of interfaces. base metric 1000 (was 200) wireless offset 2000 (was 100) IPv4LL offset 1000000 (was 10000) roaming offset 2000000
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/if.c b/src/if.c
index deb5280b..d3852f3d 100644
--- a/src/if.c
+++ b/src/if.c
@@ -697,12 +697,11 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
ifp->metric = (unsigned int)ifr.ifr_metric;
if_getssid(ifp);
#else
- /* We reserve the 100 range for virtual interfaces, if and when
- * we can work them out. */
- ifp->metric = 200 + ifp->index;
+ /* Leave a low portion for user config */
+ ifp->metric = RTMETRIC_BASE + ifp->index;
if (if_getssid(ifp) != -1) {
ifp->wireless = true;
- ifp->metric += 100;
+ ifp->metric += RTMETRIC_WIRELESS;
}
#endif