summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.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/dhcpcd.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/dhcpcd.c')
-rw-r--r--src/dhcpcd.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 1d34cdbb..8762576c 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -700,26 +700,7 @@ dhcpcd_nocarrier_roaming(struct interface *ifp)
{
loginfox("%s: carrier lost - roaming", ifp->name);
-
- /*
- * XXX We should pass something like NOCARRIER_ROAMING
- * and set if_up=true; ifdown=false; so that the hook scripts
- * can make a decision to keep or discard the interface information.
- *
- * Currently they discard it (no carrier after all) which is
- * generally fine as new connections won't work and current
- * connections try to chug along as best as.
- * dhcpcd has been doing this since NetBSD-7 at least.
- *
- * However, for slow roaming this is poor for say web browsing
- * as new lookups will fail quickly giving a poor user experience.
- * We should improve this, but the hooks will require some work first
- * as we need to introduce a mechanism to sort interfaces by
- * carrier > roaming > nocarrier. Then the hooks know in which
- * order to apply their data, if at all.
- * This probably should be a user toggle.
- */
- script_runreason(ifp, "NOCARRIER");
+ script_runreason(ifp, "NOCARRIER_ROAMING");
#ifdef ARP
arp_drop(ifp);