diff options
| author | Roy Marples <roy@marples.name> | 2009-01-27 18:09:02 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-27 18:09:02 +0000 |
| commit | fa344ba2b1dcf002f348b7fa69ef422585b4b438 (patch) | |
| tree | 0a20b9e8aeec52fcec0f5c30a669cb8b444b35ec /configure.c | |
| parent | 16687a3be1f8c1e6d55cdd691e947e5760eef30c (diff) | |
| download | dhcpcd-fa344ba2b1dcf002f348b7fa69ef422585b4b438.tar.xz | |
Add route removal detection to Linux.
This involved a rejig of the socket code so we can detect
if we removed the route or not.
Diffstat (limited to 'configure.c')
| -rw-r--r-- | configure.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/configure.c b/configure.c index 96d8d886..a5af5a2a 100644 --- a/configure.c +++ b/configure.c @@ -392,22 +392,14 @@ desc_route(const char *cmd, const struct rt *rt, const char *ifname) /* If something other than dhcpcd removes a route, * we need to remove it from our internal table. */ int -route_deleted(const struct in_addr *dst, - const struct in_addr *net, - const struct in_addr *gate) +route_deleted(const struct rt *rt) { - struct rt rt, *f, *l; + struct rt *f, *l; - rt.dest.s_addr = dst->s_addr; - rt.net.s_addr = net->s_addr; - rt.gate.s_addr = gate->s_addr; - rt.iface = NULL; - rt.next = NULL; - - f = find_route(routes, &rt, &l, NULL); + f = find_route(routes, rt, &l, NULL); if (f == NULL) return 0; - desc_route("removing", f, f->iface->name); + desc_route("removing", f, rt->iface->name); if (l) l->next = f->next; else |
