]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove unused variables
authorRoy Marples <roy@marples.name>
Sun, 1 Apr 2012 07:38:52 +0000 (07:38 +0000)
committerRoy Marples <roy@marples.name>
Sun, 1 Apr 2012 07:38:52 +0000 (07:38 +0000)
dhcp.c
dhcpcd.c
ipv6rs.c

diff --git a/dhcp.c b/dhcp.c
index 6745180abc808d4ed11f67d4d45f671c89916bc0..cc705b3b9cc4f2d0f96a90721899cce528fc648e 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1361,7 +1361,6 @@ ssize_t
 configure_env(char **env, const char *prefix, const struct dhcp_message *dhcp,
     const struct if_options *ifo)
 {
-       unsigned int i;
        const uint8_t *p;
        int pl;
        struct in_addr addr;
@@ -1404,7 +1403,6 @@ configure_env(char **env, const char *prefix, const struct dhcp_message *dhcp,
                        net.s_addr = get_netmask(addr.s_addr);
                        setvar(&ep, prefix, "subnet_mask", inet_ntoa(net));
                }
-               i = inet_ntocidr(net);
                snprintf(cidr, sizeof(cidr), "%d", inet_ntocidr(net));
                setvar(&ep, prefix, "subnet_cidr", cidr);
                if (get_option_addr(&brd, dhcp, DHO_BROADCAST) == -1) {
index 8ad52c4f1abac5166c4aac016d654a60ee73a408..b6595fead264266b2dea01fa27d0d17a4fc83afe 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1499,12 +1499,12 @@ reconf_reboot(int action, int argc, char **argv, int oi)
 static void
 handle_signal(_unused void *arg)
 {
-       struct interface *ifp, *ifl;
+       struct interface *ifp;
        struct if_options *ifo;
        int sig = signal_read();
-       int do_release, do_rebind, i;
+       int do_release, i;
 
-       do_rebind = do_release = 0;
+       do_release = 0;
        switch (sig) {
        case SIGINT:
                syslog(LOG_INFO, "received SIGINT, stopping");
@@ -1561,11 +1561,9 @@ handle_signal(_unused void *arg)
        /* As drop_dhcp could re-arrange the order, we do it like this. */
        for (;;) {
                /* Be sane and drop the last config first */
-               ifl = NULL;
                for (ifp = ifaces; ifp; ifp = ifp->next) {
                        if (ifp->next == NULL)
                                break;
-                       ifl = ifp;
                }
                if (ifp == NULL)
                        break;
@@ -1582,7 +1580,7 @@ int
 handle_args(struct fd_list *fd, int argc, char **argv)
 {
        struct interface *ifp;
-       int do_exit = 0, do_release = 0, do_reboot = 0, do_reconf = 0;
+       int do_exit = 0, do_release = 0, do_reboot = 0;
        int opt, oi = 0;
        ssize_t len;
        size_t l;
@@ -1673,7 +1671,7 @@ handle_args(struct fd_list *fd, int argc, char **argv)
        {
                switch (opt) {
                case 'g':
-                       do_reconf = 1;
+                       /* Assumed if below not set */
                        break;
                case 'k':
                        do_release = 1;
index f47a1a0feed319c42eea576de359e95231b579a6..31587264d1d22837a56bc240ddb82d81fd595dc3 100644 (file)
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -684,12 +684,10 @@ ipv6rs_expire(void *arg)
        struct ra_opt *rao, *raol, *raon;
        struct timeval now, lt, expire, next;
        int expired;
-       uint32_t expire_secs;
 
        ifp = arg;
        get_monotonic(&now);
        expired = 0;
-       expire_secs = ~0U;
        timerclear(&next);
 
        for (rap = ifp->ras, ral = NULL;