From: Roy Marples Date: Tue, 2 Apr 2013 07:01:11 +0000 (+0000) Subject: White space brigade X-Git-Tag: v5.99.6~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=673e81e5b7c3ba958553d41590533121d822d08b;p=thirdparty%2Fdhcpcd.git White space brigade --- diff --git a/arp.c b/arp.c index cca586c9..f014b1b9 100644 --- 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", diff --git a/dhcp-common.c b/dhcp-common.c index 4f285ff5..d37477ea 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -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 32ce216b..8df44eff 100644 --- 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; } diff --git a/dhcpcd.c b/dhcpcd.c index 49e0ab10..759b2314 100644 --- 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 0c220533..3dfb50c2 100644 --- 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) { diff --git a/if-bsd.c b/if-bsd.c index e9d32f52..9fb7130c 100644 --- 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; \ diff --git a/if-linux.c b/if-linux.c index ba317a38..9cdc8392 100644 --- a/if-linux.c +++ b/if-linux.c @@ -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]; }; diff --git a/if-options.c b/if-options.c index e63206be..2c83cf7d 100644 --- a/if-options.c +++ b/if-options.c @@ -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 b4e128e1..3eff99f6 100644 --- 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 70f085d1..b38dd3eb 100644 --- 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 diff --git a/ipv6rs.c b/ipv6rs.c index 59d20afe..e26a67d1 100644 --- 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; diff --git a/platform-linux.c b/platform-linux.c index f074cfc6..323a3bcb 100644 --- a/platform-linux.c +++ b/platform-linux.c @@ -1,4 +1,4 @@ -/* +/* * dhcpcd - DHCP client daemon * Copyright (c) 2006-2012 Roy Marples * 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__) diff --git a/script.c b/script.c index 5f9005ee..b36c80e6 100644 --- 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);