From: Roy Marples Date: Fri, 7 Feb 2014 19:41:35 +0000 (+0000) Subject: Remove some dead uses of get_monotonic X-Git-Tag: v6.3.0~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbcba92fa6729c15a7b410fb2419d518a4eb3ab8;p=thirdparty%2Fdhcpcd.git Remove some dead uses of get_monotonic --- diff --git a/dhcp.c b/dhcp.c index cb8e2f74..4db37e37 100644 --- 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 68f1e678..bf05441d 100644 --- 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; }; diff --git a/ipv6nd.c b/ipv6nd.c index 43f7645c..874a1ea5 100644 --- 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)