]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove some dead uses of get_monotonic
authorRoy Marples <roy@marples.name>
Fri, 7 Feb 2014 19:41:35 +0000 (19:41 +0000)
committerRoy Marples <roy@marples.name>
Fri, 7 Feb 2014 19:41:35 +0000 (19:41 +0000)
dhcp.c
dhcp.h
ipv6nd.c

diff --git a/dhcp.c b/dhcp.c
index cb8e2f7472dc5ea3a935bef85ebad26aa996eaab..4db37e37070e4d48c08865e6b1e633095a9ffb32 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1255,7 +1255,6 @@ dhcp_env(char **env, const char *prefix, const struct dhcp_message *dhcp,
 void
 get_lease(struct dhcp_lease *lease, const struct dhcp_message *dhcp)
 {
-       struct timeval now;
 
        lease->cookie = dhcp->cookie;
        /* BOOTP does not set yiaddr for replies when ciaddr is set. */
@@ -1267,12 +1266,7 @@ get_lease(struct dhcp_lease *lease, const struct dhcp_message *dhcp)
                lease->net.s_addr = ipv4_getnetmask(lease->addr.s_addr);
        if (get_option_addr(&lease->brd, dhcp, DHO_BROADCAST) == -1)
                lease->brd.s_addr = lease->addr.s_addr | ~lease->net.s_addr;
-       if (get_option_uint32(&lease->leasetime, dhcp, DHO_LEASETIME) == 0) {
-               /* Ensure that we can use the lease */
-               get_monotonic(&now);
-               if (now.tv_sec + (time_t)lease->leasetime < now.tv_sec)
-                       lease->leasetime = ~0U; /* Infinite lease */
-       } else
+       if (get_option_uint32(&lease->leasetime, dhcp, DHO_LEASETIME) != 0)
                lease->leasetime = ~0U; /* Default to infinite lease */
        if (get_option_uint32(&lease->renewaltime, dhcp, DHO_RENEWALTIME) != 0)
                lease->renewaltime = 0;
@@ -1731,8 +1725,6 @@ dhcp_bind(void *arg)
        uint8_t ipv4ll = 0;
 
        state->reason = NULL;
-       if (clock_monotonic)
-               get_monotonic(&lease->boundtime);
        state->xid = 0;
        free(state->old);
        state->old = state->new;
diff --git a/dhcp.h b/dhcp.h
index 68f1e678794d16ea87a8e9155f5fca91a6a5f3a0..bf05441d9a10d40888bc6b7e75dafa7f76a1f6cd 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -181,7 +181,6 @@ struct dhcp_lease {
        uint32_t rebindtime;
        struct in_addr server;
        time_t leasedfrom;
-       struct timeval boundtime;
        uint8_t frominfo;
        uint32_t cookie;
 };
index 43f7645cd66833ab3b637c74ea79c53e2ba536c9..874a1ea592aaf39d29871174de0c8f8bffa3cf03 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -1067,7 +1067,6 @@ ipv6nd_env(char **env, const char *prefix, const struct interface *ifp)
 {
        ssize_t l;
        size_t len;
-       struct timeval now;
        const struct ra *rap;
        const struct ra_opt *rao;
        int i;
@@ -1077,7 +1076,6 @@ ipv6nd_env(char **env, const char *prefix, const struct interface *ifp)
 
        i = 0;
        l = 0;
-       get_monotonic(&now);
        TAILQ_FOREACH(rap, &ipv6_routers, next) {
                i++;
                if (rap->iface != ifp)