]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix some -Wconversion errors on FreeBSD.
authorRoy Marples <roy@marples.name>
Fri, 25 Apr 2014 13:05:15 +0000 (13:05 +0000)
committerRoy Marples <roy@marples.name>
Fri, 25 Apr 2014 13:05:15 +0000 (13:05 +0000)
dhcp.c
dhcp6.c
dhcp6.h
ipv6nd.c

diff --git a/dhcp.c b/dhcp.c
index 3791aae299c2944ff0ef984dfd296a82525eaccd..f2ff32c39114b18f2b38415455fbc3515a96061f 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1871,11 +1871,11 @@ dhcp_bind(void *arg)
                lease->renewaltime = lease->rebindtime = lease->leasetime;
        else {
                eloop_timeout_add_sec(iface->ctx->eloop,
-                   lease->renewaltime, dhcp_renew, iface);
+                   (time_t)lease->renewaltime, dhcp_renew, iface);
                eloop_timeout_add_sec(iface->ctx->eloop,
-                   lease->rebindtime, dhcp_rebind, iface);
+                   (time_t)lease->rebindtime, dhcp_rebind, iface);
                eloop_timeout_add_sec(iface->ctx->eloop,
-                   lease->leasetime, dhcp_expire, iface);
+                   (time_t)lease->leasetime, dhcp_expire, iface);
                syslog(LOG_DEBUG,
                    "%s: renew in %"PRIu32" seconds, rebind in %"PRIu32
                    " seconds",
diff --git a/dhcp6.c b/dhcp6.c
index ebc3c6a7d9a6dc3c01ce87e09b9e02f6e0707679..c181331049b4ae909076479cf8a9c76c4b83ed79 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -2228,7 +2228,7 @@ dhcp6_handledata(void *arg)
                        if (u32 >= 60 && u32 <= 86400) {
                                syslog(LOG_DEBUG, "%s: SOL_MAX_RT %d -> %d",
                                    ifp->name, state->sol_max_rt, u32);
-                               state->sol_max_rt = u32;
+                               state->sol_max_rt = (time_t)u32;
                        } else
                                syslog(LOG_ERR, "%s: invalid SOL_MAX_RT %d",
                                    ifp->name, u32);
@@ -2240,7 +2240,7 @@ dhcp6_handledata(void *arg)
                        if (u32 >= 60 && u32 <= 86400) {
                                syslog(LOG_DEBUG, "%s: INF_MAX_RT %d -> %d",
                                    ifp->name, state->inf_max_rt, u32);
-                               state->inf_max_rt = u32;
+                               state->inf_max_rt = (time_t)u32;
                        } else
                                syslog(LOG_ERR, "%s: invalid INF_MAX_RT %d",
                                    ifp->name, u32);
@@ -2406,15 +2406,16 @@ recv:
                else
                        state->state = DH6S_BOUND;
                if (state->renew && state->renew != ND6_INFINITE_LIFETIME)
-                       eloop_timeout_add_sec(ifp->ctx->eloop, state->renew,
+                       eloop_timeout_add_sec(ifp->ctx->eloop,
+                           (time_t)state->renew,
                            state->state == DH6S_INFORMED ?
                            dhcp6_startinform : dhcp6_startrenew, ifp);
                if (state->rebind && state->rebind != ND6_INFINITE_LIFETIME)
-                       eloop_timeout_add_sec(ifp->ctx->eloop, state->rebind,
-                           dhcp6_startrebind, ifp);
+                       eloop_timeout_add_sec(ifp->ctx->eloop,
+                           (time_t)state->rebind, dhcp6_startrebind, ifp);
                if (state->expire && state->expire != ND6_INFINITE_LIFETIME)
-                       eloop_timeout_add_sec(ifp->ctx->eloop, state->expire,
-                           dhcp6_startexpire, ifp);
+                       eloop_timeout_add_sec(ifp->ctx->eloop,
+                           (time_t)state->expire, dhcp6_startexpire, ifp);
                if (ifp->options->ia_type == D6_OPTION_IA_PD)
                        dhcp6_delegate_prefix(ifp);
 
diff --git a/dhcp6.h b/dhcp6.h
index 9e148b7668209815a0492f6ce71019faa07ad90e..468c4f5f0e2a181789a2245431a6335194f89827 100644 (file)
--- a/dhcp6.h
+++ b/dhcp6.h
@@ -174,12 +174,12 @@ struct dhcp6_state {
        struct timeval RT;
        unsigned int IMD;
        unsigned int RTC;
-       unsigned int IRT;
+       time_t IRT;
        unsigned int MRC;
-       unsigned int MRT;
+       time_t MRT;
        void (*MRCcallback)(void *);
-       unsigned int sol_max_rt;
-       unsigned int inf_max_rt;
+       time_t sol_max_rt;
+       time_t inf_max_rt;
 
        struct dhcp6_message *send;
        size_t send_len;
index 615ad6612f06d0ed8647e589c8c1a386a9bd5779..53893a154090a66d46c3abee202f858dc0f54c78 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -905,7 +905,7 @@ ipv6nd_handlera(struct ipv6_ctx *ctx, struct interface *ifp,
                if (lifetime == ~0U)
                        timerclear(&rao->expire);
                else {
-                       expire.tv_sec = lifetime;
+                       expire.tv_sec = (time_t)lifetime;
                        expire.tv_usec = 0;
                        timeradd(&rap->received, &expire, &rao->expire);
                }
@@ -1110,7 +1110,7 @@ ipv6nd_expirera(void *arg)
                        continue;
                valid = 0;
                if (rap->lifetime) {
-                       lt.tv_sec = rap->lifetime;
+                       lt.tv_sec = (time_t)rap->lifetime;
                        lt.tv_usec = 0;
                        timeradd(&rap->received, &lt, &expire);
                        if (rap->lifetime == 0 || timercmp(&now, &expire, >)) {