]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
White space brigade
authorRoy Marples <roy@marples.name>
Tue, 2 Apr 2013 07:01:11 +0000 (07:01 +0000)
committerRoy Marples <roy@marples.name>
Tue, 2 Apr 2013 07:01:11 +0000 (07:01 +0000)
13 files changed:
arp.c
dhcp-common.c
dhcp6.c
dhcpcd.c
eloop.c
if-bsd.c
if-linux.c
if-options.c
ipv4.c
ipv6.c
ipv6rs.c
platform-linux.c
script.c

diff --git a/arp.c b/arp.c
index cca586c92a63b4356d19f123e95afe00fde9a63e..f014b1b9a8194016f5e13cd6b1d453e682e84792 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -223,7 +223,7 @@ arp_announce(void *arg)
                ipv4_opensocket(ifp, ETHERTYPE_ARP);
                eloop_event_add(state->arp_fd, arp_packet, ifp);
        }
-       if (++state->claims < ANNOUNCE_NUM)     
+       if (++state->claims < ANNOUNCE_NUM)
                syslog(LOG_DEBUG,
                    "%s: sending ARP announce (%d of %d), "
                    "next in %d.00 seconds",
index 4f285ff57b456da9a59436fcf9abde5351fa1d5b..d37477ea44e3ccec533d40732698fa7586ae4ad3 100644 (file)
@@ -157,7 +157,7 @@ decode_rfc3397(char *out, ssize_t len, int pl, const uint8_t *p)
                        *out = '\0';
        }
 
-       return count;  
+       return count;
 }
 
 ssize_t
@@ -378,13 +378,13 @@ print_option(char *s, ssize_t len, int type, int dl, const uint8_t *data,
                        if (dl != -1)
                                l = dl;
                        else
-                               l = 0;  
+                               l = 0;
                        data += 16;
                }
 #endif
                else if (type & BINHEX) {
                        l = snprintf(s, len, "%.2x", data[0]);
-                       data++; 
+                       data++;
                } else
                        l = 0;
                len -= l;
diff --git a/dhcp6.c b/dhcp6.c
index 32ce216bc93b6494c72b52cfea08f3f2ed996e00..8df44eff5b549eac8627f07d7d68a7762e0f4647 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -416,7 +416,7 @@ dhcp6_makemessage(struct interface *ifp)
                TAILQ_FOREACH(ap, &state->addrs, next) {
                        if (ifo->ia_type == D6_OPTION_IA_PD)
                                len += sizeof(*o) + sizeof(u8) +
-                                   sizeof(u32) + sizeof(u32) + 
+                                   sizeof(u32) + sizeof(u32) +
                                    sizeof(ap->prefix.s6_addr);
                        else
                                len += sizeof(*o) + sizeof(ap->addr.s6_addr) +
@@ -1858,8 +1858,6 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
                free(state->recv);
                free(state->new);
                free(state->old);
-//             if (state->state == DH6S_DELEGATED)
-//                     return;
                free(state);
                ifp->if_data[IF_DATA_DHCP6] = NULL;
        }
index 49e0ab1096d55eb02e8bbb33a48943aca9f0528e..759b23149331d62db2414bc2a2679d52ec6df342 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -430,15 +430,15 @@ start_interface(void *arg)
                ipv6rs_start(ifp);
 
        if (ifo->options & DHCPCD_IPV6) {
-               if (ifo->options & DHCPCD_IPV6RS)
-                       nolease = dhcp6_start(ifp, 0);
-               else if (ifo->options & DHCPCD_IA_FORCED)
-                       nolease = dhcp6_start(ifp, 1);
-               else {
-                       nolease = dhcp6_find_delegates(ifp);;
+               if (!(ifo->options & DHCPCD_IPV6RS)) {
+                       if (ifo->options & DHCPCD_IA_FORCED)
+                               nolease = dhcp6_start(ifp, 1);
+                       else
+                               nolease = dhcp6_find_delegates(ifp);;
+                       if (nolease == -1)
+                               syslog(LOG_ERR,
+                                   "%s: dhcp6_start: %m", ifp->name);
                }
-               if (nolease == -1)
-                       syslog(LOG_ERR, "%s: dhcp6_start: %m", ifp->name);
        }
 
        if (ifo->options & DHCPCD_IPV4)
diff --git a/eloop.c b/eloop.c
index 0c220533f1ed5626c55227ef10e8dbdc4bf59f3b..3dfb50c2623ce43bd7bd66f4c1241cab5b13a499 100644 (file)
--- a/eloop.c
+++ b/eloop.c
@@ -127,7 +127,7 @@ eloop_event_add(int fd, void (*callback)(void *), void *arg)
                        return -1;
                }
        }
-    
+
        /* Now populate the structure and add it to the list */
        e->fd = fd;
        e->callback = callback;
@@ -368,7 +368,7 @@ eloop_start(const sigset_t *sigmask)
                        syslog(LOG_ERR, "poll: %m");
                        exit(EXIT_FAILURE);
                }
-               
+
                /* Process any triggered events. */
                if (n > 0) {
                        TAILQ_FOREACH(e, &events, next) {
index e9d32f524393d6aa2351e1d26df145a509129e3c..9fb7130c344148d778df778a76828609c3e00fad 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -215,7 +215,7 @@ if_route(const struct rt *rt, int action)
                struct sockaddr_dl sdl;
                struct sockaddr_storage ss;
        } su;
-       struct rtm 
+       struct rtm
        {
                struct rt_msghdr hdr;
                char buffer[sizeof(su) * 4];
@@ -336,7 +336,7 @@ if_route6(const struct rt6 *rt, int action)
                struct sockaddr_dl sdl;
                struct sockaddr_storage ss;
        } su;
-       struct rtm 
+       struct rtm
        {
                struct rt_msghdr hdr;
                char buffer[sizeof(su) * 4];
@@ -349,17 +349,17 @@ if_route6(const struct rt6 *rt, int action)
  * for link local addreses */
 #ifdef __KAME__
 #define SCOPE {                                                                      \
-               if (IN6_IS_ADDR_LINKLOCAL(&su.sin.sin6_addr)) {               \
+               if (IN6_IS_ADDR_LINKLOCAL(&su.sin.sin6_addr)) {               \
                        *(uint16_t *)(void *)&su.sin.sin6_addr.s6_addr[2] =   \
-                           htons(su.sin.sin6_scope_id);                      \
-                       su.sin.sin6_scope_id = 0;                             \
-               }                                                             \
+                           htons(su.sin.sin6_scope_id);                      \
+                       su.sin.sin6_scope_id = 0;                             \
+               }                                                             \
        }
 #else
 #define SCOPE
 #endif
 
-#define ADDSU {                                                                      \
+#define ADDSU {                                                                      \
                l = RT_ROUNDUP(su.sa.sa_len);                                 \
                memcpy(bp, &su, l);                                           \
                bp += l;                                                      \
index ba317a38f3d84a6a1c6550f4e23077f2f0856708..9cdc839218708bcd3c599d0fcde9848fd0d03da5 100644 (file)
@@ -495,7 +495,7 @@ add_attr_32(struct nlmsghdr *n, unsigned int maxlen, int type, uint32_t data)
 struct nlma
 {
        struct nlmsghdr hdr;
-       struct ifaddrmsg ifa; 
+       struct ifaddrmsg ifa;
        char buffer[64];
 };
 
index e63206be6b0667ac0dc39cbb97ae329f6d347e71..2c83cf7d983519b5c2f47e82c56506b984f65d96 100644 (file)
@@ -767,7 +767,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                                        syslog(LOG_ERR, "%s: %m", __func__);
                                        return -1;
                                }
-                               TAILQ_INIT(ifo->routes);
+                               TAILQ_INIT(ifo->routes);
                        }
                        rt = malloc(sizeof(*rt));
                        if (rt == NULL) {
diff --git a/ipv4.c b/ipv4.c
index b4e128e1e9c9d82e171d5cc1f62e6c735ca3f89b..3eff99f6a265dcc0015ae0c40cac90ab5669405e 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -185,7 +185,7 @@ ipv4_init(void)
 
        if (routes == NULL) {
                routes = malloc(sizeof(*routes));
-               if (routes == NULL) 
+               if (routes == NULL)
                        return -1;
                TAILQ_INIT(routes);
 #ifdef DEBUG_MEMORY
@@ -576,7 +576,7 @@ delete_address(struct interface *iface)
        syslog(LOG_DEBUG, "%s: deleting IP address %s/%d",
            iface->name, inet_ntoa(state->addr), inet_ntocidr(state->net));
        retval = ipv4_deleteaddress(iface, &state->addr, &state->net);
-       if (retval == -1 && errno != EADDRNOTAVAIL) 
+       if (retval == -1 && errno != EADDRNOTAVAIL)
                syslog(LOG_ERR, "del_address: %m");
        state->addr.s_addr = 0;
        state->net.s_addr = 0;
diff --git a/ipv6.c b/ipv6.c
index 70f085d1aa92c39d651237cf6c70155dd47e71e3..b38dd3eb053eb1f3aaf87acbfbb87fda00ce8ddb 100644 (file)
--- a/ipv6.c
+++ b/ipv6.c
@@ -70,7 +70,7 @@ ipv6_init(void)
 
        if (routes == NULL) {
                routes = malloc(sizeof(*routes));
-               if (routes == NULL) 
+               if (routes == NULL)
                        return -1;
                TAILQ_INIT(routes);
 #ifdef DEBUG_MEMORY
@@ -102,7 +102,7 @@ ipv6_printaddr(char *s, ssize_t sl, const uint8_t *d, const char *ifname)
                errno = ENOMEM;
                return -1;
        }
-               
+
        s += strlcpy(s, p, sl);
        if (d[0] == 0xfe && (d[1] & 0xc0) == 0x80) {
                *s++ = '%';
@@ -209,7 +209,7 @@ ipv6_mask(struct in6_addr *mask, int len)
        for (i = 0; i < bytes; i++)
                mask->s6_addr[i] = 0xff;
        if (bits)
-               mask->s6_addr[bytes] = masks[bits - 1]; 
+               mask->s6_addr[bytes] = masks[bits - 1];
        return 0;
 }
 
@@ -438,7 +438,7 @@ ipv6_removesubnet(const struct interface *ifp, struct ipv6_addr *addr)
        if (rt) {
                rt->iface = ifp;
 #ifdef __linux__
-               rt->metric = 256;
+               rt->metric = 1024;
 #else
                rt->metric = 0;
 #endif
index 59d20afe42f0668cc999fab601fce76a78391871..e26a67d10904eb91a3c109a11da55ed49af1c6f0 100644 (file)
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -221,7 +221,7 @@ ipv6rs_makeprobe(struct interface *ifp)
        memcpy(nd + 1, ifp->hwaddr, ifp->hwlen);
        return 0;
 }
-       
+
 static void
 ipv6rs_sendprobe(void *arg)
 {
@@ -733,7 +733,7 @@ ipv6rs_handledata(_unused void *arg)
                                        *opt = '\0';
                        }
                        break;
-                       
+
                case ND_OPT_DNSSL:
                        dnssl = (struct nd_opt_dnssl *)p;
                        lifetime = ntohl(dnssl->nd_opt_dnssl_lifetime);
@@ -913,7 +913,7 @@ ipv6rs_env(char **env, const char *prefix, const struct interface *ifp)
                                break;
                        case ND_OPT_RDNSS:
                                optn = "rdnss";
-                               var = &rdnss;   
+                               var = &rdnss;
                                break;
                        case ND_OPT_DNSSL:
                                optn = "dnssl";
@@ -1007,7 +1007,7 @@ ipv6rs_findprefix(const struct ipv6_addr *a)
                        return ap;
                }
        }
-       return NULL;    
+       return NULL;
 }
 
 static const struct ipv6_addr *
@@ -1080,7 +1080,7 @@ ipv6rs_expire(void *arg)
                                }
                        }
                }
-       
+
                TAILQ_FOREACH_SAFE(rao, &rap->options, next, raon) {
                        if (rap->expired) {
                                switch(rao->type) {
@@ -1144,24 +1144,24 @@ ipv6rs_start(struct interface *ifp)
                eloop_event_add(sock, ipv6rs_handledata, NULL);
        }
 
-       eloop_timeout_delete(NULL, ifp);
-       state = RS_STATE(ifp);
-       if (state == NULL) {
+       eloop_timeout_delete(NULL, ifp);
+
+       state = RS_STATE(ifp);
+       if (state == NULL) {
                ifp->if_data[IF_DATA_IPV6RS] = calloc(1, sizeof(*state));
-               state = RS_STATE(ifp);
+               state = RS_STATE(ifp);
                if (state == NULL) {
                        syslog(LOG_ERR, "%s: %m", __func__);
                        return -1;
                }
-       }
-       /* Always make a new probe as the underlying hardware
-        * address could have changed. */
-       ipv6rs_makeprobe(ifp);
+       }
+
+       /* Always make a new probe as the underlying hardware
+        * address could have changed. */
+       ipv6rs_makeprobe(ifp);
        if (state->rs == NULL) {
                syslog(LOG_ERR, "%s: ipv6rs_makeprobe: %m", __func__);
-               return -1;
+               return -1;
        }
 
        state->rsprobes = 0;
index f074cfc6f66a306f29c3bec66414a78c8319c1d1..323a3bcb8062c76a40e717052449d8dfec260399 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * dhcpcd - DHCP client daemon
  * Copyright (c) 2006-2012 Roy Marples <roy@marples.name>
  * All rights reserved
@@ -36,7 +36,7 @@
 #include "if-options.h"
 #include "platform.h"
 
-static const char *mproc = 
+static const char *mproc =
 #if defined(__alpha__)
        "system type"
 #elif defined(__arm__)
index 5f9005eeccc24def195c657189bd8ecdb7e8e8bf..b36c80e6374a47903358b9ab36f5078ef634b721 100644 (file)
--- a/script.c
+++ b/script.c
@@ -247,7 +247,7 @@ make_env(const struct interface *ifp, const char *reason, char ***argv)
        snprintf(env[1], e, "reason=%s", reason);
        if (options & DHCPCD_DUMPLEASE)
                goto dumplease;
-       e = 20;
+       e = 20;
        EMALLOC(2, e);
        snprintf(env[2], e, "pid=%d", getpid());
        EMALLOC(3, e);
@@ -525,7 +525,7 @@ script_runreason(const struct interface *ifp, const char *reason)
            ifp->options->script[0] == '\0' ||
            strcmp(ifp->options->script, "/dev/null") == 0)
                return 0;
-       
+
        syslog(LOG_DEBUG, "%s: executing `%s', reason %s",
            ifp->name, argv[0], reason);