chiark / gitweb /
userv-ipif: Always request routes from userv, regardless of link quality
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Dec 2011 01:11:24 +0000 (01:11 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Dec 2011 15:54:03 +0000 (15:54 +0000)
Previously the userv-ipif netlink would not request (from userv) a
route for a site for which the link quality was DOWN.  The link
quality is a dynamic quantity but userv-ipif lacks any machinery for
dynamically adding routes, so this is wrong.

Instead, in userv-ipif, unconditionally add routes for all sites,
regardless of link up status.

In practice this code is run during startup and the only reason a link
might be down at that point, ie LINK_QUALITY_DOWN, is that it does not
have an address configured.  Mobile sites are often in this situation.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
slip.c

diff --git a/slip.c b/slip.c
index a296e420597ee9e1ae81ef1ea0b16492b25ee91c..7c138d10fe02306cbe792c11520f7520d537a08d 100644 (file)
--- a/slip.c
+++ b/slip.c
@@ -257,13 +257,11 @@ static void userv_invoke_userv(struct userv *st)
 
     allnets=ipset_new();
     for (r=st->slip.nl.clients; r; r=r->next) {
-       if (r->up) {
-           struct ipset *nan;
-           r->kup=True;
-           nan=ipset_union(allnets,r->networks);
-           ipset_free(allnets);
-           allnets=nan;
-       }
+       struct ipset *nan;
+       r->kup=True;
+       nan=ipset_union(allnets,r->networks);
+       ipset_free(allnets);
+       allnets=nan;
     }
     snets=ipset_to_subnet_list(allnets);
     ipset_free(allnets);